/detain command
#1

Hey, uhmm i need help with the /detain command. There are no compilation errors, but when i try In Game it says
"You need an LSPD crusier to detain someone in."
And i do have a LSPD cruiser, but its just not detaining him..
Here is the command

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)) 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(!
IsCruiser(LastCar[playerid])) return SendClientMessage(playeridCOLOR_GREY"You need an LSPD cruiser to detain someone in.");
    if(
seatid || seatid 3) return SendClientMessage(playeridCOLOR_GREY"You can only detain people in seats 2 and 3.");
    
PutPlayerInVehicle(playerbLastCar[playerid], seatid);
    
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;

Reply
#2

Are you in The Cruiser when using it and what is the id of the cruiser !?
Reply
#3

I'm not in the cruiser, when im in the cruiser it says i need to be outside of the vehicle, and what do you mean with what is the ID?
Reply
#4

The Last Car You Entered Must be a Cruiser !?
Reply
#5

It is, sir.
Reply
#6

Remove This Line
if(!IsCruiser(LastCar[playerid])) return SendClientMessage(playerid, COLOR_GREY, "You need an LSPD cruiser to detain someone in.");
and check if it works normaly ? ok
Reply
#7

I did that already, but it doesnt detain then, i removed the line, did the /detain command and it said i detained him inside, but i didn't.
Reply
#8

Send me OnPlayerEnterVehicle ok
Reply
#9

What do you mean?
Reply
#10

All The CallBack OnPlayerEnterVehicle!!
Use Ctrl + F To Search it!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)