CP functions are executing too fast!
#1

Hello dear SA-MP community, im kinda stuck with a checkpoint, when i enter the checkpoint it
should execute some functions(bring up a menu in my case), so when ever i enter a checkpoint
it brings up the menu right away and i never get into the checkpoint only at his edge which kinda sucks.
Ive tried like:

pawn Код:
public AmmuCheckpoint(playerid)
{
    ShowMenuForPlayer(wepmenu, playerid);
    TogglePlayerControllable(playerid,0);
    ClearAnimations(playerid);
    SetPlayerFacingAngle(playerid, 178.8904);
    SetCameraBehindPlayer(playerid);
}
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    SetTimerEx("AmmuCheckpoint", 1500, 0, "i", playerid);
    AmmuCheckpoint(playerid);
    return 1;
}
But it didnt worked out, the efect was the same...
Anyone could please give me some tips if you can.
Thanks, regards.
Reply
#2

Why don't you try this?
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid,5,AmmuNation Coords))
        {
        ShowMenuForPlayer(wepmenu, playerid);
    TogglePlayerControllable(playerid,0);
    ClearAnimations(playerid);
    SetPlayerFacingAngle(playerid, 178.8904);
    SetCameraBehindPlayer(playerid);
        }
    return 1;
}
Reply
#3

Quote:
Originally Posted by SkizzoTrick
Посмотреть сообщение
Why don't you try this?
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid,5,AmmuNation Coords))
}
why ammunation coords? not the one of the checkpoint?
Reply
#4

Quote:
Originally Posted by OldDirtyBastard
Посмотреть сообщение
why ammunation coords? not the one of the checkpoint?
Yes,but i said AmmuNation,nvm,put there the checkpoint coords
Reply
#5

But listen,for this kind of scripts,you better use Pickups!

here is the script:

pawn Код:
new Ammupickup;

public OnGameModeInit()

Ammupickup = CreatePickup(1242, 23, 1503.3359, 1432.3585, 10.1191, -1);

public OnPlayerPickupPickup(playerid, pickupid)
{

    if ( pickupid == Ammupickup )
            {
            ShowMenuForPlayer(wepmenu, playerid);
                TogglePlayerControllable(playerid,0);
                ClearAnimations(playerid);
                SetPlayerFacingAngle(playerid, 178.8904);
                SetCameraBehindPlayer(playerid);
            }
return 1;
}
Reply
#6

Theres nothing changed, tried to adjust it a bit but still nothing, and i dont wanna go with a pickup...
I would need something like he needs to stay into the checkpoint for like 1sec so the menu will show up.
Reply
#7

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    SetTimerEx("AmmuCheckpoint", 1500, 0, "i", playerid);
    AmmuCheckpoint(playerid);
    return 1;
}
Remove this line:
pawn Код:
AmmuCheckpoint(playerid);
Reply
#8

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    SetTimerEx("AmmuCheckpoint", 1500, 0, "i", playerid);
    AmmuCheckpoint(playerid);
    return 1;
}
Remove this line:
pawn Код:
AmmuCheckpoint(playerid);
Your the best!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)