29.05.2015, 15:11
I'm using mysql. So, it doesn't save admin status whenever i gave admin status
This is my mysql save system. now tell me how can i add this in cmd so admins stats will be saved whenever you relog or join again.
This is my mysql save system. now tell me how can i add this in cmd so admins stats will be saved whenever you relog or join again.
PHP код:
PVar[playerid][pLevel]
PHP код:
CMD:setlevel(playerid, params[])
{
if(PVar[playerid][pLevel] >= 5 || IsPlayerAdmin(playerid))
{
new pID, Level;
if(sscanf(params, "ud", pID, Level)) return SendClientMessage(playerid, COLOR_RED, "* Error: /SetLevel < Player ID > < Level >");
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "* That user is not connected!");
if(GetPVarInt(pID, "LoggedIN") == 1)
{
new
Year,
Month,
Day,
Hour,
Minute,
Second;
getdate(Year, Month, Day); gettime(Hour, Minute, Second);
if(Level > 0) SendFMessage(pID, COLOR_LIGHTBLUE, "Admin: %s(%d) has set your admin level to: %d - %s", pName(playerid), playerid, Level);
else SendFMessage(pID, COLOR_LIGHTBLUE, "Admin: %s(%d) has set your admin level to: %d", pName(playerid), playerid, Level);
if(Level > PVar[pID][pLevel]) GameTextForPlayer(pID, "~r~P~g~r~p~o~y~m~p~o~g~t~w~e~p~d!", 4000, 0);
else GameTextForPlayer(pID, "~r~Demoted", 4000, 0);
SendFMessage(playerid, COLOR_LIGHTBLUE, "You Have given %s Admin level %d On '%d/%d/%d' at '%d:%d:%d'", pName(pID), Level, Day, Month, Year, Hour, Minute, Second);
SendFMessageToAll(COLOR_LIGHTBLUE, "Admin: %s(%d) has given: %s(%d) admin level: %d", pName(playerid), playerid, pName(pID), pID, Level);
PVar[pID][pLevel] = Level;
return PlayerPlaySound(pID, 1057, 0.0, 0.0, 0.0);
}
else return SendClientMessage(playerid, COLOR_RED, "* That user does not have an account!");
}
else return SendClientMessage(playerid, COLOR_RED, "Only admin level 5 commands!");
}