Payday every hour
#1

I want to create payday system to player get pay at 00:00, 01:00 , 02:00,12:00 and the like .. ??
Reply
#2

http://lmgtfy.com/?q=samp+payday+system

Hard ?
Reply
#3

Used that but cant understand !!
Reply
#4

i tested and it works perffectly
Nvm
You must create player in game hour system
Reply
#5

Learn scripting if you can't understand.
Reply
#6

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.
Reply
#7

What is better GetPlayerTime or Timers??
Reply
#8

Payday every hour should be called Payhour hihi xD

https://sampwiki.blast.hk/wiki/SetTimerEx
Reply
#9

pawn Код:
#include <time>
new H,M,S;
gettime(H,M,S);
if(M == 0 && S == 0)
{
//Your Code
}
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)