27.10.2012, 10:46
Hello, i have a problem that sometimes when a player spawn he got automatic killed, know everyone what the problem is? here is the onplayerspawn and onplayerdeath:
Код:
public OnPlayerDeath(playerid, killerid, reason) { CheckTime = 5; ResetPlayerWeaponStats(playerid); SendDeathMessage(killerid, playerid, reason); if(killerid != INVALID_PLAYER_ID) { if(PlayerTeam[killerid] != PlayerTeam[playerid]) { PlayerKills[killerid] ++; PlayerDeaths[playerid] ++; SendDeathMessage(killerid,playerid,reason); GivePlayerMoneyEx(playerid,-150); GivePlayerMoneyEx(killerid,100); SetPlayerScore(killerid,GetPlayerScore(killerid)+1); if(PlayerTeam[playerid] == TEAM_ZOMBIE) { HumanKills ++; SetSpawnInfo(playerid,TEAM_HUMAN,287,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerTeam[playerid] = TEAM_HUMAN; format(str,144,"«| %s has been cured. |»",PlayerName[playerid]); SendClientMessageToAll(COLOR_BLUE,str); } else if(PlayerTeam[playerid] == TEAM_HUMAN) { ZombieKills ++; SetSpawnInfo(playerid,TEAM_ZOMBIE,162,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerTeam[playerid] = TEAM_ZOMBIE; format(str,144,"«| %s has been infected. |»",PlayerName[playerid]); SendClientMessageToAll(COLOR_RED,str); } } } return 1; }
Код:
public OnPlayerSpawn(playerid) { if(PlayerTeam[playerid] == TEAM_ZOMBIE) PlayerConnect[playerid] = true; PlayerHealTime[playerid] = 5; SetPlayerHealth(playerid, 100); SetPlayerChatBubble(playerid,"[ANTI-SPAWN-KILL]",COLOR_YELLOW,40.0,1000); SendClientMessage(playerid,COLOR_LIGHTGREEN,"«| Anti Spawn Kill (5 seconds) |»"); SetPlayerColor(playerid,0xBDE784AA); SetPlayerTeam(playerid,TEAM_ZOMBIE); TextDrawShowForPlayer(playerid,tURL); TextDrawShowForPlayer(playerid,tVS); TextDrawShowForPlayer(playerid,tTimer); TextDrawShowForPlayer(playerid,tBite); GivePlayerWeaponEx(playerid,4,1); SendClientMessage(playerid,COLOR_RED,"Team: Zombie"); SendClientMessage(playerid,COLOR_RED,"Kill the humans. Use your Knife to infect a Human."); SendClientMessage(playerid,COLOR_RED,"One Hit and the Human is infected."); SendClientMessage(playerid,COLOR_LIGHTGREEN,"For the commands, type /cmds, for help type /help."); } else if(PlayerTeam[playerid] == TEAM_HUMAN) { PlayerConnect[playerid] = true; PlayerHealTime[playerid] = 5; SetPlayerHealth(playerid, 100); SetPlayerChatBubble(playerid,"[ANTI-SPAWN-KILL]",COLOR_YELLOW,40.0,1000); SendClientMessage(playerid,COLOR_LIGHTGREEN,"«| Anti Spawn Kill (5 seconds) |»"); SetPlayerColor(playerid,0x66E5FFAA); SetPlayerTeam(playerid,TEAM_HUMAN); TextDrawShowForPlayer(playerid,tURL); TextDrawShowForPlayer(playerid,tVS); TextDrawShowForPlayer(playerid,tTimer); TextDrawHideForPlayer(playerid,tBite); GivePlayerWeaponEx(playerid,1,1); GivePlayerWeaponEx(playerid,3,1); GivePlayerWeaponEx(playerid,24,9999); GivePlayerWeaponEx(playerid,25,9999); GivePlayerWeaponEx(playerid,31,9999); SendClientMessage(playerid,COLOR_BLUE,"Team: Human"); SendClientMessage(playerid,COLOR_BLUE,"Work in Team!"); SendClientMessage(playerid,COLOR_BLUE,"Kill the Zombies. You have got heavy Weapons, they make Double Damage."); SendClientMessage(playerid,COLOR_LIGHTGREEN,"For the commands, type /cmds, for help type /help."); } return 1; }