Paycheck
#1

I wanna make so people get paycheck every time its
:00 (every hour in-game)

i currently get paycheck for every 3600 seconds ive been online

Код:
if( Player[i][SecondsLoggedIn] >= 3600 )
can i change that in that code?, ore do i have to make a new one?
Reply
#2

Just make in the script when it turns **:00 that it will send paycheck to everyone.
Reply
#3

Quote:
Originally Posted by Seven.
Посмотреть сообщение
Just make in the script when it turns **:00 that it will send paycheck to everyone.
Ive tryed but can't get the code right
Reply
#4

Show what you have so far :P
Reply
#5

I didnt realy understand what oyu mean mate.. Can you explain?
Reply
#6

I will make something for you. Hang on

EDIT:
pawn Код:
new ClockCount[2];
new string[56];

public OnGameModeInit()
{
    ClockCount[0] = 0;
    ClockCount[1] = 0;
    SetTimer("PayCheck",1000,true);
    return 1;
}

forward PayCheck();
public PayCheck()
{
    ClockCount[0] ++;
    if(ClockCount[0] == 60)
    {
    ClockCount[0] = 0;
    ClockCount[1] ++;
    if(ClockCount[1] == 24) { ClockCount[1] = 0; }

    format(string,sizeof(string),"Current Time: %02d:%02d",Count[0],Count[1]); // This into a textdraw string?
    SendClientMessageToAll(yourcolor,str);
   
    //==== Under here paycheck code?
    //code?
    //==== Code done :P
    return 1;
}
Made this quickly, Hope it helps you
Reply
#7

Make a timer or on that same timer where it increases the Player[i][SecondsLoggedIn] value, add a check like

pawn Код:
if( Player[i][SecondsLoggedIn] >= 3600 )
{
 #define MAX_PAYCHECK 9999
 new paymoney = random(MAX_PAYCHECK);
 new paystring[70];
 format(paystring,sizeof(paystring), "You have been paid %d!", paymoney);
 SendClientMessage(playerid,0x008080FF,paystring);
 GivePlayerMoney(i, paymoney);
}
There, scripted nice and good, should work.
Reply
#8

Thanks everybody it helped allot


- Keep up the good work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)