24.09.2012, 21:23
hello, my gamemode is not allowing the player to spawn AFTER death.
when i login i can spawn normally.
but when i die this is what happens:
my onplayerspawn:
my onplayerdeath
i press spawn but nothing happens
Any help would be appreciated
when i login i can spawn normally.
but when i die this is what happens:
my onplayerspawn:
Код:
public OnPlayerSpawn(playerid) { SetRealMoney(playerid, ScriptMoney[playerid]); new pName[MAX_PLAYER_NAME]; new string[128]; InitLockDoors(playerid); if(IsPlayerNPC(playerid)) return 1; STDPlayer[playerid] = 0; gTeam[playerid] = PlayerInfo[playerid][pTeam]; //Set the Team if (gTeam[playerid] == 4) //medic / criminal reset team { gTeam[playerid] = 3; } if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_LIGHTRED, " This server requires a Login BEFORE spawn (Kicked) **"); Kick(playerid); } if(!gPlayerAnimLibsPreloaded[playerid]) { PreloadAnimLib(playerid,"BOMBER"); PreloadAnimLib(playerid,"RAPPING"); PreloadAnimLib(playerid,"SHOP"); PreloadAnimLib(playerid,"BEACH"); PreloadAnimLib(playerid,"SMOKING"); PreloadAnimLib(playerid,"FOOD"); PreloadAnimLib(playerid,"ON_LOOKERS"); PreloadAnimLib(playerid,"DEALER"); PreloadAnimLib(playerid,"CRACK"); PreloadAnimLib(playerid,"CARRY"); PreloadAnimLib(playerid,"COP_AMBIENT"); PreloadAnimLib(playerid,"PARK"); PreloadAnimLib(playerid,"INT_HOUSE"); PreloadAnimLib(playerid,"FOOD"); PreloadAnimLib(playerid,"PED"); PreloadAnimLib(playerid,"MISC"); PreloadAnimLib(playerid,"BLOWJOBZ"); PreloadAnimLib(playerid,"RIFLE"); PreloadAnimLib(playerid,"UZI"); PreloadAnimLib(playerid,"SHOTGUN"); PreloadAnimLib(playerid,"COLT45"); PreloadAnimLib(playerid,"SILENCED"); PreloadAnimLib(playerid,"GYMNASIUM"); PreloadAnimLib(playerid,"PARK"); PreloadAnimLib(playerid,"BSKTBALL"); PreloadAnimLib(playerid,"GANGS"); PreloadAnimLib(playerid,"FIGHT_D"); PreloadAnimLib(playerid,"PAULNMAC"); gPlayerAnimLibsPreloaded[playerid] = 1; } TextDrawHideForPlayer(playerid, Textdraw39[playerid]); TextDrawHideForPlayer(playerid, Textdraw40[playerid]); if(gTeam[playerid] == 11 && PlayerInfo[playerid][pLeader] < 1) { MedicBill[playerid] = 0; new rand = random(sizeof(CIV)); SendClientMessage(playerid, COLOR_LIGHTRED, "You are not an Approved Leader, you are now a Civilian !"); PlayerInfo[playerid][pTeam] = 3; gTeam[playerid] = 3; SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pModel] = CIV[rand]; SpawnPlayer(playerid); } if(gTeam[playerid] == 5) { if(PlayerInfo[playerid][pMember] < 1) { MedicBill[playerid] = 0; new rand = random(sizeof(CIV)); SendClientMessage(playerid, COLOR_LIGHTRED, "You are not a Family Member, you are now a Civilian !"); PlayerInfo[playerid][pTeam] = 3; gTeam[playerid] = 3; SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pModel] = CIV[rand]; SpawnPlayer(playerid); } } if(gTeam[playerid] == 10) { if(PlayerInfo[playerid][pMember] != 8) { MedicBill[playerid] = 0; new rand = random(sizeof(CIV)); SendClientMessage(playerid, COLOR_LIGHTRED, "You are not a Member of this Agency, you are now a Civilian !"); PlayerInfo[playerid][pTeam] = 3; gTeam[playerid] = 3; SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pModel] = CIV[rand]; SpawnPlayer(playerid); } } if(gTeam[playerid] == 2 && PlayerInfo[playerid][pMember] > 3) { MedicBill[playerid] = 0; new rand = random(sizeof(CIV)); SendClientMessage(playerid, COLOR_LIGHTRED, "You haven't applied for being an Officer / FBI / you are now a Civilian !"); PlayerInfo[playerid][pTeam] = 3; gTeam[playerid] = 3; SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pModel] = CIV[rand]; SpawnPlayer(playerid); } if(PlayerInfo[playerid][pRegularCount] <= 72000 && PlayerInfo[playerid][pRegularRank] == 0) { PlayerInfo[playerid][pRegularRank] = 1; GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "%s was promoted to Regular.", pName); SendClientMessageToAll(COLOR_LIGHTBLUEGREEN, string); if (PlayerInfo[playerid][pHelper] == 0) { PlayerInfo[playerid][pHelper] = 1; SendClientMessage(playerid, COLOR_GROVE, "You became a helper!"); } } if(PlayerInfo[playerid][pRegularCount] <= 36000 && PlayerInfo[playerid][pRegularRank] == 1) { PlayerInfo[playerid][pRegularRank] = 2; GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "%s was promoted to Veteran", pName); SendClientMessageToAll(COLOR_LIGHTBLUEGREEN, string); } if(PlayerInfo[playerid][pRegularCount] == 0 && PlayerInfo[playerid][pRegularRank] == 2) { PlayerInfo[playerid][pRegularRank] = 3; GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "%s was promoted to 1337. [Elite]", pName); SendClientMessageToAll(COLOR_LIGHTBLUEGREEN, string); if (PlayerInfo[playerid][pHelper] == 1 || PlayerInfo[playerid][pHelper] == 0) { PlayerInfo[playerid][pHelper] = 2; SendClientMessage(playerid, COLOR_GROVE, "You came a master helper!"); } } if(gTeam[playerid] == 3) { if(PlayerInfo[playerid][pMember] > 0 || PlayerInfo[playerid][pLeader] > 0) { SendClientMessage(playerid, COLOR_LIGHTRED, "You are part of a Family/Force, you've been forced to the right Class + Char !"); MedicBill[playerid] = 0; new model = PlayerInfo[playerid][pChar]; if(PlayerInfo[playerid][pMember] == 1) { SetSpawnInfo(playerid, 2, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; } else if(PlayerInfo[playerid][pMember] == 2) { SetSpawnInfo(playerid, 2, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; } else if(PlayerInfo[playerid][pMember] == 4) { SetSpawnInfo(playerid, 1, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 1; gTeam[playerid] = 1; } else if(PlayerInfo[playerid][pMember] == 5) { SetSpawnInfo(playerid, 5, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; } else if(PlayerInfo[playerid][pMember] == 6) { SetSpawnInfo(playerid, 5, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; } else if(PlayerInfo[playerid][pMember] == 7) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; } else if(PlayerInfo[playerid][pMember] == 8) { SetSpawnInfo(playerid, 10, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10; gTeam[playerid] = 10; } else if(PlayerInfo[playerid][pMember] == 9) { SetSpawnInfo(playerid, 12, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; } else if(PlayerInfo[playerid][pMember] == 10) { SetSpawnInfo(playerid, 12, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; } else if(PlayerInfo[playerid][pMember] == 11) { SetSpawnInfo(playerid, 12, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; } else if(PlayerInfo[playerid][pMember] == 12) { SetSpawnInfo(playerid, 1, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 1; gTeam[playerid] = 1; } else if(PlayerInfo[playerid][pMember] == 13) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; } else if(PlayerInfo[playerid][pMember] == 14) { SetSpawnInfo(playerid, 5, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; } else if(PlayerInfo[playerid][pMember] == 15) { SetSpawnInfo(playerid, 5, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; } else if(PlayerInfo[playerid][pMember] == 16) { SetSpawnInfo(playerid, 5, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; } else if(PlayerInfo[playerid][pLeader] == 1) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; } else if(PlayerInfo[playerid][pLeader] == 2) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; } else if(PlayerInfo[playerid][pLeader] == 4) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; } else if(PlayerInfo[playerid][pLeader] == 5) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; } else if(PlayerInfo[playerid][pLeader] == 6) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; } else if(PlayerInfo[playerid][pLeader] == 7) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; } else if(PlayerInfo[playerid][pLeader] == 8) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; } else if(PlayerInfo[playerid][pLeader] == 9) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; } else if(PlayerInfo[playerid][pLeader] == 10) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; } else if(PlayerInfo[playerid][pLeader] == 11) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; } else if(PlayerInfo[playerid][pLeader] == 12) { SetSpawnInfo(playerid, 1, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 1; gTeam[playerid] = 1; } else if(PlayerInfo[playerid][pLeader] == 13) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; } else if(PlayerInfo[playerid][pLeader] == 14) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; } else if(PlayerInfo[playerid][pLeader] == 15) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; } else if(PlayerInfo[playerid][pLeader] == 16) { SetSpawnInfo(playerid, 11, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; } //SetSpawnInfo(playerid, team, model,0.0,0.0,0.0,0,0,0,0,0,0,0); SpawnPlayer(playerid); } } if(PlayerInfo[playerid][pChar] > 0) { SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]); } else { SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]); } SetPlayerWeapons(playerid); SetPlayerSpawn(playerid); SetPlayerToTeamColor(playerid); PlayerFixRadio(playerid); IsCopBanned(playerid); return 1; }
Код:
public OnPlayerDeath(playerid, killerid, reason) { new string[128]; new name[MAX_PLAYER_NAME]; new name2[MAX_PLAYER_NAME]; new deathreason[20]; new y, m, d; new h,mi,s; getdate(y,m,d); gettime(h,mi,s); GetPlayerName(playerid, name, sizeof(name)); GetPlayerName(killerid, name2, sizeof(name2)); SetPlayerVirtualWorld(playerid, 0); SetPlayerInterior(playerid, 0); SetPlayerPos(playerid, [LOCATION CHANGED IN THE SCREENSHOT]); PlayerInfo[playerid][pVirWorld] = 0; SendClientMessage(playerid, COLOR_CREAM, "You have paid $200 for medical pills."); SafeGivePlayerMoney(playerid, -200); if(killerid != INVALID_PLAYER_ID) { if(GetPlayerWeapon(killerid) != reason) { if(AntiFakeKill == 1) { if(reason != 51 || reason != 50 || reason != 18 || reason == 36 || reason == 35 || reason == 40 || reason == 16) { FakeKillWarns[playerid] ++; if(FakeKillWarns[playerid] == 4) { format(string, sizeof(string), "%s (%d), Has been kicked by The Anticheat Peter Griffin for Possible Fake Death Hacks.", name, playerid); SendClientMessageToAll(COLOR_NICERED, string); SendClientMessage(playerid,COLOR_LIGHTBLUE, "You have Been Kicked by The Anticheat For Possible Fake Death Hacks."); format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Anticheat Has Kicked %s for: Fake Death hacks.",d,m,y,h,mi,s,name); KickLog(string); format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Kicked by the Anticheat - Fake Death Hacks.",d,m,y,h,mi,s,name); AddPunishment(playerid, string); Kick(playerid); } else { format(string, sizeof(string), "[PETER]: %s(%d) is possibly using fake death hacking. ", name, playerid); SendAdminMessage(COLOR_YELLOW, string); PlayerSuspicious[playerid] = 1; PlayerFakeDeathHacking[playerid] = 1; PlayerGotSpottedRecently[playerid] = 1; SetTimerEx("ResetAcWarn", 300000, 0, "i", playerid); } } } } } if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER) { if(AntiDriveBy == 1) { new model = GetVehicleModel(GetPlayerVehicleID(killerid)); if(model != 520 || model != 425 || model != 432) { PlayerInfo[killerid][pWarns] ++; if(PlayerInfo[playerid][pWarns] == 3) { format(string, sizeof(string), "%s (%d), Has been Kicked by The Anticheat Peter Griffin for Excessive Drive by Killing.", name2, killerid); SendClientMessageToAll(COLOR_NICERED, string); SendClientMessage(killerid,COLOR_LIGHTBLUE, "You have Been Kicked by The Anticheat For Excessive Drive By Killing"); format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Anticheat Has Kicked %s for: Excessive Drive By Killing",d,m,y,h,mi,s,name2); KickLog(string); Kick(killerid); } else { format(string, sizeof(string), "%s (%d), Has been Warned by The Anticheat Peter Griffin for Drive by Killing.", name2, killerid); SendClientMessageToAll(COLOR_NICERED, string); SendClientMessage(killerid,COLOR_LIGHTBLUE, "You have Been Warned by The Anticheat For Excessive Drive By Killing"); format(string, sizeof(string), "[PETER]: %s was warned by the anticheat for DB as driver.", name2); SendAdminMessage(COLOR_YELLOW, string); format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Warned by Anticheat - Reason: Driver drive-by kill.",d,m,y,h,mi,s); AddPunishment(killerid, string); } } } } if(killerid != INVALID_PLAYER_ID) { if(reason == 0) { deathreason = "Melee"; } else if(reason == 36 || reason == 35 || reason == 40 || reason == 16) { deathreason = "Explosion"; } else if(reason == 18 || reason == 37) { deathreason = "Fire"; } else if(reason == 51) { deathreason = "Explosion"; } else if(reason == 50) { deathreason = "Heli-Kill"; } else { GetWeaponName(reason, deathreason, sizeof(deathreason)); } format(string, sizeof(string),"[INFO]: %s(%d) was killed by %s(%d) with %s", name,playerid,name2,killerid,deathreason); SendAdminMessage(COLOR_GREEN, string); } else { new text[30]; if(reason == 51) { text = "Explosion"; } else if(reason == 53) { text = "Drowned"; } else if(reason == 54) { text = "Collision"; } else { text = "Death"; } format(string, sizeof(string),"[INFO]: %s(%d) was killed by the server. (%s)",name,playerid, text); SendAdminMessage(COLOR_GREEN, string); } new playercash; new victimteam = gTeam[playerid]; new Float:px,Float:py,Float:pz; new killerteam = gTeam[killerid]; TextDrawHideForPlayer(playerid, Textdraw39[playerid]); TextDrawHideForPlayer(playerid, Textdraw40[playerid]); gPlayerSpawned[playerid] = 0; if(PlayerInfo[playerid][pAdminDuty] >= 1) { PlayerInfo[playerid][pAdminDuty] = 0; } GetPlayerPos(playerid, px, py, pz); MedicBill[playerid] = 1; if(gPlayerUsingLoopingAnim[playerid]) { gPlayerUsingLoopingAnim[playerid] = 0; } if(WantedPoints[playerid] > 0) { new dstring[128]; new wanted = WantedPoints[playerid]; new diecash = 0; while(WantedPoints[playerid] > 0) { diecash += 500; WantedPoints[playerid] --; } format(dstring, sizeof(dstring), "You lost $%d for dieing with %d Wanted Points.", diecash, wanted); SendClientMessage(playerid, COLOR_YELLOW, dstring); SafeGivePlayerMoney(playerid, - diecash); PlayerInfo[playerid][pWantedDeaths] += 1; } WantedPoints[playerid] = 0; WantedLevel[playerid] = 0; if(PlayerInfo[playerid][pRegularRank] > 0) { SetPlayerHealth(playerid, 100.0); } else { SetPlayerHealth(playerid, 50.0+PlayerInfo[playerid][pSHealth]); } gPlayerSpawned[playerid] = 1; SafeTime[playerid] = 60; Checked[playerid] = 1; PlayerGotSpottedRecently[playerid] = 1; SetTimerEx("ResetAcWarn",20000,false, "i", playerid); if(killerid != 255) { if(GetPlayerState(killerid) == 2) { if(ProxDetectorS(20, killerid, playerid)) { if(!IsPlayerInAnyVehicle(playerid)) { if(PlayerInfo[killerid][pMember] == 1||PlayerInfo[killerid][pLeader] == 1||PlayerInfo[killerid][pMember] == 2||PlayerInfo[killerid][pLeader] ==2) { SendClientMessage(killerid, COLOR_YELLOW, "That was a drive-by kill. Don't abuse it."); return 1; } SetPlayerCriminal(killerid,255,"Manslaughter"); return 1; } } } }
Any help would be appreciated