Include MySQL
#28
(01-12-2014, 02:33 AM)xoft Wrote: I don't understand what exactly you want. If you need to store "name"="value" pairs in Lua, use a regular Lua table; internally it is a hashmap.

Thanks now all is working.
Now i will modify the Chat Message but on the start i become a error.

function OnPlayerChat(Player, Message)
	cRoot:BroadcastChat("<Rank : " .. Player:GetName() .. "> " .. Message);
	return true;
end

cPluginManager.AddHook(cPluginManager.HOOK_CHAT, OnPlayerChat);

Error:
Code:
[20:32:54] cPluginManager:AddHook(): bad parameters. Expected HOOK_TYPE and CallbackFunction, got TNUMBER, TNIL, TNONE. Hook not added.
[20:32:54] Stack trace:
[20:32:54]   [C](-1): AddHook
[20:32:54]   Plugins/Permissions/main.lua(14): ?
[20:32:54] Stack trace end

Can you say me what the error mean?

Edit: I saw that when a player is logging out it comes a mysql error:
Code:
[20:13:30] Error on shutting down socket 12 (192.168.178.51): 107: Transport endpoint is not connected

Login Code:
function OnPlayerJoined(Player)
	local request = assert (con:execute("SELECT rank FROM ranks WHERE name LIKE \'" .. Player:GetName() .. "\'"));
	local result = assert (request:fetch());
	
	rank[Player:GetName()] = result;
	Player:SendMessage(rank[Player:GetName()]);
	
	request:close();
end
Reply
Thanks given by:


Messages In This Thread
Include MySQL - by daniel0916 - 01-07-2014, 01:53 AM
RE: Include MySQL - by xoft - 01-07-2014, 02:27 AM
RE: Include MySQL - by daniel0916 - 01-07-2014, 02:48 AM
RE: Include MySQL - by bearbin - 01-07-2014, 02:37 AM
RE: Include MySQL - by xoft - 01-07-2014, 02:46 AM
RE: Include MySQL - by FakeTruth - 01-07-2014, 02:47 AM
RE: Include MySQL - by xoft - 01-07-2014, 02:49 AM
RE: Include MySQL - by daniel0916 - 01-07-2014, 03:31 AM
RE: Include MySQL - by xoft - 01-07-2014, 04:22 AM
RE: Include MySQL - by daniel0916 - 01-07-2014, 04:32 AM
RE: Include MySQL - by xoft - 01-07-2014, 05:12 AM
RE: Include MySQL - by daniel0916 - 01-07-2014, 05:48 AM
RE: Include MySQL - by NiLSPACE - 01-07-2014, 04:34 AM
RE: Include MySQL - by xoft - 01-07-2014, 06:25 AM
RE: Include MySQL - by daniel0916 - 01-08-2014, 02:25 AM
RE: Include MySQL - by xoft - 01-08-2014, 02:52 AM
RE: Include MySQL - by daniel0916 - 01-08-2014, 04:20 AM
RE: Include MySQL - by daniel0916 - 01-09-2014, 02:50 AM
RE: Include MySQL - by xoft - 01-09-2014, 05:31 AM
RE: Include MySQL - by daniel0916 - 01-09-2014, 05:39 AM
RE: Include MySQL - by xoft - 01-09-2014, 05:46 AM
RE: Include MySQL - by daniel0916 - 01-09-2014, 05:49 AM
RE: Include MySQL - by xoft - 01-09-2014, 04:51 PM
RE: Include MySQL - by daniel0916 - 01-10-2014, 03:07 AM
RE: Include MySQL - by xoft - 01-10-2014, 06:59 AM
RE: Include MySQL - by daniel0916 - 01-12-2014, 01:49 AM
RE: Include MySQL - by xoft - 01-12-2014, 02:33 AM
RE: Include MySQL - by daniel0916 - 01-12-2014, 05:40 AM
RE: Include MySQL - by xoft - 01-12-2014, 06:01 AM



Users browsing this thread: 1 Guest(s)