15.12.2009, 02:55
Well, I'm using SAGC script, and it said "Saves Weapons".
Here's my OnPlayerDisconnect:
Here's my OnPlayerDisconnect:
Quote:
public OnPlayerDisconnect(playerid, reason) { if(gPlayerLogged[playerid]) { new Float,Float:y,Float:z,Float:a; GetPlayerPos(playerid,x,y,z); GetPlayerFacingAngle(playerid,a); PlayerInfo[playerid][pLoadPosX] = x; PlayerInfo[playerid][pLoadPosY] = y; PlayerInfo[playerid][pLoadPosZ] = z; PlayerInfo[playerid][pAngle] = a; PlayerInfo[playerid][pLoadPosInt] = GetPlayerInterior(playerid); PlayerInfo[playerid][pLoadPosW] = GetPlayerVirtualWorld(playerid); PlayerInfo[playerid][pLoadPos] = 1; PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid); VehicleLocked[VehicleLockedPlayer[playerid]] = 0; VehicleLockedPlayer[playerid] = 999; PlayerInfo[playerid][pHospital] = 0; for(new slot = 0; slot < 12; slot++) { new wep, ammo; GetPlayerWeaponData(playerid, slot, wep, ammo); if(wep != 0 && ammo != 0) { if(PlayerInfo[playerid][pGun1] != 0) { PlayerInfo[playerid][pGun1] = wep; PlayerInfo[playerid][pAmmo1] = ammo; } else if(PlayerInfo[playerid][pGun2] != 0) { PlayerInfo[playerid][pGun2] = wep; PlayerInfo[playerid][pAmmo2] = ammo; } else if(PlayerInfo[playerid][pGun3] != 0) { PlayerInfo[playerid][pGun3] = wep; PlayerInfo[playerid][pAmmo3] = ammo; } else if(PlayerInfo[playerid][pGun4] != 0) { PlayerInfo[playerid][pGun4] = wep; PlayerInfo[playerid][pAmmo4] = ammo; } } } if(RaceParticipant[playerid]>=1) { if(Participants==1) { endrace(); } if(RaceParticipant[playerid] < 3 && RaceStart == 0 && !(RaceParticipant[playerid]==3 && RaceStart == 1)) { ReadyRefresh(); } Participants--; RaceParticipant[playerid]=0; DisablePlayerRaceCheckpoint(playerid); } if(RaceBuilders[playerid] != 0) { DisablePlayerRaceCheckpoint(playerid); for(new i;i<BCurrentCheckpoints[b(playerid)];i++) { BRaceCheckpoints[b(playerid)][i][0]=0.0; BRaceCheckpoints[b(playerid)][i][1]=0.0; BRaceCheckpoints[b(playerid)][i][2]=0.0; } BuilderSlots[b(playerid)] = MAX_PLAYERS+1; RaceBuilders[playerid] = 0; } if(CurrentCCTV[playerid] > -1) { KillTimer(KeyTimer[playerid]); TextDrawHideForPlayer(playerid, TD); } CurrentCCTV[playerid] = -1; if(PlayerInfo[playerid][pRoadblock] != 0) { RemoveRoadblock(playerid); } if(Planted[playerid] == 1) { DestroyObject(C4[playerid]); TextDrawDestroy(Meter1[playerid]); TextDrawDestroy(Meter2[playerid]); TextDrawDestroy(Meter3[playerid]); Bomb[playerid] = 0; Planted[playerid] = 0; } OnPlayerDataSave(playerid); } for(new x=0; x<MAX_PLAYERS; x++) if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && Spec[x][SpectateID] == playerid) AdvanceSpectate(x); return 1; } |