command not working
#1

if(strcmp(cmd, "/sellshotgun", true) == 0 || strcmp(cmd, "/giveshotgun", true) == 0)
{
if(PlayerData[playerid][Gundealer] < 1 && PlayerData[playerid][gdworker] != 1) return SendClientMessage(playerid, RED, "SERVER MESSAGE: You are not a Official Gundealer or a Worker");
new tmp[128],string[128];
new otherplayer = strvalEx(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { return SendClientMessage(playerid, WHITE, "Correct Usage: /sellshotgun [playerid] [ammo]");
}
if(PlayerData[playerid][Shotgun] == 0)
{
SendClientMessage(playerid, COLOR_RED, "SERVER MESSAGE: You don't have a Shotgun!");
return 1;
}
if(PlayerData[playerid][Bullets] == 0)
{
SendClientMessage(playerid,COLOR_RED,"SERVER MESSAGE: You don't have any Bullets");
return 1;
}
new playa;
new sendername[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
playa = strvalEx(tmp);
tmp = strtok(cmdtext, idx);
if(!IsPlayerConnected(playa)) return SendClientMessage(playerid, WHITE, "SERVER MESSAGE: Incorrect ID.");
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if (GetDistanceBetweenPlayers(playerid,playa) > 2.00)
{
SendClientMessage(playerid,COLOR_RED1,"You are too far away!!");
return 1;
}
new PlayerColour;
PlayerColour = GetPlayerColor(playerid);
if(PlayerColour == TEAM_HUSTLER)
{
SendClientMessage(playerid, RED, "SERVER MESSAGE: You cannot sell this weapon to this person.");
return 1;
}
if(PlayerColour == TEAM_HOODRATS)
{
SendClientMessage(playerid, RED, "SERVER MESSAGE: You cannot sell this weapon to this person.");
return 1;
}
if(PlayerColour == TEAM_PIMPS)
{
SendClientMessage(playerid, RED, "SERVER MESSAGE: You cannot sell this weapon to this person.");
return 1;
}
if(PlayerColour == TEAM_HOS)
{
SendClientMessage(playerid, RED, "SERVER MESSAGE: You cannot sell this weapon to this person.");
return 1;
}
if(PlayerColour == TEAM_TAGGERS)
{
SendClientMessage(playerid, RED, "SERVER MESSAGE: You cannot sell this weapon to this person.");
return 1;
}
if(PlayerColour == TEAM_BULLY)
{
SendClientMessage(playerid, RED, "SERVER MESSAGE: You cannot sell this weapon to this person.");
return 1;
}
if(PlayerColour == TEAM_GROVE)
{
if(PlayerData[playa][groverank] != 4) return SendClientMessage(playerid, RED, "SERVER MESSAGE: You cannot sell this weapon to this person.");
}
if(PlayerColour == TEAM_SEVILLE)
{
if(PlayerData[playa][sevillerank] != 4) return SendClientMessage(playerid, RED, "SERVER MESSAGE: You cannot sell this weapon to this person.");
}
if(PlayerColour == TEAM_TEMPLE)
{
if(PlayerData[playa][templerank] != 4) return SendClientMessage(playerid, RED, "SERVER MESSAGE: You cannot sell this weapon to this person.");
}
if(PlayerColour == TEAM_CABRONES)
{
if(PlayerData[playa][cabronerank] != 4) return SendClientMessage(playerid, RED, "SERVER MESSAGE: You cannot sell this product to this person");
}
if(PlayerColour == TEAM_BALLA)
{
if(PlayerData[playa][idlewoodrank] != 4) return SendClientMessage(playerid, RED, "SERVER MESSAGE: You cannot sell this weapon to this person.");
}
if(PlayerColour == TEAM_BALLA2)
{
if(PlayerData[playa][jeffersonrank] != 4) return SendClientMessage(playerid, RED, "SERVER MESSAGE: You cannot sell this weapon to this person.");
}
if(PlayerColour == TEAM_BALLA3)
{
if(PlayerData[playa][glenparkrank] != 4) return SendClientMessage(playerid, RED, "SERVER MESSAGE: You cannot sell this weapon to this person.");
}
if(PlayerColour == TEAM_BALLA4)
{
if(PlayerData[playa][eastrank] != 4) return SendClientMessage(playerid, RED, "SERVER MESSAGE: You cannot sell this weapon to this person.");
}
if(PlayerColour == TEAM_VAGOS)
{
if(PlayerData[playa][vagosrank] !=4) return SendClientMessage(playerid, RED, "SERVER MESSAGE: You cannot sell this weapon to this person.");
}
if(PlayerColour == TEAM_AZTECAS)
{
if(PlayerData[playa][variosrank] != 4) return SendClientMessage(playerid, RED, "SERVER MESSAGE: You cannot sell this weapon to this person.");
}
if(PlayerColour == TEAM_TBALLA)
{
if(PlayerData[playa][templebrank] != 4) return SendClientMessage(playerid, RED, "SERVER MESSAGE: You cannot sell this weapon to this person.");
}
if(PlayerColour == TEAM_TRIADS)
{
if(PlayerData[playa][triadrank] != 4) return SendClientMessage(playerid, RED, "SERVER MESSAGE: You cannot sell this weapon to this person");
}
new ammo = strvalEx(tmp);
PlayerData[playerid][Bullets] = ammo;
if(ammo > ammo) return SendClientMessage(playerid,COLOR_RED,"SERVER MESSAGE: You don't have enough bullets!");
{
if(PlayerData[playerid][Gundealer] == 0)
{
//this im trying to make if your level 1 only 1-200 ammo and if your level 2 1-400// bracets are fucked at bottom
if (ammo < 1 || ammo > 200) return SendClientMessage(playerid,RED," * The ammo limits are 1-200 for a Guns!");
{
if(PlayerData[playerid][Gundealer] < 2)
{
if (ammo < 1 || ammo > 200)
{
SendClientMessage(playerid,RED," * The ammo limits are 1-200 for a Guns!");
return 1;
}
{
if(PlayerData[playerid][Gundealer] == 2)
{
if (ammo < 1 || ammo > 400)
{
SendClientMessage(playerid,RED," * The ammo limits are 1-400 for a Guns!");
return 1;
}
GivePlayerWeapon(playa,25, ammo);//otherplayer
PlayerData[playerid][Bullets] = 0;
PlayerData[playerid][Shotgun] = 0;
new pname[MAX_PLAYER_NAME], pname2[MAX_PLAYER_NAME];
GetPlayerName(otherplayer,pname,sizeof(pname));
GetPlayerName(playerid,pname2,sizeof(pname2));
format(string,sizeof(string),"%s has passed you a Shotgun with (Ammo: %d).", pname2,ammo);
SendClientMessage(otherplayer,COLOR_RED1,string);
format(string,sizeof(string),"You passed a Shotgun with (Ammo: %d) to %s.", ammo, pname);
SendClientMessage(playerid,COLOR_RED1,string);
return 1;
}
}
}
}
}
}
return 1;
}

can you boys help me? the command is not working

when i try to sell the shotgun to anyone nothing happens

its like if i didnt type the command
Reply


Messages In This Thread
command not working - by stix - 13.12.2010, 02:05
Re: command not working - by Lynn - 13.12.2010, 02:08
Re: command not working - by stix - 13.12.2010, 02:23
Re: command not working - by stix - 13.12.2010, 13:30
Re: command not working - by CyNiC - 13.12.2010, 14:38
Re: command not working - by stix - 13.12.2010, 15:13
Re: command not working - by stix - 13.12.2010, 21:51
Re: command not working - by Lynn - 13.12.2010, 21:52
Re: command not working - by stix - 13.12.2010, 21:56
Re: command not working - by XePloiT - 13.12.2010, 23:37

Forum Jump:


Users browsing this thread: 1 Guest(s)