16.07.2012, 00:44
Hi i was wondering if it is possible , to give like 50$ every 15minutes to players , cause i cant find a jobs filterscript for las venturas
thnx allready
thnx allready
#include <a_samp>
#define CASH 50 // the amount of the cash which you will give to all players
forward GiveAllCash();
public GiveAllCash()
{
for(new i = 0; i < MAX_PLAYERS; i ++) // loops through all players
{
if(!IsPlayerConnected(i)) // if they are not connected
continue; // skip
// here they are connected so give them the cash
GivePlayerMoney(i, CASH); // here comes CASH that we defined above
}
return 1;
}
public OnGameModeInit() // or you can use OnFilterScriptInit() if it's a filterscript
{
SetTimer("GiveAllCash", 300000, true);
/*
1st parameter "GiveAllCash": The forwared public that the timer will call every 5 minutes which does all the work
2nd parameter 300000: The interval time. 300000 ms = 5 300 sec = 5 min
3rd parameter true: Means the timer will call this public repeatdly
*/
return 1;
}
So you want to give all players an amount of cash every 15 minutes? Well it's easy using timers
pawn Код:
|