SA-MP Forums Archive
how to fix "number of arguments does not match definition" - 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)
+--- Thread: how to fix "number of arguments does not match definition" (/showthread.php?tid=631345)



how to fix "number of arguments does not match definition" - ongnung147 - 27.03.2017

Код HTML:
if(strcmp(cmd, "/makevip", true) == 0)
	{
		if(Player[playerid][pBlockAd] == 1) return SendClientMessage(playerid,COLOR_RED,""System": Ban da bi cam dung lenh nay");
    	if(Player[playerid][pAdmin] < 3) return SendClientMessage(playerid,COLOR_RED,""System": Ban khong du quyen luc de thuc hien cau lenh nay, ban phai la mot Admin");
		new userid,level,ngay[128];
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp,userid,level,ngay)) return SendClientMessage(playerid,COLOR_RED,""System"/makeadmin [playerid] [level]");
		if(userid == INVALID_PLAYER_ID || (IsPlayerConnected(userid) && Login[userid] == false))return SendClientMessage(playerid,COLOR_RED,"Sai ID");
		if(Player[userid][pAdmin] > Player[playerid][pAdmin]) return SendClientMessage(playerid,COLOR_RED,"Ban khong the Ban nguoi nay");
		Player[userid][pAdmin] = level;
		new str[128];
		format(str,sizeof(str),"Administrator [%s] da make %s len Admin level %d",GetName(playerid),GetName(userid),level);
		WriteLog("Makevip",string);
		SAM(COLOR_YELLOW,str,1);
		return 1;
	}
Код HTML:
stock MakeVip(playerid,level,ngay)
{
	if(level > 3) return 1;
	new str[128];
	if(Player[playerid][pVIP] == level)
	{
	Player[playerid][pVIPCount] += ngay*86400;
	format(str,sizeof(str),"Ban da duoc cong them thoi gian %s la %d ngay",GetVipType(level),ngay);
	}
	else
	{
	Player[playerid][pVIP] = level;
	Player[playerid][pVIPCount] = ngay*86400;
	format(str,sizeof(str),"* Ban da nhan duoc vip %s %d ngay",GetVipType(level),ngay);
	}
	SAM(playerid,COLOR_RED,string,1);
	return 1;
}



Re: how to fix "number of arguments does not match definition" - TYDS - 27.03.2017

why you don't use zcmd ?


Re: how to fix "number of arguments does not match definition" - ongnung147 - 27.03.2017

C:\Documents and Settings\Admin\Desktop\123\gamemodes\dayz.pwn(3439 ) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Admin\Desktop\123\gamemodes\dayz.pwn(3439 ) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Admin\Desktop\123\gamemodes\dayz.pwn(3439 ) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Admin\Desktop\123\gamemodes\dayz.pwn(3440 ) : warning 213: tag mismatch


Re: how to fix "number of arguments does not match definition" - ikkentim - 27.03.2017

Quote:
Originally Posted by ongnung147
Посмотреть сообщение
C:\Documents and Settings\Admin\Desktop\123\gamemodes\dayz.pwn(3439 ) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Admin\Desktop\123\gamemodes\dayz.pwn(3439 ) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Admin\Desktop\123\gamemodes\dayz.pwn(3439 ) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Admin\Desktop\123\gamemodes\dayz.pwn(3440 ) : warning 213: tag mismatch
Would be useful if you could tell what line is 3439. At any rate, look at the arguments you pass in the the methods you call on that line. Like the warning says, the number of arguments in the call don't match the number of arguments in the definition. You are likely missing an argument or two, or else you may have misplaced some parenthesis.


Re: how to fix "number of arguments does not match definition" - Toroi - 27.03.2017

PHP код:
if(!strlen(tmp,userid,level,ngay)) 
https://sampwiki.blast.hk/wiki/Strlen