Unknown Command
#2

try
PHP код:
CMD:uncuff(playeridparams[])
{
        if(
GetPlayerTeam(playerid) != TEAM_SWAT)
        if(
GetPlayerTeam(playerid) != TEAM_CIA)
        if(
GetPlayerTeam(playerid) != TEAM_COP)
        return 
SendClientMessage(playerid, -1"{FF0000}Error: {FFFFFF}Only Law Enforcement may use this command!");
        new 
targetid;
        if(
sscanf(params"u"targetid)) return SendClientMessage(playerid, -1"Usage: /uncuff [id]");
        if(
IsPlayerConnected(targetid))
        {
            new 
Float:xFloat:yFloat:z;
            
GetPlayerPos(playeridxyz);
            if(
IsPlayerInRangeOfPoint(targetid5.0xyz))
                {
                    if(!
SetPlayerAttachedObject(targetid0194186, -0.0110000.028000, -0.022000, -15.600012, -33.699977,-81.7000350.8919991.0000001.168000))return SendClientMessage(playerid,-1,"ERROR: The player is not cuffed!");//this will check that if the player is not cuffed and you are trying to apply this cmd,this will send him a error message.
                    
SetPlayerSpecialAction(targetid,SPECIAL_ACTION_NONE);
                    new 
str[512];
                    new 
name[MAX_PLAYER_NAME];
                    
GetPlayerName(playeridnamesizeof(name));
                    new 
target[MAX_PLAYER_NAME];
                    
GetPlayerName(targetidtargetsizeof(target));
                    
format(strsizeof(str), "You removed %s's cuffs",target);
                    
SendClientMessage(playerid0xE01B1Bstr);
                    
format(strsizeof(str), "You have been uncuffed by %s",name);
                    
SendClientMessage(targetidCOLOR_LIGHTBLUEstr);
                }
        }
        return 
1;

Reply


Messages In This Thread
Unknown Command - by NathNathii - 13.04.2013, 18:09
Re: Unknown Command - by Igal-A - 13.04.2013, 18:29
Re: Unknown Command - by NathNathii - 13.04.2013, 18:31
Re: Unknown Command - by kalanerik99 - 13.04.2013, 18:31
Re: Unknown Command - by NathNathii - 13.04.2013, 18:37
Re: Unknown Command - by JJB562 - 13.04.2013, 21:08
Re: Unknown Command - by NathNathii - 13.04.2013, 21:16
Re: Unknown Command - by JJB562 - 13.04.2013, 21:20
Re: Unknown Command - by NathNathii - 13.04.2013, 21:22
Re: Unknown Command - by JJB562 - 13.04.2013, 21:33

Forum Jump:


Users browsing this thread: 1 Guest(s)