20.01.2015, 15:31
Leave saving aside it isn't showing any increment what could be wrong ?
in OnGameModeInit
When i try to test the code with command
It shows 0 0 0 only what could be wrong with it ?
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;
}
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;
}