SA-MP Forums Archive
get cash every 15 minutes - 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: get cash every 15 minutes (/showthread.php?tid=359977)



get cash every 15 minutes - prefex - 16.07.2012

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


Re: get cash every 15 minutes - JakeMiller - 16.07.2012

lol you can't just find jobs on your erver, you must make them


Re: get cash every 15 minutes - prefex - 16.07.2012

Quote:
Originally Posted by JakeMiller
Посмотреть сообщение
lol you can't just find jobs on your erver, you must make them
Nooo u serious :O
Lol like i didnt know that ... I mean i dont find a filterscript on the forums for it cause i cant make that myself


Re: get cash every 15 minutes - JakeMiller - 16.07.2012

lv? ur map


Re: get cash every 15 minutes - prefex - 16.07.2012

Quote:
Originally Posted by JakeMiller
Посмотреть сообщение
lv? ur map
Yeh


Re: get cash every 15 minutes - [KHK]Khalid - 16.07.2012

So you want to give all players an amount of cash every 15 minutes? Well it's easy using timers

pawn Код:
#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;
}



Re: get cash every 15 minutes - prefex - 16.07.2012

Quote:
Originally Posted by HellSphinX
Посмотреть сообщение
So you want to give all players an amount of cash every 15 minutes? Well it's easy using timers

pawn Код:
#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;
}
Thnx mate i'll try this tommorow i'm on ipad now , not my pc ^^
Thats every 5minutes right??