help pls
#6

Quote:
Originally Posted by DeStRoY232
Посмотреть сообщение
here is the command code and it got IsPlayerAdmin already

code :

PHP код:
CMD:slap(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_RED"You're not allowed to use this command");
    new 
pname[MAX_PLAYER_NAME], oname[MAX_PLAYER_NAME], otheridstring[128], Float:PPos[3];
    if(
sscanf(params"u"otherid)) return SendClientMessage(playeridCOLOR_WHITE"{FF6600}Usage: {FFFFFF}/slap [playerid/name]");
    else if(!
IsPlayerConnected(otherid)) return SendClientMessage(playeridCOLOR_RED"Player isn't connected");
    else
    {
        
GetPlayerName(playeridpnamesizeof(pname));
        
GetPlayerName(otheridonamesizeof(oname));
        
GetPlayerPos(otheridPPos[0], PPos[1], PPos[2]);
        
SetPlayerPos(otheridPPos[0], PPos[1], PPos[2]+4);
        
format(stringsizeof(string), "*{33ccff}[Administrator] - %s {FFFFFF}slapped {%06x}%s"pnameGetPlayerColor(playerid) >>> 8oname);
        
SendClientMessageToAll(COLOR_WHITEstring);
        
format(stringsizeof(string), "You've slapped {%06x}%s{FFFFFF}(%d)"GetPlayerColor(playerid) >>> 8onameplayerid);
        
SendClientMessage(playeridCOLOR_WHITEstring);
    }
    return 
1;

Yes thats it.


Here the disable timer for admin
Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success) 
{ 
    if(!success) 
    { 
        new string[128]; 
        format(string, sizeof(string), "{FF6600}[DBot]: {FFFFFF}Command {FF0000}%s{FFFFFF} not found, Type {FF6600}/cmds {FFFFFF}to see server commands", cmdtext); 
        SendClientMessage(playerid, COLOR_WHITE, string); 
    } 
    else if(success && !IsPlayerAdmin(playerid)) 
    { 
        lastcommand[playerid]=gettime(); 
    } 
    return 1; 
}
Reply


Messages In This Thread
help pls - by DeStRoY232 - 20.10.2017, 11:12
Re: help pls - by DonaldDuck - 20.10.2017, 11:14
Re: help pls - by DeStRoY232 - 20.10.2017, 11:15
Re: help pls - by DonaldDuck - 20.10.2017, 11:18
Re: help pls - by DeStRoY232 - 20.10.2017, 11:19
Re: help pls - by DonaldDuck - 20.10.2017, 11:20
Re: help pls - by DeStRoY232 - 20.10.2017, 11:21
Re: help pls - by FrezQ - 20.10.2017, 11:29
Re: help pls - by FrezQ - 20.10.2017, 11:32
Re: help pls - by DeStRoY232 - 20.10.2017, 12:03

Forum Jump:


Users browsing this thread: 2 Guest(s)