How To Fix This Command
#1

pawn Код:
dcmd_arrest(playerid,params[])
{
    if((gTeam[playerid] <= 5) && (gTeam[playerid] > 0))
    {
        if(CopDuty[playerid] == 1)
        {
            if(!strlen(params)) return SendClientMessage(playerid, RED, ":: Usage: /arrest [Player Id] ::");
            new player1, playername[MAX_PLAYER_NAME], copname[MAX_PLAYER_NAME], string[128];
            player1 = strval(params);
            if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
            {
                if(GetPlayerWantedLevel(player1) >= 1)
                {
                    if(!IsPlayerInAnyVehicle(player1))
                    {
                        if(GetDistanceBetweenPlayers(playerid, player1) < 10)
                        {
                            GetPlayerName(player1, playername, sizeof(playername));
                            GetPlayerName(playerid, copname, sizeof(copname));
                            new jtime;
                            new reward;
                            reward = GetPlayerWantedLevel(player1);
                            jtime = GetPlayerWantedLevel(player1);
                            Info[player1][JailTime] = jtime*1000*60;
                            Info[player1][Jailed] = 1;
                            SetTimerEx("Jail1",1000,0,"d",player1);
                            SetTimerEx("JailPlayer",5000,0,"d",player1);
                            GivePlayerMoney(playerid, reward*1000);
                            SetPlayerWantedLevel(player1, 0);
                            SetPlayerScore(playerid, GetPlayerScore(playerid) +reward*5);
                            JailTimer[player1] = SetTimerEx("UnjailPlayer",Info[player1][JailTime],0,"d",player1);
                            format(string,sizeof(string),":: %s has arrested %s for %i minutes ::", copname, playername, jtime);
                            SendClientMessageToAll(COP_COLOR,string);
                            Info[playerid][Arrests]++;
                            new string2[256];
                            format(string2,sizeof(string2), ":: Congratulations, %s, you received $%i and %i score for arresting a %i-star wanted criminal! ::", copname, reward*1000, reward*5, reward);
                            return SendClientMessage(playerid, RED, string2);
                        }
                        else return SendClientMessage(playerid, RED, ":: ERROR: You need to be close to the player to arrest him ::");
                    }
                    else return SendClientMessage(playerid, RED, ":: ERROR: Player is in a vehicle ::");
                }
                else return SendClientMessage(playerid, RED, ":: ERROR: This player doesn't have 2+ stars, you can't arrest him ::");
            }
            else return SendClientMessage(playerid, RED, ":: ERROR: Player not found ::");
        }
        else return SendClientMessage(playerid, RED, ":: ERROR: You have to be on cop duty ::");
    }
    else return SendClientMessage(playerid, RED, ":: ERROR: You have to be a Cop to use this command ::");
}
This Command Work But I Can't Jail Wanted , This Command For Jail Wanted With A Minutes . Please Help Me How To Make This Command Work Properly
Reply
#2

No One Helpp ?
Reply
#3

Please explain what you want exactly.
Reply
#4

You forget to use the function of SetPlayerPos(..); however you jail floats , also set a timer for unjail which will kill the first timer of the jail and you can use function of Spawn(playerid);
Reply
#5

its work , thanks man
Reply
#6

Ye you forgot the SetPlayerPos when he's is arrested so try SetPlayerPos(playerid, etc....)
Reply
#7

yeppp
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)