help with /giveweapon command
#6

Quote:
Originally Posted by mrcoolballs
Посмотреть сообщение
okay guys sorry for the double post but i solved it myself, and help from kyosaur heres the finished code it works great:

Код:
CMD:giveweapon(playerid, params[])
{
    if(Logged[playerid] == 0) return SendClientMessage(playerid,0xFF0000FF,"You are not logged in!");
	if(PlayerInfo[playerid][Level] < 4) return SendClientMessage(playerid,0xFF0000FF,"You have to be Level 4 to use this command!!");
	
	new id, weap[128], ammo;
	
	if(sscanf(params, "us[35]i",id, weap, ammo))
	{
	    SendClientMessage(playerid, 0xFF0000FF, "Usage: /giveweapon [ID] [WEAPON] [AMMO]");
		return 1;
	}
	if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: That player is not connected!");
	GivePlayerWeapon(id,GetWeaponIDFromName(weap),ammo);
	return 1;
 }
Why are you doing stuff like [128] and [35] in sscanf? delete that.
Reply


Messages In This Thread
help with /giveweapon command - by mrcoolballs - 24.08.2010, 08:48
Re: help with /giveweapon command - by Voldemort - 24.08.2010, 08:53
Re: help with /giveweapon command - by Kyosaur - 24.08.2010, 08:55
Re: help with /giveweapon command - by mrcoolballs - 24.08.2010, 08:58
Re: help with /giveweapon command - by mrcoolballs - 24.08.2010, 09:09
Re: help with /giveweapon command - by WackoX - 24.08.2010, 09:13
Re: help with /giveweapon command - by Kyosaur - 24.08.2010, 09:19
Re: help with /giveweapon command - by mrcoolballs - 24.08.2010, 09:24
Re: help with /giveweapon command - by Kyosaur - 24.08.2010, 09:42

Forum Jump:


Users browsing this thread: 1 Guest(s)