Detain Problems
#1

Hello, I can't detain someone.
Here's my scripts
pawn Code:
CMD:detain(playerid, params[])
{
    new playerb, seatid, string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsACop(playerid) && !IsFBI(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an NYPD Oficer/FBI Agent.");
    if(sscanf(params, "ui", playerb, seatid)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /detain [playerid] [seatid]");
    if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
    if(!IsPlayerNearPlayer(playerid, playerb, 2)) return SendClientMessage(playerid, COLOR_GREY, "You can't detain someone from this disatance.");
    if(!IsPlayerCuffed(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Player is not cuffed.");
    if(seatid < 2 || seatid > 3) return SendClientMessage(playerid, COLOR_GREY, "You can only detain people in seats 2 and 3.");
    PutPlayerInVehicle(playerb, LastCar[playerid], seatid);
    format(string, sizeof(string), "* %s grabs %s from their cuffs and throws him inside the NYPD cruiser.", RPN(playerid), RPN(playerb));
    SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
    return 1;
}
Reply


Messages In This Thread
Detain Problems - by Latisha - 20.05.2013, 14:55
Re: Detain Problems - by Latisha - 21.05.2013, 10:40
Re: Detain Problems - by MassDivide - 21.05.2013, 10:44
Re: Detain Problems - by Latisha - 21.05.2013, 10:46
Re: Detain Problems - by Stanford - 21.05.2013, 17:47

Forum Jump:


Users browsing this thread: 1 Guest(s)