Help with PayDay
#1

Eh like to go ... I want to make my payday comes every 30 minutes, I tried with a timer but nejde, if you'd like me to have someone help you or show? Thanks in advance
Reply
#2

Please, anyone?
Reply
#3

same to me
Reply
#4

pawn Код:
// Top
forward PayDay( ); // Forwarding the function

// OnGameModeInit
SetTimer( "PayDay", 1800000, true ); // Setting the timer to call every 30 minutes (1.8 million milliseconds)

// Outside callbacks
public PayDay( )
{
    for( new i; i < MAX_PLAYERS; i++ ) // Can be substituted with foreach (Recommended)
    {
        if( IsPlayerConnected( i ) // Is the player connected?
        {
            GivePlayerMoney( i, 5000 ); // Give the player some money
        }
    }
}
Untested, please forgive me if I missed anything.
Reply
#5

Quote:
Originally Posted by JamesC
Посмотреть сообщение
pawn Код:
// Top
forward PayDay( ); // Forwarding the function

// OnGameModeInit
SetTimer( "PayDay", 1800000, true ); // Setting the timer to call every 30 minutes (1.8 million milliseconds)

// Outside callbacks
public PayDay( )
{
    for( new i; i < MAX_PLAYERS; i++ ) // Can be substituted with foreach (Recommended)
    {
        if( IsPlayerConnected( i ) // Is the player connected?
        {
            GivePlayerMoney( i, 5000 ); // Give the player some money
        }
    }
}
Untested, please forgive me if I missed anything.
omg omg i'm very very big bot tnx man
Reply
#6

I made that payday comes every 30 minutes, but now I was going testata come when those 30 minutes to write I have not played long enough, how to set up that has played 15 minutes of those 30 to payday?

http://slike.hr/slike/s/samp088_bd0c0.png
Reply
#7

pawn Код:
// Top of script

new
    CurrentSession[ MAX_PLAYERS ] // Create an array which keeps track of how many seconds the player has been on the server.
;

forward PayDay( ); // Forwarding the payday function.
forward ThreeSecondTimer( ); // Forwarding the session increment function.

// OnGameModeInit

SetTimer( "PayDay", 1800000, true ); // Setting the payday timer for 30 minutes.
SetTimer( "ThreeSecondTimer", 3000, true ); // Setting the session timer for 3 seconds.

// OnPlayerConnect

CurrentSession[ playerid ] = 0; // When a new player connects, their session time should be 0.

// Outside callbacks

public ThreeSecondTimer( )
{
    for( new i; i < MAX_PLAYERS; i++ ) // Can be substituted with foreach (Recommended)
    {
        if( IsPlayerConnected( i ) ) // If the player is connected
        {
            CurrentSession[ i ] += 3; // Add 3 to their seconds connected.
        }
    }
    return 1;
}

public PayDay( )
{
    for( new i; i < MAX_PLAYERS; i++ ) // Can be substituted with foreach (Recommended)
    {
        if( IsPlayerConnected( i ) ) // If the player is connected
        {
            if( CurrentSession[ i ] >= 900 ) // If the player has been connected for at least 15 minutes.
            {
                GivePlayerMoney( i, 5000 ); // Give the player money
            }
            else
            {
                SendClientMessage( i, 0xFFFFFFFF, "Server: You haven't played long enough!" ); // The player has not been connected for at least 15 minutes.
            }
           
            CurrentSession[ i ] = 0; // Reset the session.
        }
    }
    return 1;
}
Untested, I'm sure there are more efficient ways of doing this but I feel this is the easiest way to explain how it works.
Reply
#8

but I use the GF mode (I know sucks) but nezz who set the timer to be 15 min you to be online to get payday mos only other way instead of "sendClientMessage to put the payday, but then you still have it: S. .. even someone knows Let help
Reply
#9

this may/may not work
pawn Код:
SetTimerEx("payday", time, true, "d", playerid);//time has to be defined
, but it should its what i use
pawn Код:
public payday(playerid)
     {
      GameTextForPlayer(playerid, "PAYDAY!!!", 10000, 3);
      SendClientMessage(playerid, YOUR_COLOR_HERE, "YOUR MESSAGE");
      GivePlayerMoney(playerid, 5000);// or whatever you want
      return 1;
     }
Reply
#10

Quote:
Originally Posted by fangoth1
Посмотреть сообщение
this may/may not work
pawn Код:
SetTimerEx("payday", time, true, "d", playerid);//time has to be defined
, but it should its what i use
pawn Код:
public payday(playerid)
     {
      GameTextForPlayer(playerid, "PAYDAY!!!", 10000, 3);
      SendClientMessage(playerid, YOUR_COLOR_HERE, "YOUR MESSAGE");
      GivePlayerMoney(playerid, 5000);// or whatever you want
      return 1;
     }
that it is, but I use GF mode and now I dont know what to remove and what to leave behind: S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)