13.05.2017, 11:45
So basically when using this command if you're team human HCLASS shows and if you're zombie ZCLASS shows.
But for some reason when i use this command it shows me the zombie dialog when im human and human dialog when zombie, any help? +rep.
But for some reason when i use this command it shows me the zombie dialog when im human and human dialog when zombie, any help? +rep.
Код:
enum playerinfo { ID, Pass[129], Logged, Level, Cash, Kills, Deaths, Rounds, HumanClass, ZombieClass, XP };
Код:
new PlayerInfo[MAX_PLAYERS][playerinfo];
Код:
CMD:class(playerid) { if(GetPlayerTeam(playerid) != HUMAN) { if(Duration <= 230) { new string[2500]; strcat(string,"{008080}Survivor - Silenced Pistol,Shotgun - 0 XP\n{008080}Officer - Deagle,Shotgun - 500 XP"); ShowPlayerDialog(playerid,DIALOG_HCLASS,DIALOG_STYLE_LIST,"Class Selection (Human)",string,"Choose Class","Next Page"); } else return SendClientMessage(playerid,-1,"!"); } if(GetPlayerTeam(playerid) != ZOMBIE) { new string[1000]; strcat(string,"{41A317}Zombiee\n{41A317}Tyrant 500 XP"); ShowPlayerDialog(playerid,DIALOG_ZCLASS,DIALOG_STYLE_LIST,"Class Selection (Zombie)",string,"Choose Class","Next Page"); } return 1; }
Код:
if(dialogid == DIALOG_CLASS) { if(response) { switch(listitem) { case 0: { if(GetPlayerTeam(playerid) == HUMAN) { new string[2500]; strcat(string,"{008080}Survivor- Silenced Pistol,Shotgun - 0 XP\n{008080}Officer - Deagle,Shotgun - 500 XP"); ShowPlayerDialog(playerid,DIALOG_HCLASS,DIALOG_STYLE_LIST,"Class Selection (Human)",string,"Choose Class","Close Page"); } else return SendClientMessage(playerid,-1,"You must be a human to use human classes!"); } case 1: { if(GetPlayerTeam(playerid) == ZOMBIE) { new string[1000]; strcat(string,"{41A317}Zombiee - LALT Infect a player - 0 XP\n{41A317}Tyrant - LALT Infect Drunk Vision - 500 XP"); ShowPlayerDialog(playerid,DIALOG_ZCLASS,DIALOG_STYLE_LIST,"Class Selection (Zombie)",string,"Choose Class","Next Page"); } else return SendClientMessage(playerid,-1,"You must be a zombie to use zombie classes!"); } case 2: SendClientMessage(playerid,-1,"This class is being reserved for a special event "); } } } if(dialogid == DIALOG_HCLASS) { if(response) { switch(listitem) { case 0: if(PlayerInfo[playerid][XP] >= 0) PlayerInfo[playerid][HumanClass] = 0,PlayerInfo[playerid][HumanClass] = 0,setClass(playerid); case 1: if(PlayerInfo[playerid][XP] >= 500) PlayerInfo[playerid][HumanClass] = 0,PlayerInfo[playerid][HumanClass] = 1,setClass(playerid); } } } if(dialogid == DIALOG_ZCLASS) { if(response) { switch(listitem) { case 0: if(PlayerInfo[playerid][XP] >= 0) PlayerInfo[playerid][ZombieClass] = 0,PlayerInfo[playerid][ZombieClass] = 0,setClass(playerid); case 1: if(PlayerInfo[playerid][XP] >= 500) PlayerInfo[playerid][ZombieClass] = 0,PlayerInfo[playerid][ZombieClass] = 1,setClass(playerid); } } }
Код:
stock GetClassName(playerid) { new classname[64]; if(GetPlayerTeam(playerid) != HUMAN) { switch(PlayerInfo[playerid][HumanClass]) { case 0: classname = "Survivor"; case 1: classname = "Officer"; } } if(GetPlayerTeam(playerid) != ZOMBIE) { switch(PlayerInfo[playerid][ZombieClass]) { case 0: classname = "Zombie"; case 1: classname = "Tyrant"; } } return classname; }
Код:
stock setClass(playerid) { if(GetPlayerTeam(playerid) != HUMAN) { ResetPlayerWeapons(playerid); switch(PlayerInfo[playerid][HumanClass]) { case 0: //survivor { GivePlayerWeapon(playerid,23,100); GivePlayerWeapon(playerid,25,50); switch(random(2)) { case 0: SetPlayerSkin(playerid,69); case 1: SetPlayerSkin(playerid,14); } } case 1: //officer { GivePlayerWeapon(playerid,24,100); GivePlayerWeapon(playerid,25,100); switch(random(2)) { case 0: SetPlayerSkin(playerid,280); case 1: SetPlayerSkin(playerid,281); } } } } return 1; }