money after 3 seconds - 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: money after 3 seconds (
/showthread.php?tid=147920)
money after 3 seconds -
bartje01 - 15.05.2010
Hey guys. I want a timer that gives you 10$ every 3 seconds.
How to do this?
please give an example or fix this:
Код:
public OnPlayerUpdate(playerid)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
if (X <= 2052.409 && X >= 1392.025 && Y <= 2220.318 && Z >= 1539.011)
{
}
else
{
SetTimer("message",3000,false);
GivePlayerMoney(playerid,10);
}
return 1;
}
Thankyou ^^
Re: money after 3 seconds -
PotH3Ad - 15.05.2010
Here is an example... (What are the coords for?

)
pawn Код:
//Top of script
forward TimedCash(playerid);
public OnPlayerConnect(playerid)
{
SetTimerEx("TimedCash", 3000, true, "i", playerid); //Repeats every 3 seconds
return 1;
}
public TimedCash(playerid) //Called every 3 seconds
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X,Y,Z);
if(X <= 2052.409 && X >= 1392.025 && Y <= 2220.318 && Z >= 1539.011)
{
return 1;
}
else
{
GivePlayerMoney(playerid, 10);
}
return 1;
}
Re: money after 3 seconds -
Retardedwolf - 15.05.2010
Код:
public OnPlayerUpdate(playerid)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
if (X <= 2052.409 && X >= 1392.025 && Y <= 2220.318 && Z >= 1539.011)
{
}
else
{
SetTimer("message",3000,false);
GivePlayerMoney(playerid,10);
}
return 1;
}
[/quote]
Holyshit.
That script will get you throttled/capped in one day if you home host and 24/7
Re: money after 3 seconds -
bartje01 - 15.05.2010
Quote:
Originally Posted by [___
PotH3Ad ]
Here is an example... (What are the coords for?  )
pawn Код:
//Top of script forward TimedCash(playerid);
public OnPlayerConnect(playerid) { SetTimerEx("TimedCash", 3000, true, "i", playerid); //Repeats every 3 seconds return 1; }
public TimedCash(playerid) //Called every 3 seconds { new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X,Y,Z); if(X <= 2052.409 && X >= 1392.025 && Y <= 2220.318 && Z >= 1539.011) { return 1; } else { GivePlayerMoney(playerid, 10); } return 1; }
|
Thanks it works. But now I want that the timer stops when you are out of this cords
(X <= 2052.409 && X >= 1392.025 && Y <= 2220.318 && Z >= 1539.011)
and that it starts when you are in.
Re: money after 3 seconds -
bartje01 - 15.05.2010
bump?? :$
Re: money after 3 seconds -
Paladin - 15.05.2010
Just a word of advice, use a checkpoint system, as a 10 second timer constantly running is not a good idea!