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
#2

Please upload to pastbin.
Reply
#3

http://pastebin.com/xURnCcid
Reply
#4

so can anybody help me?
Reply
#5

http://pastebin.com/tuE0tR2b
Reply
#6

Ok, thank you for your cooperation, sir.
Reply
#7

i compiled the command and it gives 6 errors :S
Reply
#8

What are the errors?
Reply
#9

C:\Users\Cristian\Downloads\samp03bsvr_R2_win32\ga memodes\lol.pwn(248 -- 250) : error 029: invalid expression, assumed zero
C:\Users\Cristian\Downloads\samp03bsvr_R2_win32\ga memodes\lol.pwn(250 -- 251) : error 029: invalid expression, assumed zero
C:\Users\Cristian\Downloads\samp03bsvr_R2_win32\ga memodes\lol.pwn(284) : error 029: invalid expression, assumed zero
C:\Users\Cristian\Downloads\samp03bsvr_R2_win32\ga memodes\lol.pwn(284) : warning 215: expression has no effect
C:\Users\Cristian\Downloads\samp03bsvr_R2_win32\ga memodes\lol.pwn(284) : warning 215: expression has no effect
C:\Users\Cristian\Downloads\samp03bsvr_R2_win32\ga memodes\lol.pwn(284) : warning 215: expression has no effect
C:\Users\Cristian\Downloads\samp03bsvr_R2_win32\ga memodes\lol.pwn(284) : warning 215: expression has no effect
C:\Users\Cristian\Downloads\samp03bsvr_R2_win32\ga memodes\lol.pwn(284) : warning 215: expression has no effect
C:\Users\Cristian\Downloads\samp03bsvr_R2_win32\ga memodes\lol.pwn(284) : warning 215: expression has no effect
C:\Users\Cristian\Downloads\samp03bsvr_R2_win32\ga memodes\lol.pwn(284) : error 001: expected token: ";", but found ":"
C:\Users\Cristian\Downloads\samp03bsvr_R2_win32\ga memodes\lol.pwn(28 : warning 225: unreachable code
C:\Users\Cristian\Downloads\samp03bsvr_R2_win32\ga memodes\lol.pwn(28 : error 014: invalid statement; not in switch
C:\Users\Cristian\Downloads\samp03bsvr_R2_win32\ga memodes\lol.pwn(28 : warning 215: expression has no effect
C:\Users\Cristian\Downloads\samp03bsvr_R2_win32\ga memodes\lol.pwn(28 : error 001: expected token: ";", but found ":"
C:\Users\Cristian\Downloads\samp03bsvr_R2_win32\ga memodes\lol.pwn(28 : error 029: invalid expression, assumed zero
C:\Users\Cristian\Downloads\samp03bsvr_R2_win32\ga memodes\lol.pwn(28 : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


8 Errors.
Reply
#10

show what are the exact lines ... http://pastebin.com/tuE0tR2b
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)