10.06.2008, 08:36
pawn Код:
new FlyPoints[MAX_PLAYERS];
new FlyTimer[MAX_PLAYERS];
pawn Код:
public OnPlayerConnect(playerid)
{
FlyPoints[playerid] = 0;
}
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate);
{
if (newstate == PLAYER_STATE_DRIVER)
{
new vehmdl = GetVehicleModel(GetPlayerVehicleID(playerid));
if (vehmdl == SomeModel || vehmdl == SomeModel2 || vehmdl == SomeModel3 ||... )
{
FlyTimer[playerid] = SetTimerEx("FlyTimer", 1000, 0, "iii", playerid, GetPlayerVehicleID(playerid), 0);
}
}
}
pawn Код:
forward FlyTimer(playerid, vehid, count);
public FlyTimer(playerid, vehid, count)
{
if (IsPlayerConnected(playerid))
{
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if (GetPlayerVehicleID(playerid) == vehid)
{
if (count == 60)
{
FlyPoints[playerid] = FlyPoints[playerid]+1;
FlyTimer[playerid] = SetTimerEx("FlyTimer", 1000, 0, "iii", playerid, vehid, 0);
}
else
{
FlyTimer[playerid] = SetTimerEx("FlyTimer", 1000, 0, "iii", playerid, vehid, count+1);
}
}
}
}
}