17.02.2014, 06:22
pawn Код:
forward TimeOnServer(playerid);
public TimeOnServer(playerid)
{
PlayerInfo[playerid][MinutesPlayed]++;
if(PlayerInfo[playerid][MinutesPlayed] >= 60)
{
PlayerInfo[playerid][MinutesPlayed] = 0;
PlayerInfo[playerid][HoursPlayed]++;
if (PlayerInfo[playerid][pTeamKills] > 0)
{
PlayerInfo[playerid][pTeamKills]--;
new Level;
new Kills = PlayerInfo[playerid][pKills];
new Deaths = PlayerInfo[playerid][pDeaths];
new Penalty = 2 * PlayerInfo[playerid][pTeamKills];
Level = (Kills - Deaths) - Penalty;
if (Level < 0)
{
SetPlayerScore(playerid, 0);
}
else
{
SetPlayerScore(playerid, Level);
}
}
}
else if(PlayerInfo[playerid][MinutesPlayed] == 30 )
{
if (PlayerInfo[playerid][pTeamKills] > 0)
{
PlayerInfo[playerid][pTeamKills]--;
new Level;
new Kills = PlayerInfo[playerid][pKills];
new Deaths = PlayerInfo[playerid][pDeaths];
new Penalty = 2 * PlayerInfo[playerid][pTeamKills];
Level = (Kills - Deaths) - Penalty;
if (Level < 0)
{
SetPlayerScore(playerid, 0);
}
else
{
SetPlayerScore(playerid, Level);
}
}
}
}