in our gamemode people get crash more than normal. those cars in the fire appears after i do /sync. so i think these cars have something to do with it. and im asking how to fix it or does it cause the crashes? thanks
its ok. thanks anyways
Код:
forward SyncPlayer(playerid);
public SyncPlayer(playerid)
{
if(Current != -1) MarkerStealth();
Player[playerid][Syncings] = true;
new tmp_playing=false;
if(Player[playerid][pPlaying])
{
tmp_playing=true;
}
new bool:IsPlayerSpecing[MAX_PLAYERS];
for(new x = 0; x <= maxid; x++)
{
if(!IsPlayerConnected(x)) continue;
if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && gSpectateID[x] == playerid) {
IsPlayerSpecing[x] = true;
}
}
new PlayerWeapons[2][13];
for(new i = 0; i < 13; i++)
{
if(i == 0 || i == 1)
{
GetPlayerWeaponData(playerid,i,PlayerWeapons[0][i],PlayerWeapons[1][i]);
if(PlayerWeapons[1][i] > 1)
{
PlayerWeapons[1][i] = 1;
}
}
else
{
GetPlayerWeaponData(playerid,i,PlayerWeapons[0][i],PlayerWeapons[1][i]);
}
}
Syncing[playerid] = 1;
GetPlayerHealth(playerid,Player[playerid][pHealth]);
GetPlayerArmour(playerid,Player[playerid][pArmour]);
new Float:PlayerPos[3];
GetPlayerPos(playerid,PlayerPos[0],PlayerPos[1],PlayerPos[2]);
new Float:Angle;
GetPlayerFacingAngle(playerid, Angle);
new TheInterior, VirtualWorld;
TheInterior = GetPlayerInterior(playerid);
VirtualWorld = GetPlayerVirtualWorld(playerid);
new team = GetPlayerTeam(playerid);
SetSpawnInfo(playerid,team,GetPlayerSkin(playerid),PlayerPos[0],PlayerPos[1],PlayerPos[2]-0.50,Angle,0,0,0,0,0,0);
SpawnPlayerEx(playerid);
SetSpawnInfo(playerid,team,GetPlayerSkin(playerid),Lobby[0],Lobby[1],Lobby[2],0,0,0,0,0,0,0);
if(tmp_playing)
{
Player[playerid][pPlaying] = true;
}
SetPlayerInterior(playerid,TheInterior);
SetPlayerVirtualWorld(playerid,VirtualWorld);
SetTimerEx("SyncingAgain",5000,false,"i",playerid);
for(new i = 0; i < 13; i++)
{
if(PlayerWeapons[0][i] > 0)
{
GivePlayerWeapon(playerid,PlayerWeapons[0][i],PlayerWeapons[1][i]);
}
}
for(new x = 0; x <= maxid; x++)
{
if(IsPlayerSpecing[x] == true)
{
SetTimerEx("Spectate",250,false,"ii",x,playerid);
}
}
ClearAnimations(playerid);
return 1;
}