Repeating Checkpoint
#1

Hello Guys i have a problem with this command
pawn Код:
CMD:20(playerid, params[])
{
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
    {
        if (Pursuit[playerid] != 1)
        {
            new
            zone[MAX_ZONE_NAME],
            string[128 + MAX_PLAYER_NAME],
            Float:x,Float:y,Float:z;

            GetPlayer3DZone(playerid, zone, sizeof(zone));
            format(string, sizeof(string), "* %s requests pursuit backup over their radio.", GetPlayerNameEx(playerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            format(string, sizeof(string), "DISPATCH: Pursuit is in progress on behalf of %s, his 10-20 is %s, over.", GetPlayerNameEx(playerid), zone);
            Pursuit[playerid] = 1;
            for(new i = 0;i < MAX_PLAYERS; i++)
            {
    if(PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1 || PlayerInfo[i][pMember] == 7 || PlayerInfo[i][pLeader] == 7)
                {
                    GetPlayerPos(playerid, x, y, z);
                    SetAllCopCheckpoint(x, y-5, z, 5.0);
                    SendClientMessageEx(i, COLOR_DBLUE, string);
                }
            }
            SendClientMessageEx(playerid, COLOR_WHITE, "Type /c20 to remove your pursuit.");
            SetTimerEx("Update20",4000,1,"i",playerid);
        }
        else
        {
            SendClientMessageEx(playerid, COLOR_GREY, "  You already have an active backup request!");
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, "   You are not a Cop / FBI / Coastguard!");
    }
    return 1;
}

CMD:c20(playerid, params[])
{
 if (Pursuit[playerid] == 1)
   {
    Pursuit[playerid] = 0;
    {

        for(new i = 0;i < MAX_PLAYERS; i++)
        {
            if(PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1 || PlayerInfo[i][pMember] == 7 || PlayerInfo[i][pLeader] == 7 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
            {
                new string[128];
                format(string, sizeof(string), "DISPATCH: Pursuit has been terminated, situation is Code 4. No further");
                SendClientMessageEx(i, COLOR_DBLUE, string);
                DisablePlayerCheckpoint(i);
            }
         }
      }
   }
 return 1;
}
its suppose to repeat the checkpoint every time the player moves ,but it just gives sets a single checkpoint ,i want that as long as the player move it keeps setting checkpoint ,not only one
can anyone help me with it ?
Reply
#2

Post your "Update20" code please.
Reply
#3

Quote:
Originally Posted by AdamCooper
Посмотреть сообщение
Post your "Update20" code please.
SetTimerEx("Update20",4000,1,"i",playerid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)