09.09.2010, 03:00
I say using MySQL is faster and more efficient. (Depending on how well you know it).
This is my SetLevel Command, I'm a little to tired to change it. You can get a simple base off of it.
With the enum's...I save their stats OnDisconnect, or every 15 seconds with a timer or something.
This is my SetLevel Command, I'm a little to tired to change it. You can get a simple base off of it.
pawn Код:
CMD:setlevel(playerid, params[])
{
new
id,
level
;
if(PlayerInfo[playerid][Admin] >= 5 || RconAdmin(playerid))
{
if(sscanf(params, "ui", id, level))
{
return SendClientMessage(playerid, LBLUE, "Usage: /setlevel (playerid) (level)") &&
SendClientMessage(playerid, GREEN, "Function: Set a person a admin");
}
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, RED, "ERROR: That is a invalid player ID");
format(str, sizeof(str), "UPDATE `playerinfo` SET `Admin` = %d WHERE `User` = '%s'", level, pName(id));
mysql_query(str);
format(str, sizeof(str), "|- Administrator %s has made %s (%d) admin level %d -|", pName(playerid), pName(id), id, level);
SendClientMessageToAll(ORANGE, str);
PlayerInfo[playerid][Admin] = level;
}
else SendClientMessage(playerid, RED, "ERROR: You are not a level 5 admin!");
return 1;
}