SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 16/07/2012, 12:44 AM   #1
prefex
Big Clucker
 
Join Date: Jul 2012
Posts: 55
Reputation: -1
Default get cash every 15 minutes

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
prefex is offline   Reply With Quote
Old 16/07/2012, 12:50 AM   #2
JakeMiller
Big Clucker
 
JakeMiller's Avatar
 
Join Date: Feb 2012
Posts: 77
Reputation: 11
Default Re: get cash every 15 minutes

lol you can't just find jobs on your erver, you must make them
JakeMiller is offline   Reply With Quote
Old 16/07/2012, 01:23 AM   #3
prefex
Big Clucker
 
Join Date: Jul 2012
Posts: 55
Reputation: -1
Default Re: get cash every 15 minutes

Quote:
Originally Posted by JakeMiller View Post
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
prefex is offline   Reply With Quote
Old 16/07/2012, 01:31 AM   #4
JakeMiller
Big Clucker
 
JakeMiller's Avatar
 
Join Date: Feb 2012
Posts: 77
Reputation: 11
Default Re: get cash every 15 minutes

lv? ur map
JakeMiller is offline   Reply With Quote
Old 16/07/2012, 01:37 AM   #5
prefex
Big Clucker
 
Join Date: Jul 2012
Posts: 55
Reputation: -1
Default Re: get cash every 15 minutes

Quote:
Originally Posted by JakeMiller View Post
lv? ur map
Yeh
prefex is offline   Reply With Quote
Old 16/07/2012, 01:45 AM   #6
[KHK]Khalid
Gangsta
 
Join Date: Jan 2012
Location: The Arab Republic of Egypt
Posts: 762
Reputation: 114
Default Re: get cash every 15 minutes

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

pawn Code:
#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;
}
[KHK]Khalid is offline   Reply With Quote
Old 16/07/2012, 01:47 AM   #7
prefex
Big Clucker
 
Join Date: Jul 2012
Posts: 55
Reputation: -1
Default Re: get cash every 15 minutes

Quote:
Originally Posted by HellSphinX View Post
So you want to give all players an amount of cash every 15 minutes? Well it's easy using timers

pawn Code:
#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??
prefex is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cash Bug Jhero Scripting Help 0 16/06/2012 01:58 PM
Set Cash help aqu Help Archive 11 13/03/2011 09:04 PM
Need 10-minutes help! *IsBack Everything and Nothing 4 29/12/2010 04:31 PM
How to make an automatic gate that closes after 4 minutes and 2 minutes after re justinkomnuga Help Archive 4 06/04/2010 11:47 AM
Cash every 5 minutes Thomash Help Archive 1 06/02/2010 05:57 PM


All times are GMT. The time now is 05:50 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.