26.12.2012, 12:56
pawn Код:
// Global variable
new
OnlineTimer[ MAX_PLAYERS ]
;
public OnPlayerConnect( playerid )
{
OnlineTimer[ playerid ] = SetTimerEx( "Online", 60000, true, "i", playerid );
return 1;
}
public OnPlayerDisconnect( playerid, reason )
{
KillTimer( OnlineTimer[ playerid ] );
return 1;
}
forward Online( playerid );
public Online( playerid )
{
PlayerInfo[targetid][Minute] += 1;
return 1;
}
- It's same.
pawn Код:
PlayerInfo[targetid][Minute] += 1;
// OR
PlayerInfo[targetid][Minute]++;
// OR
PlayerInfo[targetid][Minute] = PlayerInfo[targetid][Minute] + 1;