06.03.2017, 22:13
Hello,
i have 2lvl Admin system. The first lvl Admin is functional ok, but if i give a second one to the player by the command, after reconnect the player to the server, after login, the player is getting crash.
The code to give the Admin, is fine.
The PlayerDB, and other are just fine.
If i make myself a Admin lvl 2 in the PlayerDB to "adminsec=1", after login, i getting crash..
i have 2lvl Admin system. The first lvl Admin is functional ok, but if i give a second one to the player by the command, after reconnect the player to the server, after login, the player is getting crash.
The code to give the Admin, is fine.
Код HTML:
if(!strcmp(cmdtext, "/giveadminsec", true,13)) { if(playerDB[playerid][sadmin]!= true){SendClientMessage(playerid, RED, "* No command!"); return 1;} new tname[MAX_PLAYER_NAME]; strmid(tname,GetArgument(1, cmdtext, 0),0,MAX_PLAYER_NAME); if(!strcmp(tname,"0",true)){SendClientMessage(playerid, BLUE, "* Give Admin lvl2: /giveadminsec [nick]"); return 1;} new tid = GetPlayeridMid(tname); if(tid==INVALID_PLAYER_ID) { SendClientMessage(playerid,RED,"*No player by this name"); return 1; } GetPlayerName(tid,tname,sizeof(tname)); new mess[256],name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); playerDB[tid][adminsec] = true; format(mess,sizeof(mess),"* Congratulations, you're the 2lvl Admin."); SavePlayerData(tid, false); SendClientMessage(tid,RED,mess); format(mess,sizeof(mess),"* You gave the Second lvl admin to %s.",tname); SendClientMessage(playerid,RED,mess); return 1; }
If i make myself a Admin lvl 2 in the PlayerDB to "adminsec=1", after login, i getting crash..