04.05.2009, 16:44
Hello, I have this issue, where my Makeadmin script does not retain the admin information, it makes the person administrator and everything all fine, but when I restart the server, the player loses their admin... why?
Code:
if(strcmp(cmd, "/makeadmin", true) == 0) { if(IsPlayerAdmin(playerid)) { new level; new newadmin[18]; tmp = strtok(cmdtext, idx); new newadminid = strval(tmp); if(IsPlayerConnected(newadminid)) { if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid] [level(1-5)]"); return 1; } else { tmp = strtok(cmdtext, idx); level = strval(tmp); GetPlayerName(newadminid, newadmin, sizeof(newadmin)); GetPlayerName(playerid, pname, sizeof(pname)); format(string, sizeof(string), "You are now an admin level %d.", level); SendClientMessage(newadminid, COLOR_YELLOW, string); format(string, sizeof(string), "You made %s a level %d admin.", newadmin, level); SendClientMessage(playerid, COLOR_YELLOW, string); PlayerInfo[newadminid][pAdmin] = level; OnPlayerUpdate(playerid); return 1; } } } }