money after 3 seconds
#1

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 ^^
Reply
#2

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;
}
Reply
#3

Код:
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
Reply
#4

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.
Reply
#5

bump?? :$
Reply
#6

Just a word of advice, use a checkpoint system, as a 10 second timer constantly running is not a good idea!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)