Help !
#1

I was makin a admin command /giveweapon [WeaponID] [Ammo]

But whenever I try to compile it 1 error appears

error
Код:
(765) : error 035: argument type mismatch (argument 1)
the 765 line:
Код:
if(sscanf(params,"uii", id, weapid, ammo))
help me pls
Reply
#2

Could you show the whole command please?
Reply
#3

Код:
COMMAND:giveweapon(playerid, params)
{
	new id,weaponid, ammo, msg[128], name1[MAX_PLAYER_NAME];
	if(sscanf(params,"uii", id, weaponid, ammo)) return SCM(PID, -1, "Usage: /giveweapon [ID] [WeaponId] [Ammo]");
	if(PlayerInfo[playerid][pAdmin] < 4) return SCM(PID, COLOR_RED, "You must be level 4 admin!");
	if(PlayerInfo[playerid][pAdmin] == 0) return SCM(PID, COLOR_RED,"You are not allowed to use this command!");
	if(id == INVALID_PLAYER_ID) return SCM(PID, COLOR_RED, "That Player is not connected");
	{
	    GivePlayerWeapon(id, weaponid, ammo);
	    GPN(PID, name1, sizeof(name1));
	    format(msg, sizeof(msg),"Admin %s gave you gun! ammo: %d", name1, ammo);
	    SCM(id, COLOR_YELLOW, msg);
	}
	return 1;
}
Reply
#4

Oh I see error now, I fixed problem !
Reply
#5

PHP код:
if(sscanf(params,"uii"idweaponidammo)) return SCM(playerid, -1"Usage: /giveweapon [ID] [WeaponId] [Ammo]"); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)