Code not working
#1

Leave saving aside it isn't showing any increment what could be wrong ?



in OnGameModeInit

pawn Код:
SetTimer("TimeUpdater",1000,true);

pawn Код:
forward TimeUpdater(playerid);
public TimeUpdater(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        PlayerInfo[playerid][Seconds]++;
        if(PlayerInfo[playerid][Seconds] >= 59)
        {
            PlayerInfo[playerid][Seconds]=0;
            PlayerInfo[playerid][Minutes] = PlayerInfo[playerid][Minutes] +1;
        }
        if(PlayerInfo[playerid][Minutes] >= 59)
        {
            PlayerInfo[playerid][Minutes]=0;
            PlayerInfo[playerid][Hours] = PlayerInfo[playerid][Hours] +1;
        }
    }
    return 1;
}
When i try to test the code with command
pawn Код:
CMD:timeplayed(playerid,params[])
{
new String[200];
format(String,sizeof(String),"Time played: Seconds: %d %d Minute %d Hours",PlayerInfo[Seconds],PlayerInfo[Minutes],PlayerInfo[Hours]);
SendClientMessage(playerid,RED,String);
return 1;
}
It shows 0 0 0 only what could be wrong with it ?
Reply


Messages In This Thread
Code not working - by Gaurav_Rawat - 20.01.2015, 15:31
Re: Code not working - by Schneider - 20.01.2015, 15:39
Re: Code not working - by xVIP3Rx - 20.01.2015, 15:45
Re: Code not working - by Gaurav_Rawat - 20.01.2015, 16:04
Re: Code not working - by Schneider - 20.01.2015, 16:05
Re: Code not working - by xVIP3Rx - 20.01.2015, 16:09
Re: Code not working - by Gaurav_Rawat - 20.01.2015, 16:20
Re: Code not working - by Schneider - 20.01.2015, 16:24
Re: Code not working - by xVIP3Rx - 20.01.2015, 16:27
Re: Code not working - by Gaurav_Rawat - 20.01.2015, 16:27

Forum Jump:


Users browsing this thread: 2 Guest(s)