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



Money ship - iTz1T4Y - 12.10.2017

Hi, I want to make a ship that every second gives 5 cash to any player in there.
I know how to give any player the money but I dont know how to make it happen every 1 second.
Can anybody help me here?


Re: Money ship - Lokii - 12.10.2017

PHP код:

SetTimer
("SHIPMONEY"1000true);

forward SHIPMONEY();

public 
SHIPMONEY()
{
     for(new 
0GetPlayerPoolSize(); <= jx++)
     {
          if(!
IsPlayerConnected(x) || IsPlayerNPC(x)) continue;
          if(
PlayerInShip(x)) //or what ever your function is to check
          
{
               
GivePlayerMoney(x5);
          }
     }
     return 
1;