What's wrong with this part of my script?
#1

When I drive to the checkpoint, it freezes me and says "Unloading..." But it never unfreezes me, what's wrong with it? Thanks for your help.

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    TogglePlayerControllable(playerid, 0);
    SetTimer("Unloading...", 5000, false);
    GameTextForPlayer(playerid, "~g~Unloading...", 5000, 5);
    GivePlayerMoney(playerid, 7500); //You can edit this
    SendClientMessage(playerid, blue, "Congratulations, you have earned 7500"); //You can edit this
    DisablePlayerCheckpoint(playerid);
    return 1;
}

forward Unloading(playerid);
public Unloading(playerid)
{
    TogglePlayerControllable(playerid, 1);
    return 1;
}
Reply
#2

Instead of settimer use:
pawn Код:
SetTimerEx("Unloading", 5000, 0, "i", playerid);
Reply
#3

You have "SetTimer("Unloading...", 5000, false);"

and your function is

forward Unloading(playerid);
public Unloading(playerid)
{
TogglePlayerControllable(playerid, 1);
return 1;
}


.. Please tell me you understand what you did wrong.
Reply
#4

Quote:
Originally Posted by Dr
Посмотреть сообщение
Instead of settimer use:
pawn Код:
SetTimerEx("Unloading", 5000, 0, "i", playerid);
The SetTimerEx Stores a variable when you create it in this case the variable is the player id

Well if you want a better explaination https://sampwiki.blast.hk/wiki/SetTimerEx

+ Rep if this helped
Reply
#5

Quote:
Originally Posted by AceFlyer
Посмотреть сообщение
The SetTimerEx Stores a variable when you create it in this case the variable is the player id

Well if you want a better explaination https://sampwiki.blast.hk/wiki/SetTimerEx

+ Rep if this helped
Variables? You mean params as said on wiki.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)