PDA

View Full Version : how to fix "number of arguments does not match definition"


ongnung147
27/03/2017, 12:37 PM
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;
}

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;
}

TYDS
27/03/2017, 12:45 PM
why you don't use zcmd ?

ongnung147
27/03/2017, 12:50 PM
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

ikkentim
27/03/2017, 02:03 PM
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.

Toroi
27/03/2017, 02:53 PM
if(!strlen(tmp,userid,level,ngay))

http://wiki.sa-mp.com/wiki/Strlen