Arrest command doesn't work
#5

Quote:
Originally Posted by lulo356
Посмотреть сообщение
You need to read the post before posting this....
Okay, well I read your post and I still can't figure out how it doesn't work. No need to blame us because you can't explain something properly. In what way does it not work? The command still operates even if you leave out parameters? That's because you didn't return a value, like Sew_Sumi mentioned... but I guess you don't have the attention span to read his entire post.

pawn Код:
command(arrest, playerid,params[])
{
    new ID, time;
    if(sscanf(params, "ud", ID, time))
    {
        if(Factions[Player[playerid][Faction]][CommandTypes] == 1 || Factions[Player[playerid][Faction]][CommandTypes] == 3)
            SendClientMessage(playerid, COLOR_GREY, "SYNTAX: /arrest [playerid/name] [minutes]");
        else
        {
            RemoveTextMessage(playerid);
            TextDrawShowForPlayer(playerid, Text:CantCommand);
            SetTimerEx("RemoveTextMessage", 3500, false, "d", playerid);
        }
        return 1;
    }
    if(!IsPlayerConnected(ID) || ID == INVALID_PLAYER_ID)
        return SendClientMessage(playerid, -1, "That player does not exist."); // Change the message to your own preference. Do not continue without checking for a valid player ID.

    new string[90];
    if(GetDistanceBetweenPlayers(playerid, ID) > 4.0)
    {
        format(string, sizeof(string), "%s(%d) is too far away. You cannot reach him to arrest him.", RPName(ID), ID);
        SendClientMessage(playerid, -1, string);
    }
    else
    {
        ResetPlayerWeapons(ID);
        Player[ID][Arrest] = 1;
        Player[ID][PrisonTime] = time * 60;
        SetPlayerSpecialAction(ID, SPECIAL_ACTION_NONE);
        format(string, sizeof(string), "> You've arrested %s for %d days at San Andreas Prison.", RPName(ID), time);
        SendClientMessage(playerid, SPECIALORANGE, string);
        format(string, sizeof(string), "> %s has arrested you for %d days at San Andreas Prison.", RPName(playerid), time);
        SendClientMessage(ID, SPECIALORANGE, string);
    }
    return 1;
}
Let's hope that puts this dumb thread to rest.
Reply


Messages In This Thread
Arrest command doesn't work - by lulo356 - 21.01.2016, 00:52
Re: Arrest command doesn't work - by Sew_Sumi - 21.01.2016, 00:57
Re: Arrest command doesn't work - by lulo356 - 21.01.2016, 01:18
Re: Arrest command doesn't work - by Sew_Sumi - 21.01.2016, 02:44
Re: Arrest command doesn't work - by Threshold - 21.01.2016, 02:50
Re: Arrest command doesn't work - by Weponz - 21.01.2016, 05:49
Re: Arrest command doesn't work - by lulo356 - 21.01.2016, 13:40
Re: Arrest command doesn't work - by Sew_Sumi - 21.01.2016, 22:40
Re: Arrest command doesn't work - by lulo356 - 21.01.2016, 23:58
Re: Arrest command doesn't work - by Sew_Sumi - 22.01.2016, 05:17

Forum Jump:


Users browsing this thread: 1 Guest(s)