/detain command
#1

Hello, I created a /detain command quickly the other day but, it seems to not be working. Here are the required functions.

PHP код:
CMD:detain(playeridparams[])
{
    new 
playerbseatidstring[128];
    if(!
IsPlayerLoggedIn(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(!
IsACop(playerid) && !IsFBI(playerid) &&!IsSASD(playerid)) return SendClientMessage(playeridCOLOR_GREY"You are not an LSPD Oficer/FBI Agent.");
    if(
sscanf(params"ui"playerbseatid)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /detain [playerid] [seatid]");
    if(!
IsPlayerLoggedIn(playerb)) return SendClientMessage(playeridCOLOR_GREY"Invalid player id.");
    if(!
IsPlayerNearPlayer(playeridplayerb2)) return SendClientMessage(playeridCOLOR_GREY"You can't detain someone from this disatance.");
    if(!
IsPlayerCuffed(playerb)) return SendClientMessage(playeridCOLOR_GREY"Player is not cuffed.");
    if(
seatid || seatid 3) return SendClientMessage(playeridCOLOR_GREY"You can only detain people in seats 2 and 3.");
    new 
vehicle;
     
vehicle GetPlayerVehicleID(playerid);
    if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
    {
          
PutPlayerInVehicle(playerbLastCar[playerid], seatid);
    }
    else
    {
        
PutPlayerInVehicle(playerbvehicleseatid);
    }
    
format(stringsizeof(string), "* %s grabs %s from their cuffs and throws him inside the LSPD cruiser."RPN(playerid), RPN(playerb));
    
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
    return 
1;

OnPlayerExitVehicle

PHP код:
if(PlayerInfo[playerid][pFac] == && PlayerInfo[playerid][pFac] == && PlayerInfo[playerid][pFac] == 6)
    {
        
LastCar[playerid] = vehicleid;
    }

Reply


Messages In This Thread
/detain command - by Joshman543 - 18.03.2013, 20:20
Re: /detain command - by Misiur - 18.03.2013, 20:38
Re: /detain command - by Joshman543 - 18.03.2013, 23:06
Re: /detain command - by iGetty - 18.03.2013, 23:10

Forum Jump:


Users browsing this thread: 1 Guest(s)