/makeadmin issue
#1

when i do the cmd it makes the player an adminstrator and saves his rank in his Users file but when that player rejoins his level is 0 , here's the cmd

Код:
CMD:makeadmin(playerid,params[])
{
	if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,0xFF0000FF,"<!>You are not authorized to use this command!");
 	new pID,rank,string1[128],string2[128],string3[128];
 	if(sscanf(params,"ui",pID,rank))return SendClientMessage(playerid,COL_GREEN,"/makeadmin [id] [level]");
 	if(rank<0||rank>6)return SendClientMessage(playerid,COL_GREEN,"Please write an acceptable level.");
 	SetPVarInt(pID,"Admin",rank);
  	PlayerInfo[pID][pAdmin] = rank;
 	format(string1,sizeof(string1),"You promoted %s to level %i",PlayerName(pID),rank);
 	GameTextForPlayer(playerid,"~r~PROMOTED",3000,4);
 	format(string2,sizeof(string2),"* You are promoted to level %i. Try /admincommands [%i] to see the commands you can use now.",rank,rank);
 	for(new i=0;i<GetMaxPlayers();i++)
	{
	if(IsPlayerConnected(i))
	{
	if(IsPlayerAnAdmin(i,1))
	{
    format(string3,sizeof(string3),"A: %s [LEVEL: %i] used the MAKEADMIN command.",PlayerName(playerid),GetPVarInt(playerid,"Admin"));
	SendClientMessage(i,COLOR_ORANGE,string3);
	}
	}
	}
	SendClientMessage(playerid,COLOR_LIGHTBLUE,string1);
 	SendClientMessage(pID,COLOR_ORANGE,string2);
   	return 1;
}
Thanks
Reply
#2

Are you saving the files right?
Reply
#3

i dont get what u mean but I have a file called Accounts in the scriptfies which saves players info , and when i check i find the rank i set while doing the cmd , so its set ingame(while players is online when he got promoted ONLY) and in the player's info , when the player rejoins his lvl in-game = 0 , but still in his info = rank
Reply
#4

EDiTED
Reply
#5

so how to fix that ? :/
Reply
#6

send the enum
Reply
#7

Код:
enum pInfo
{
    pPass[129],
	pScore,
    pCash,
    pAdmin,
    AFKstatus,
    pVIP,
    pKills,
    pDeaths,
    pWantedLvl,
    pMoneybag,
    pReactionTest,
    pMathTest,
	pWarnings,
	pKicks,
	pBans,
	pBanned
}

new PlayerInfo[MAX_PLAYERS][pInfo];
Reply
#8

solved..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)