Money on pirate ship SOLVED
#5

Quote:
Originally Posted by [NWA
Hannes ]
Quote:
Originally Posted by Babul
iam sure you know where to put these parts in...
Код:
	SetTimer("TimerPirateShip",3000,true);
Код:
forward TimerPirateShip();
public TimerPirateShip()
{
	new ID;
	for(ID=0;ID<MAX_PLAYERS;ID++)
	{
		if(IsPlayerInRangeOfPoint(ID, 20.0, 2000.6755,1543.2694,13.5859))
		{
			GivePlayerMoney(playerid,50);
		}
	}
}
Wrong, that would give: Error undefined symbol "playerid"
Use my code, it will work

@Babul
Btw i suggest using this loop instead of yours as it is faster.

pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
Just change your "ID" to "i"
Your code wouldn't work either, https://sampwiki.blast.hk/wiki/SetTimerEx.

Babul was closer than you where. Your code would make countless timers that would add up and add up because you don't kill them in anyway. Also, you set the timer for ship earn that continues. So, if you are not in the area you will still get $$. Babuls was a simple mistake, yours wasn't. Here is the proper code.

pawn Код:
SetTimer("TimerPirateShip",3000,true);

forward TimerPirateShip();
public TimerPirateShip()
{
    new ID;
    for(ID=0;ID<MAX_PLAYERS;ID++)
    {
        if(IsPlayerInRangeOfPoint(ID, 20.0, 2000.6755,1543.2694,13.5859))
        {
            GivePlayerMoney(ID,50);
        }
    }
}
P.S. How is "i" faster than "ID", it would take around half a second longer, it doesn't need to be changed.
Reply


Messages In This Thread
Money on pirate ship SOLVED - by bartje01 - 26.02.2010, 06:29
Re: Money on pirate ship - by bajskorv123 - 26.02.2010, 06:53
Re: Money on pirate ship - by Babul - 26.02.2010, 06:53
Re: Money on pirate ship - by bajskorv123 - 26.02.2010, 06:57
Re: Money on pirate ship - by [HiC]TheKiller - 26.02.2010, 07:04
Re: Money on pirate ship - by Babul - 26.02.2010, 07:11
Re: Money on pirate ship - by bartje01 - 26.02.2010, 16:23
Re: Money on pirate ship - by bajskorv123 - 26.02.2010, 16:31
Re: Money on pirate ship - by bartje01 - 26.02.2010, 17:10
Re: Money on pirate ship - by VonLeeuwen - 26.02.2010, 17:11

Forum Jump:


Users browsing this thread: 3 Guest(s)