GivePlayerWeapon with dcmd
#1

Hello, i am trying to make a /giveweapon command, but the problem is, i dont know how to catch the input from the admin after the id, i know how to catch /giveweapon <ID> but not the /giveweapon <id> <weaponid> <ammo>

this is my dcmd command:

Код:
	
 	dcmd_giveweapon(playerid, params[])
	{
	new id, n[MAX_PLAYER_NAME], on[MAX_PLAYER_NAME];
	new tmp[256],tmp2[256],tmp3[256], Index, str[49];
	tmp = strtok(params, Index), tmp2 = strtok(params,Index), tmp3 = strtok(params,Index), id = strval(tmp), weapon = strval(tmp2), ammo = strval(tmp3);
	GetPlayerName(id, on, sizeof(on));
	GetPlayerName(playerid,n,sizeof(n));
	if(PInfo[playerid][Level] < 4) return SendClientMessage(playerid, ORANGE, "You need to be level 4 to use this command!");
	if(!strlen(params)) return SendClientMessage(playerid, GREY, "USAGE: /giveweapon <ID> <weaponid> <ammo>");
	if(!IsPlayerConnected(id)) return SendClientMessage(playerid, GREY, "Invalid ID");
	format(str, sizeof(str), "%s gave weapons to %s", n, on);
	SendClientMessageToAll(ORANGE, str);
	GivePlayerWeapon(id, weapon, ammo);
	return 1;
	}
The errors that i am getting:
Код:
 error 017: undefined symbol "weapon"
 error 017: undefined symbol "ammo"
 error 017: undefined symbol "weapon"
I know its something with the
''new'' lines,


If someone could help me, Thank you in advance!
Reply


Messages In This Thread
GivePlayerWeapon with dcmd - by luckie12 - 28.03.2016, 13:57
Re: GivePlayerWeapon with dcmd - by Luis- - 28.03.2016, 14:03
Re: GivePlayerWeapon with dcmd - by luckie12 - 28.03.2016, 14:04
Re: GivePlayerWeapon with dcmd - by introzen - 28.03.2016, 14:07
Re: GivePlayerWeapon with dcmd - by luckie12 - 28.03.2016, 14:10
Re: GivePlayerWeapon with dcmd - by introzen - 28.03.2016, 14:29
Re: GivePlayerWeapon with dcmd - by luckie12 - 28.03.2016, 14:34
Re: GivePlayerWeapon with dcmd - by luckie12 - 28.03.2016, 14:40
Re: GivePlayerWeapon with dcmd - by introzen - 28.03.2016, 14:41
Re: GivePlayerWeapon with dcmd - by luckie12 - 28.03.2016, 14:55

Forum Jump:


Users browsing this thread: 1 Guest(s)