SA-MP Forums Archive
Paycheck - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Paycheck (/showthread.php?tid=178924)



Paycheck - FrankC - 24.09.2010

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?


Re: Paycheck - Seven. - 24.09.2010

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


Re: Paycheck - FrankC - 24.09.2010

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


Re: Paycheck - Seven. - 24.09.2010

Show what you have so far :P


Re: Paycheck - TouR - 24.09.2010

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


Re: Paycheck - Seven. - 24.09.2010

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


Re: Paycheck - Memoryz - 24.09.2010

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.


Re: Paycheck - FrankC - 24.09.2010

Thanks everybody it helped allot


- Keep up the good work