SA-MP Forums Archive
GiveWeapon - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: GiveWeapon (/showthread.php?tid=255196)



GiveWeapon - Aleluja - 14.05.2011

Hii..
I made my command /giveweapon
but i get fu**ing error..


L:\Users\Dino\Documents\Dino\SAMP\samp03csvr_R2-2_win32\gamemodes\sxrp.pwn(497) : error 010: invalid function or declaration


COMMAND:
Код:
CMD:giveweapon(playerid, params[]) {
	new
		id,
		weapon;
	if(sscanf(params, "u", id)) {

		SendClientMessage(playerid, COLOR_ORANGE, "/giveweapon [playerid]");
	}
				weapon = GetPlayerWeapon(playerid);

				switch(weapon) {
					case 16, 18, 35, 36, 37, 38, 39, 40, 44, 45, 46, 0: SendClientMessage(playerid, SPLAVA, "Invalid weapon.");
					default: {
						SetPVarInt(id,"gunID",playerid);
						SetPVarInt(playerid,"gun",weapon);
						SetPVarInt(playerid,"slot",GetWeaponSlot(weapon));
					}
				}
	    	}
	return 1;
}



Re: GiveWeapon - Joe Staff - 14.05.2011

Add 'else{' after your closing bracket on your sscanf conditional


Re: GiveWeapon - Aleluja - 14.05.2011

I don't understand u .. can u put on command?
ty..