20.07.2012, 16:33
Whenever there are like 2 players, it raises to 80% usage, and just auto-restarts, on one player it doesn't restard, but it's like on 50%.
My onplayerupdate :
My onplayerupdate :
pawn Код:
public OnPlayerUpdate(playerid)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GiveNameSpace(sendername);
if(GetPlayerMoney(playerid) != PCash[playerid]) {
SetPlayerMoney(playerid,PCash[playerid]);
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && Speedlimit[playerid])
{
new a, b, c;
GetPlayerKeys(playerid, a, b ,c);
if(a == 8 && GetVehicleSpeed(GetPlayerVehicleID(playerid), 0) > Speedlimit[playerid])
{
new newspeed = GetVehicleSpeed(GetPlayerVehicleID(playerid), 0) - Speedlimit[playerid];
ModifyVehicleSpeed(GetPlayerVehicleID(playerid), -newspeed);
}
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
for(new i = 0; i < sizeof(SpikeInfo); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ]))
{
if(SpikeInfo[i][sCreated] == 1)
{
new panels, doors, lights, tires;
new carid = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
tires = encode_tires(1, 1, 1, 1);
UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
return 0;
}
}
}
}
if(PayDayAuth[playerid] == 1)
{
PayDayAuth[playerid] = 0;
PayDay(playerid);
}
return 1;
}