How to do this?
#1

Hello guys! Firstly, I just want to say that thank you for your help that you're going to made.
Secondly, I have a problem how to make a paycheck or something that RP Gamemodes are making.
Like after 1 hour they'll receive a paycheck.
This is my includes: //And If you are using another includes add one.
Код:
// Includes
#include <a_samp>
#include <YSI/y_ini>
#include <sscanf2>
#include <zcmd>
Reply
#2

So, you're asking for guidance or for a functional code to copy-paste?
Reply
#3

Set a timer, with ticking internal of 1 hour, and in the function (which gets called once the timer ticks) make a for loop, (i use foreach though), and give them directly the paycheck or check if their connected time was enough to give them paycheck.

(https://sampwiki.blast.hk/wiki/NetStats_GetConnectedTime)
(https://sampwiki.blast.hk/wiki/SetTimer)
Reply
#4

Make a timer every that runs a function every minute for example

Make a enum for player info and have two values hours,mins then

Код:
PlayerPayDayT[playerid] = SetTimerEx("PlayerPayDay", 60000, true, "d", playerid);
Then do something like this

Код:
forward PlayerPayDay(playerid);
public PlayerPayDay(playerid)
{
	if(PlayerInfo[playerid][MINS] >= 60)
	{
		// PAYCHECK STUFF
		PlayerInfo[playerid][HOURS]++;
	}
	else
	{
		PlayerInfo[playerid][MINS]++;
	}

}
Reply
#5

Thanks a lot! It's Working.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)