Timer saves wrongly...
#1

Hello samp forum members thank you for reading my topic and code.

Maybe someone could help me out with it..
I can't find whats going wrong...


INI FILE:

pawn Код:
CMDT=1383562867
OnGameModeInit:

pawn Код:
SetTimer("GlobalCheck",1000,true);
Global checking:
pawn Код:
forward GlobalCheck();
public GlobalCheck()
{
    foreach(Player,i)
    {
        if(PlayerInfo[i][pCMDT] > 0 && gettime() <= PlayerInfo[i][pCMDT])
        {
            PlayerInfo[i][pCMDT] = 0;
            SendClientMessage(i,0xFFFFFFFF,"The /giverespect command is ready for use once more.");
        }
    }
    return 1;
}
CMD:

pawn Код:
CMD:giverespect(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pCMDT] > 0)return SendClientMessage(playerid,0xFF0000FF,"Please wait before using this command again.");
    if(PlayerInfo[playerid][pCMDT] <= 0)
    {
        new id, string[128];
        if(sscanf(params, "r", id)) return SendClientMessage(playerid, 0xCC0000AA, "USAGE: /respect <playerid/partofname>");
        if(IsPlayerInRangeOfPlayer(playerid, id, 5))
        {
            if(playerid != id)
            {
                PlayerInfo[playerid][pStreetRespect]++;
                PlayerInfo[playerid][pCMDT] = gettime() + 3600;
                if((gettime() - PlayerInfo[playerid][pCMDT]) > 3600)
                format(string, sizeof(string), " You have gived Street Respect to %s.", NORPN(id));
                SendClientMessage(playerid, COLOR_WHITE, string);
                format(string, sizeof(string), " Player %s has gived you Street Respect to you.", NORPN(playerid));
                SendClientMessage(playerid, COLOR_WHITE, string);
            }
        }
        else
        {
            SendClientMessage(playerid, -1, "You can't heal yourself.");
        }
    }
    else
    {
        SendClientMessage(playerid, -1, "You aren't close enough to the player.");
    }
    return 1;
}
Reply


Messages In This Thread
Timer saves wrongly... - by Scrillex - 04.11.2013, 12:26
Re: Timer saves wrongly... - by Jefff - 04.11.2013, 13:32

Forum Jump:


Users browsing this thread: 1 Guest(s)