Payday timer - 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 timer (
/showthread.php?tid=507968)
Payday timer -
mrkiller90 - 20.04.2014
Well I made myself fast in 3 minutes this system but I want to make sure if this really works, can anyone check it and tell me please?
pawn Код:
enum pInfo
{
pPDTime
}
new PlayerInfo[MAX_PLAYERS][pInfo];
forward ...
public PaydayTimer(playerid)
{
new payday = 700, string[256];
GivePlayerMoney(playerid, 700);
PlayerInfo[playerid][pMoney] = GetPlayerMoney(playerid);
PlayerInfo[playerid][pExp] = (PlayerInfo[playerid][pExp] - 1);
format(string, sizeof(string),"~b~Payday: ~p~$%d", payday);
GameTextForPlayer(playerid, string, 5000, 5);
PlayerInfo[playerid][pPDTime] = 0;
return 1;
}
(...on player register...)
PlayerInfo[playerid][pPDTime] = 0;
(...on player login...)
new time;
time = (3600000 - PlayerInfo[playerid][pPDTime]);
SetTimer("PaydayTimer", time, 1);
I used Yini for this and I think if this works it is a little bit slow system, can you guys show me a way better to make this?
--------------------------------------------------------------------------------------------------------
[Ok forget this, it's completelly wrong, I don't know how to delete this topic so IGNORE IT]
Re: Payday timer -
blackwave - 20.04.2014
Do not use "256" as size, use less.
Also here:
pawn Код:
PlayerInfo[playerid][pExp] = (PlayerInfo[playerid][pExp] - 1);
For this:
pawn Код:
PlayerInfo[playerid][pExp] -= 1
If you refer about INI, use Y_INI.