Payday every hour - 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: Payday every hour (
/showthread.php?tid=563221)
Payday every hour -
Cyber123 - 14.02.2015
I want to create payday system to player get pay at 00:00, 01:00 , 02:00,12:00 and the like .. ??
Re: Payday every hour -
arlindi - 14.02.2015
http://lmgtfy.com/?q=samp+payday+system
Hard ?
Re: Payday every hour -
Cyber123 - 14.02.2015
Used that but cant understand !!
Re: Payday every hour -
arlindi - 14.02.2015
i tested and it works perffectly
Nvm
You must create player in game hour system
Re: Payday every hour -
Kaperstone - 14.02.2015
Learn scripting if you can't understand.
Re: Payday every hour -
CalvinC - 14.02.2015
You can use a repeating timer under OnGameModeInit of 1 hour.
Or you can use gettime or GetPlayerTime to detect if the time is 00:00, 01:00, 02:00, 03:00 and so on.
Re: Payday every hour -
Cyber123 - 27.02.2015
What is better GetPlayerTime or Timers??
Re: Payday every hour -
n0minal - 27.02.2015
Payday every hour should be called Payhour hihi xD
https://sampwiki.blast.hk/wiki/SetTimerEx
Re: Payday every hour -
M0HAMMAD - 27.02.2015
pawn Код:
#include <time>
new H,M,S;
gettime(H,M,S);
if(M == 0 && S == 0)
{
//Your Code
}
Re: Payday every hour -
awoo - 27.02.2015
To create a payhour, you just need to use
SetTimerEx function, like n0minal mentioned.
It'll be like this:
Код:
public OnPlayerConnect(playerid)
{
SetTimerEx("Payhour", 3600000, true, "i", playerid); // Every hour (3600000 ms), the callback "Payhour" will be called.
return 1;
}
forward Payhour(playerid);
public Payhour(playerid)
{
GivePlayerMoney(playerid, 1000);
SendClientMessage(playerid, -1, "Here's your payment ($1000)");
return 1;
}
The timer start counting when the player connect, if you want to make it global (every hour, since the gamemode was started), just create a timer on
OnGameModeInit.