Payday timer
#1

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]
Reply
#2

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


Forum Jump:


Users browsing this thread: 1 Guest(s)