Command not working correctly -
Stones - 13.05.2017
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.
Код:
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;
}
Re: Command not working correctly -
Vince - 13.05.2017
You do realize that != means "not equal to", do you?
Re: Command not working correctly -
Stones - 13.05.2017
Quote:
Originally Posted by Vince
You do realize that != means "not equal to", do you?
|
Fixed that now. Changed it to
Код:
if(GetPlayerTeam(playerid) == HUMAN)
if(GetPlayerTeam(playerid) == ZOMBIE)
The classes are showing for the correct teams.
But when selecting one of the listed items it's not using the correct HCLASS or ZCLASS.
/class as a zombie > it shows me the zombie classes > gives me one of the human classes from
Код:
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);
}
}
}
Re: Command not working correctly -
Stones - 13.05.2017
Nevermind i've managed to fix it.
I had them all set to
lmaoo, thanks again.