SA-MP Forums Archive
HELP: Money. - 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: Money. (/showthread.php?tid=112762)



HELP: Money. - Austin_Lynn - 10.12.2009

Hey,
How would I give money to everyone in a certain area, when a timer is up.


Re: HELP: Money. - Austin_Lynn - 10.12.2009

Does anyone know?


Re: HELP: Money. - LarzI - 10.12.2009

on top:
pawn Код:
new
  g_iMoneyTimer;

forward MoneyTimer();
ongamemodeinit:
pawn Код:
g_iMoneyTimer = SetTimer( "MoneyTimer", 10, true );
ongamemodeext:
pawn Код:
KillTimer( g_iMoneyTimer );
on bottom:
pawn Код:
public MoneyTimer()
{
  for( new i = 0; i < MAX_PLAYERS; i ++ )
  {
    if( PlayerToPoint( 10.0, i, 0.0, 0.0, 0.0 ) ) //You can also use IsPlayerInArea
      GivePlayerMoney( i, 200 ); //Switch 200 with the amount of money you wanna give
  }
  return true;
}