/hqwithdraw not work
#1

Okay. I made an /hqwithdraw to go with /hqdeposit, but when I test it IG, it says "You are not the leader of your gang!"

CODE:

pawn Код:
if(strcmp(cmd, "/hqw", true) == 0 || strcmp(cmd, "/hqwithdraw", true) == 0)
{
new playhq = (PlayerInfo[playerid][pGang]-1);
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_GREY,"USAGE: /hqw [money]");
return 1;
}
new hqcash = strval(tmp);
if (hqcash < 1)
{
SendClientMessage(playerid, COLOR_YELLOW, "You must withdraw over $1!");
return 1;
}
if (PlayerInfo[playerid][pGang] == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "Your not in a gang/family");
return 1;
}
if ((PlayerInfo[playerid][pGleader] != 1 || PlayerInfo[playerid][pGleader] != 2 || PlayerInfo[playerid][pGleader] != 3 || PlayerInfo[playerid][pGleader] != 4))
{
SendClientMessage(playerid, COLOR_RED, "You are not the leader of your gang!");
return 1;
}
if (PlayerToPoint(5, playerid,HQInfo[playhq][hqEntrancex],HQInfo[playhq][hqEntrancey],HQInfo[playhq][hqEntrancez]))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 79, "You withdrawed $%d from your gang's bank account",hqcash);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
GetPlayerName(playerid, sendername, 24);
format(string, 79, "**%s has withdrawed $%d from the gang bank account at HQ!**", sendername,hqcash);
SendTeamMessage(gTeam[playerid], TEAM_AZTECAS_COLOR, string);
HQInfo[playhq][hqMoney] = HQInfo[playhq][hqMoney] - hqcash;
GivePlayerMoney(playerid, hqcash);
OnPropUpdate();
return 1;
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "Your too far away from your HQ");
return 1;
}
}
SPECIFIC CODE:

pawn Код:
if ((PlayerInfo[playerid][pGleader] != 1 || PlayerInfo[playerid][pGleader] != 2 || PlayerInfo[playerid][pGleader] != 3 || PlayerInfo[playerid][pGleader] != 4))
{
SendClientMessage(playerid, COLOR_RED, "You are not the leader of your gang!");
return 1;
}
Thanks in advance, Antonio!
Reply


Messages In This Thread
/hqwithdraw not work - by Antonio [G-RP] - 25.08.2009, 02:30
Re: /hqwithdraw not work - by coole210 - 25.08.2009, 03:46
Re: /hqwithdraw not work - by Antonio [G-RP] - 25.08.2009, 03:52
Re: /hqwithdraw not work - by Antonio [G-RP] - 25.08.2009, 05:01

Forum Jump:


Users browsing this thread: 1 Guest(s)