SendClientMessage
#1

This code sends the "You have set PLAYER admin level to VALUE" to the person that set it, but it doesn't send the second message to the person who's admin level is being set.

PHP код:
CMD:setadmin(playeridparams[])
{
    new 
pIDvalue;
    if(!
IsPlayerAdmin(playerid)) return 0;
    else if(
sscanf(params"ui"pIDvalue)) return SendClientMessage(playerid, -1"{FFFF00}[SERVER] {FF0000}USAGE: {FFFFFF}/setadmin id level");
    else if(
value || value 5) return SendClientMessage(playerid, -1"{FFFF00}[SERVER] {FF0000}ERROR: {FFFFFF}Pick a level between 1 and 5");
    else if(
pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1"{FFFF00}[SERVER] {FF0000}ERROR: {FFFFFF}That player is not connected");
    else
    {
        new 
string[128], string1[128], target[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME];
          
GetPlayerName(playeridpNamesizeof(pName));
        
GetPlayerName(pIDtargetsizeof(target));
        
format(stringsizeof(string), "{FFFF00}[SERVER] {FFFFFF}You have set {FFFF00}%s{FFFFFF} admin level to {FFFF00}%i"targetvalue);
        
SendClientMessage(playerid, -1string);
        
format(stringsizeof(string), "{FFFF00}[SERVER] {FFFFFF}Your admin level has been set to {FFFF00}%i {FFFFFF}by {FFFF00}%s"valuepName);
        
SendClientMessage(pID, -1string1);
        
PlayerInfo[playerid][pAdmin] = value;
    }
    return 
1;

Reply


Messages In This Thread
SendClientMessage - by Melktert - 12.04.2017, 12:54
Re: SendClientMessage - by Spoookymon - 12.04.2017, 13:04
Re: SendClientMessage - by 1nspire - 12.04.2017, 13:08

Forum Jump:


Users browsing this thread: 1 Guest(s)