Код:
public OnPlayerSpawn(playerid)
{
if(!gPlayerLogged{playerid})
{
SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: You are not logged in!");
Kick(playerid);
return 1;
}
SetTimerEx("SyncVehiclesOnSpawn",1914,0,"i",playerid);
Streamer_Update(playerid);
if(GetPVarInt(playerid, "NGPassenger") == 1)
{
new Float:X, Float:Y, Float:Z;
GetVehiclePos(GetPVarInt(playerid, "NGPassengerVeh"), X, Y, Z);
SetPlayerPos(playerid, (X-2.557), (Y-3.049), Z);
SetPlayerWeaponsEx(playerid);
GivePlayerValidWeapon(playerid, 46, 60000);
SetPlayerSkin(playerid, GetPVarInt(playerid, "NGPassengerSkin"));
SetPlayerHealth(playerid, GetPVarFloat(playerid, "NGPassengerHP"));
SetPlayerArmour(playerid, GetPVarFloat(playerid, "NGPassengerArmor"));
DeletePVar(playerid, "NGPassenger");
DeletePVar(playerid, "NGPassengerVeh");
DeletePVar(playerid, "NGPassengerArmor");
DeletePVar(playerid, "NGPassengerHP");
DeletePVar(playerid, "NGPassengerSkin");
return 1;
}
if(InsideShamal[playerid] != INVALID_VEHICLE_ID)
{
SetPlayerPos(playerid, GetPVarFloat(playerid, "air_Xpos"), GetPVarFloat(playerid, "air_Ypos"), GetPVarFloat(playerid, "air_Zpos"));
SetPlayerFacingAngle(playerid, GetPVarFloat(playerid, "air_Rpos"));
SetPlayerHealth(playerid, GetPVarFloat(playerid, "air_HP"));
SetPlayerArmour(playerid, GetPVarFloat(playerid, "air_Arm"));
SetPlayerWeaponsEx(playerid);
SetPlayerToTeamColor(playerid);
SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
DeletePVar(playerid, "air_Xpos");
DeletePVar(playerid, "air_Ypos");
DeletePVar(playerid, "air_Zpos");
DeletePVar(playerid, "air_Rpos");
DeletePVar(playerid, "air_HP");
DeletePVar(playerid, "air_Arm");
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, InsideShamal[playerid]);
return SetPlayerInterior(playerid, 1);
}
SyncPlayerTime(playerid);
SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWantedLevel]);
STDPlayer[playerid] = 0;
gTeam[playerid] = PlayerInfo[playerid][pTeam];
if(!gPlayerLogged{playerid}) return Kick(playerid);
SetPlayerSpawn(playerid);
SetPlayerWeapons(playerid);
SetPlayerToTeamColor(playerid);
CheckPH(playerid);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1);
return 1;
}