30.12.2016, 16:40
hello guys i have this cmd which set player as a rcon but the only thing am missing is the function that sets the player with the id as a rcon
thanks inadvance!
pawn Код:
CMD:setrcon(playerid,params[])
{
if(PlayerInfo[playerid][LoggedIn] == 1)
{
if(IsPlayerAdmin(playerid))
{
new tmp[128], tmp2[128], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /setrcon [playerid]");
new player1, level, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
player1 = strval(tmp);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
{
if(PlayerInfo[player1][LoggedIn] == 1)
{
return PlayerPlaySound(player1,1057,0.0,0.0,0.0);
}
else return SendClientMessage(playerid,red,"ERROR: Player must be registered and logged in to be admin");
}
else return SendClientMessage(playerid, red, "Player is not connected");
}
else return ShowPlayerDialog(playerid, 90321, DIALOG_STYLE_MSGBOX, "{FF0000}SFTDM - ERROR MSG", RconMSG,"OK","");
}
else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}