23.12.2016, 12:51
I think so, in the callback "OnPlayerDeath" it seems there is no problem
I've checked the human part that converts into a zombie, but it seems there is no error, I also do not put filterscript, setspawninfo, and addplayerclass
this callback human change to zombie
then this SetPlayerZombie
I've checked the human part that converts into a zombie, but it seems there is no error, I also do not put filterscript, setspawninfo, and addplayerclass
this callback human change to zombie
Код:
Timer:ServerUpdate[1250]() // frrm y less { if(GameOver == false) { MapInfo[Durasi]--; if(MapInfo[Durasi] == MapInfo[Deadtime]) { new str[254]; new randomid = Iter_Random(Player); format(str,sizeof(str),"{FFFF00}[INFECTION]: {FFFFFF}%s has become a zombie.",GetName(randomid)); SendClientMessageToAll(-1,str); GameTextForAll("~r~zombies~w~ come, ~g~save~w~ yourself from a zombie ~r~attack~r~", 4000, 4); SetPlayerZombie(randomid); printf("%s selected to be a zombie!", GetName(randomid)); } } return 1; } public OnPlayerSpawn(playerid) { if(MapInfo[Durasi] <= MapInfo[Deadtime]) { SetPlayerZombie(playerid); } else { SetPlayerHuman(playerid); } return 1; }
Код:
stock SetPlayerZombie(playerid) { SetPlayerColor(playerid,ZOMBIE_COLOR); SetPlayerTeam(playerid,ZOMBIE); team[playerid] = ZOMBIE; SetPlayerHealth(playerid, 100.0); switch(random(4)) { case 0: SetPlayerSkin(playerid,162); case 1: SetPlayerSkin(playerid,135); case 2: SetPlayerSkin(playerid,137); case 3: SetPlayerSkin(playerid,196); } ResetPlayerWeapons(playerid); ClearAnimations(playerid); return 1; }