SA-MP Forums Archive
Help[what's wrong?:|] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help[what's wrong?:|] (/showthread.php?tid=192778)



Help[what's wrong?:|] - SkizzoTrick - 23.11.2010

There is a /fish command and between it's scripts i putted this thing to prevent spamming the fishes


pawn Код:
PlayerInfo[playerid][pJustFished] = 1;
                        SetTimer("FishingTime",6000,false);


forward FishingTime(playerid)
public FishingTime(playerid)
{
    PlayerInfo[playerid][pJustFished] = 0;
    return 1;
}
It worked yesterday,but now it is not changing the PlayerInfo[playerid][pJustFished] to 0 .
There is a problem with the timer but i don't know wich is it


Re: Help[what's wrong?:|] - Zh3r0 - 23.11.2010

When using the playerid parameter, you must do SetTimerEx. What you just did, is setting the repeat to false, which will stop!SetTimerEx is used when using it on a specified player, but SetTimer is used when you use it global, not for a specified player.

Do this instead.
pawn Код:
SetTimerEx( "FishingTime", 6000, true, "i", playerid );
There you go.


Re: Help[what's wrong?:|] - SkizzoTrick - 23.11.2010

Thanks alot man,it worked,i never knew the difference between simple and Ex,thanks alot!


Re: Help[what's wrong?:|] - Jeffry - 23.11.2010

He doesn't want a repeating timer:
pawn Код:
SetTimerEx("FishingTime", 6000, false, "i", playerid);



Re: Help[what's wrong?:|] - Zh3r0 - 23.11.2010

Quote:
Originally Posted by Jeffry
Посмотреть сообщение
He doesn't want a repeating timer:
pawn Код:
SetTimerEx("FishingTime", 6000, false, "i", playerid);
True, but he just learned that too, didn't he ?

Thanks Jeffry for correcting me, I've been here for like 4 hours, browsing this section and helping people out..

My post count jumped from 2.780 or so to 2.825 >.<
I apology if i did spam...


Re: Help[what's wrong?:|] - Jeffry - 23.11.2010

Quote:
Originally Posted by Zh3r0
Посмотреть сообщение
True, but he just learned that too, didn't he ?

Thanks Jeffry for correcting me, I've been here for like 4 hours, browsing this section and helping people out..

My post count jumped from 2.780 or so to 2.825 >.<
I apology if i did spam...
Wow, 4 hours, quite alot. But thats why we can help each other.
And the good point: He knowns now 'true' and 'false'.