Help please with /setadmin
#2

Try this.

Код:
 

if(strcmp("/setadmin", cmdtext, true, 10) == 0)
    {
        new level,playerid2,file[256],PlayerName[MAX_PLAYER_NAME],PlayerName2[MAX_PLAYER_NAME];
        new tmp2[256], Index,str[50],str2[50];
        tmp = strtok(cmdtext,Index), tmp2 = strtok(cmdtext,Index),playerid2 = strval(tmp),level = strval(tmp2);
        GetPlayerName(playerid2,PlayerName,MAX_PLAYER_NAME);
        GetPlayerName(playerid,PlayerName2,sizeof(PlayerName2));
        format(file,sizeof(file),"NewServer/Admins/%s.txt",PlayerName);
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_YELLOW,"You need be RCON to use this command!");
        {
        	if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_YELLOW,"Usage: /setlevel id level");
        	{
        		if(level > 5 ) return SendClientMessage(playerid,COLOR_YELLOW,"Incorrect Level");
        		{
        			if(!IsPlayerConnected(playerid2))return SendClientMessage(playerid,COLOR_YELLOW,"Player is not connected!");
        			{
				        PlayerInfo[playerid][pAdminLevel] = level;
				        dini_IntSet(file,"Level",level);
				        format(str,sizeof(str),"* You have set %s's level to %d",PlayerName,level);
				        SendClientMessage(playerid,COLOR_BLUE,str);
				        format(str2,sizeof(str2),"* Admin '%s' has made you level %d",PlayerName2,level);
				        SendClientMessage(playerid2,COLOR_BLUE,str);
				        GameTextForPlayer(playerid2, "~r~Promoted", 5000, 3);

					}
				}
			}
		}
    }
Reply


Messages In This Thread
Help please with /setadmin - by MBX97 - 20.06.2011, 18:04
Re: Help please with /setadmin - by Jordman248 - 20.06.2011, 18:42
Re: Help please with /setadmin - by MBX97 - 21.06.2011, 07:43
Re: Help please with /setadmin - by MBX97 - 21.06.2011, 08:46
Re: Help please with /setadmin - by HyperZ - 21.06.2011, 08:54
Re: Help please with /setadmin - by Mean - 21.06.2011, 09:47

Forum Jump:


Users browsing this thread: 1 Guest(s)