SA-MP Forums Archive
How? - 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)
+--- Thread: How? (/showthread.php?tid=371438)



How? - Vizi - 23.08.2012

How can i make like a business but when somebodye buy it to give him money for 5minutes 5000$ ?


Re: How? - Shetch - 23.08.2012

That sentence makes no sense at all...
http://forum.sa-mp.com/search.php


Re: How? - Vizi - 23.08.2012

i know how to make a business system but i dont know how to make to come money every 5 minutes :S


Re: How? - Roko_foko - 23.08.2012

Use timer. SetTimerEx


Re: How? - Shetch - 23.08.2012

Once the player buys a business, set a timer just like Roko_foko said.
When the timer runs out, give the player $5000.


Re: How? - scottyishere - 23.08.2012

OnGameModeInit add
pawn Код:
SetTimer("biztimer",60*5*1000,true);
Somewhere in code: (outside any function)
pawn Код:
forward biztimer();
public biztimer()
{
     for(new i=0;i<MAXBUSINESSONSERVER;i++)
     {
          if(businessEXISTS && businessISOWNED) //replace with biz system variables
          {
                businessMONEY+=5000;
          }
     }
     return 0;
}