SA-MP Forums Archive
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: number of arguments does not match definition (/showthread.php?tid=440333)



number of arguments does not match definition - lilt074life - 29.05.2013

Hello when I try to compile I get this errors:
pawn Код:
C:\Users\Mohamad\Desktop\San Andreas Roleplay\gamemodes\rlgrp.pwn(48952) : warning 202: number of arguments does not match definition
C:\Users\Mohamad\Desktop\San Andreas Roleplay\gamemodes\rlgrp.pwn(48952) : warning 202: number of arguments does not match definition
C:\Users\Mohamad\Desktop\San Andreas Roleplay\gamemodes\rlgrp.pwn(48952) : warning 202: number of arguments does not match definition
I got in this line:
pawn Код:
KickWithMessage2(giveplayerid, COLOR_LIGHTRED, "AdmCmd: %s was kicked by %s, reason: %s", giveplayer, sendername, (result));
and the KickWithMessage2 stock is:
pawn Код:
stock KickWithMessage2(playerid, color, message[])
{
    SendClientMessageToAll(color, message);
    SetTimerEx("KickPublic2", 1000, 0, "d", playerid);
}



Re: number of arguments does not match definition - Konewka - 29.05.2013

You used arguments in KickWithMessage2 that are not defined in your stock. In order to insert a formated string use format function.

pawn Код:
new string[103];
format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s", giveplayer, sendername, (result));

KickWithMessage2(giveplayerid, COLOR_LIGHTRED, string);



Re: number of arguments does not match definition - lilt074life - 29.05.2013

thx bro