Number of arguments does not match definition
#1

Hey there.
Maybe I'm just really tired, but I can't seem to work out what all these warnings are about.
Apologies if it's obvious, it's 4:45am here.
Код:
C:\Users\Jack\Desktop\CLRPSCRIPT\gamemodes\CLRP.pwn(40858) : warning 202: number of arguments does not match definition
C:\Users\Jack\Desktop\CLRPSCRIPT\gamemodes\CLRP.pwn(40858) : warning 202: number of arguments does not match definition
C:\Users\Jack\Desktop\CLRPSCRIPT\gamemodes\CLRP.pwn(40862) : warning 202: number of arguments does not match definition
C:\Users\Jack\Desktop\CLRPSCRIPT\gamemodes\CLRP.pwn(40862) : warning 202: number of arguments does not match definition
C:\Users\Jack\Desktop\CLRPSCRIPT\gamemodes\CLRP.pwn(40867) : warning 202: number of arguments does not match definition
C:\Users\Jack\Desktop\CLRPSCRIPT\gamemodes\CLRP.pwn(40867) : warning 202: number of arguments does not match definition
C:\Users\Jack\Desktop\CLRPSCRIPT\gamemodes\CLRP.pwn(40871) : warning 202: number of arguments does not match definition
C:\Users\Jack\Desktop\CLRPSCRIPT\gamemodes\CLRP.pwn(40871) : warning 202: number of arguments does not match definition
C:\Users\Jack\Desktop\CLRPSCRIPT\gamemodes\CLRP.pwn(40876) : warning 202: number of arguments does not match definition
C:\Users\Jack\Desktop\CLRPSCRIPT\gamemodes\CLRP.pwn(40876) : warning 202: number of arguments does not match definition
C:\Users\Jack\Desktop\CLRPSCRIPT\gamemodes\CLRP.pwn(40880) : warning 202: number of arguments does not match definition
C:\Users\Jack\Desktop\CLRPSCRIPT\gamemodes\CLRP.pwn(40880) : warning 202: number of arguments does not match definition
The command I'm trying to make:
Код:
CMD:shopgun(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 1338 && PlayerInfo[playerid][pShopTech] == 1)
	{
	    new string[256], giveplayerid, weaponid, vipwepslot;
	    if(sscanf(params, "udd", giveplayerid, weaponid, vipwepslot)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /shopgun [playerid] [weapon] [vipweaponslot]");
	    
	 	if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "That player is not online!");
		if(weaponid < 1 || weaponid > 34) return SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot give players weapons above weapon id 34 or below 1.");
		if(vipwepslot < 1 || vipwepslot > 3) return SendClientMessageEx(playerid, COLOR_GRAD1, "Valid VIP Weapon slots are 1, 2 and 3.");
		
		switch(vipwepslot)
		{
		    case 1:
		    {
          		format(string, sizeof(string), "Customer Service Representative %s has given you a %s in weapon slot 1.", GetPlayerNameEx(playerid), GetWeaponName(weaponid));
		        SendClientMessageEx(giveplayerid, COLOR_YELLOW, string);
		        PlayerInfo[giveplayerid][pVipWep1] = weaponid;
		        GivePlayerWeapon(giveplayerid, weaponid, 9999);
		        format(string, sizeof(string), "AdmCmd: Customer Service Rep %s has given %s a %s!", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetWeaponName(weaponid));
		        SendAdminMessage(COLOR_YELLOW, string);
		    }
		    case 2:
		    {
      			format(string, sizeof(string), "Customer Service Representative %s has given you a %s in weapon slot 2.", GetPlayerNameEx(playerid), GetWeaponName(weaponid));
		        SendClientMessageEx(giveplayerid, COLOR_YELLOW, string);
		        PlayerInfo[giveplayerid][pVipWep2] = weaponid;
		        GivePlayerWeapon(giveplayerid, weaponid, 9999);
		        format(string, sizeof(string), "AdmCmd: Customer Service Rep %s has given %s a %s!", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetWeaponName(weaponid));
		        SendAdminMessage(COLOR_YELLOW, string);
		    }
		    case 3:
		    {
   		 		format(string, sizeof(string), "Customer Service Representative %s has given you a %s in weapon slot 3.", GetPlayerNameEx(playerid), GetWeaponName(weaponid));
		        SendClientMessageEx(giveplayerid, COLOR_YELLOW, string);
		        PlayerInfo[giveplayerid][pVipWep1] = weaponid;
		        GivePlayerWeapon(giveplayerid, weaponid, 9999);
		        format(string, sizeof(string), "AdmCmd: Customer Service Rep %s has given %s a %s!", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetWeaponName(weaponid));
		        SendAdminMessage(COLOR_YELLOW, string);
		    }
		    
		}
	 	
	}
	else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use this command!");
	return 1;
}
Reply
#2

Which line is 40858?
Reply
#3

It's just a blank line in the script...
EDIT: I am tired.. It's this one,
Код:
format(string, sizeof(string), "Customer Service Representative %s has given you a %s in weapon slot 1.", GetPlayerNameEx(playerid), GetWeaponName(weaponid));
Reply
#4

You did wrong in GetWeaponName, https://sampwiki.blast.hk/wiki/GetWeaponName
Reply
#5

Ah, all fixed, thank you very much Zex Tan! Sleepy time for me!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)