Robbing when leaving Pickup
#5

Then you can't use this code
pawn Код:
public OnPlayerLeaveCheckpoint(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 3.0, -8.3713,-31.1897,3.9439)) 
{
        if(RobbingMagasin247[playerid] >= 1)
        {
            SendClientMessage(playerid,COLOR_ERROR,"La tentative de vol a йchouйe. Vous кtes sorti du Checkpoint.");
            RobbingMagasin247[playerid] =0;
            return 1;
        }
        return 1;
    }
You need to check if the player is still on the pickup.
What you can do, is the following
pawn Код:
public OnPlayerPickupPickup(playerid,pickupid)
{
if(pickupid == storepickup)//replace with the pickup id
{
IsonPickup[playerid] = 1;
}
}

//then in your rob timer add

if(IsonPickup[playerid] != 1) return
{
SendClientMessage(playerid,COLOR_ERROR,"La tentative de vol a йchouйe.
Vous кtes sorti du Checkpoint."
);
RobbingMagasin247[playerid] =0;
}
Then, under OnPlayerUpdate (not recommended, I suggest you set a timer to do this each 2 seconds or something), place this: IsonPickup[playerid] = 0;

The variable will be set to 1 as long as the player is on the pickup, as soon as he leaves it, the timer will set the variable to 0, which should end your robtimer.
Note, that this is only an idea, I have no idea how your robtimer and things are made, so try to get the idea I sketched above, so you can make it to your needs.
Reply


Messages In This Thread
Robbing when leaving Pickup - by Albania - 17.03.2013, 19:42
Re: Robbing when leaving Pickup - by Jstylezzz - 17.03.2013, 20:25
Re: Robbing when leaving Pickup - by Albania - 17.03.2013, 20:29
Re: Robbing when leaving Pickup - by Albania - 17.03.2013, 20:31
Re: Robbing when leaving Pickup - by Jstylezzz - 17.03.2013, 20:39
Re : Re: Robbing when leaving Pickup - by Albania - 17.03.2013, 22:02
Re: Robbing when leaving Pickup - by Jstylezzz - 18.03.2013, 11:41

Forum Jump:


Users browsing this thread: 1 Guest(s)