17.01.2013, 16:03
Hello there, my players keep crashing when the spawn..... what to do?
Spawnplayer script:
Spawnplayer script:
Код HTML:
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(PlayerInfo[playerid][pAdminDuty] == 1) { Delete3DTextLabel(DutyLabel[playerid]); DutyLabel[playerid] = Create3DTextLabel("Admin On Duty \n Do NOT Attack",0xFF000099,0,0,0,50,-1,1); Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0); } else if(PlayerInfo[playerid][pTesterDuty] == 1) { Delete3DTextLabel(DutyLabel[playerid]); DutyLabel[playerid] = Create3DTextLabel("Tester On Duty \n Do NOT Attack",0x00AA0099,0,0,0,50,-1,1); Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0); } if(IsPlayerNPC(playerid)) { SetPlayerSkin(playerid, 270); SafeGivePlayerWeapon(playerid, 42, 10000); return 1; } 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 / SASD, 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 Has been Automatically Promoted to Regular Player!", pName); SendClientMessageToAll(COLOR_PINK, string); GameTextForPlayer(playerid, "~y~PROMOTED ~n~~p~REGULAR PLAYER !!!!!", 10000, 5); if (PlayerInfo[playerid][pHelper] == 0) { PlayerInfo[playerid][pHelper] = 1; SendClientMessage(playerid, COLOR_PINK, "You have been Promoted to a Helper!"); } if (PlayerInfo[playerid][pAchievement7] == 0) { TextDrawSetString(Textdraw64[playerid],"Congratulations! ~n~~n~You have earned the medal ~n~~b~Regular Player (7) ~n~~n~~w~you won ~g~$200"); ShowAchievement(playerid); SafeGivePlayerMoney(playerid,2500); PlayerInfo[playerid][pAchievement7] = 1; } } if(PlayerInfo[playerid][pRegularCount] <= 36000 && PlayerInfo[playerid][pRegularRank] == 1) { PlayerInfo[playerid][pRegularRank] = 2; GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "%s Has been Automatically Promoted to Regular Player Level 2!", pName); SendClientMessageToAll(COLOR_PINK, string); GameTextForPlayer(playerid, "~y~PROMOTED ~n~~p~REGULAR PLAYER LEVEL 2!!!!!", 10000, 5); if (PlayerInfo[playerid][pAchievement8] == 0) { TextDrawSetString(Textdraw64[playerid],"Congratulations! ~n~~n~You have earned the medal ~n~~b~Regular Level 2 (8) ~n~~n~~w~you won ~g~$5000"); ShowAchievement(playerid); SafeGivePlayerMoney(playerid,5000); PlayerInfo[playerid][pAchievement8] = 1; } } if(PlayerInfo[playerid][pRegularCount] == 0 && PlayerInfo[playerid][pRegularRank] == 2) { PlayerInfo[playerid][pRegularRank] = 3; GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "%s Has been Automatically Promoted to Regular Player Level 3!", pName); SendClientMessageToAll(COLOR_PINK, string); GameTextForPlayer(playerid, "~y~PROMOTED ~n~~p~REGULAR PLAYER LEVEL 3!!!!!", 10000, 5); if (PlayerInfo[playerid][pHelper] == 1 || PlayerInfo[playerid][pHelper] == 0) { PlayerInfo[playerid][pHelper] = 2; SendClientMessage(playerid, COLOR_PINK, "You have been Promoted to a Master Helper!"); } } if (PlayerInfo[playerid][pAchievement5] == 0 && PlayerInfo[playerid][pConnectSeconds] >= 3600) { TextDrawSetString(Textdraw64[playerid],"Congratulations! ~n~~n~You have earned the medal ~n~~b~One Hour! (5) ~n~~n~~w~you won ~g~$100"); ShowAchievement(playerid); SafeGivePlayerMoney(playerid,100); PlayerInfo[playerid][pAchievement5] = 1; } if (PlayerInfo[playerid][pAchievement6] == 0 && PlayerInfo[playerid][pConnectSeconds] >= 18000) { TextDrawSetString(Textdraw64[playerid],"Congratulations! ~n~~n~You have earned the medal ~n~~b~Five Hours! (6) ~n~~n~~w~you won ~g~$250"); ShowAchievement(playerid); SafeGivePlayerMoney(playerid,250); PlayerInfo[playerid][pAchievement6] = 1; } 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] == 3) { 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][pMember] == 17) { 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] == 3) { 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; } else if(PlayerInfo[playerid][pLeader] == 17) { 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; }