number of arguments does not match definition
#1

Help me Guys Please to solve this problem

this is erro code

PHP код:
C:\Users\test\Desktop\WISDOM RP\Wisdom RP\gamemodes\reserve.pwn(21453) : warning 202number of arguments does not match definition
Pawn compiler 3.10.20160907              Copyright 
(c1997-2006ITB CompuPhase
Header size
:          15232 bytes
Code size
:          4287652 bytes
Data size
:          8829848 bytes
Stack
/heap size:      16384 bytesestimated maxusage=2286 cells (9144 bytes)
Total requirements:13149116 bytes
1 Warning

This is Screenshot - https://i.imgur.com/aX51hGO.png


This is original gamemode code


CMD:capture(playerid, params[])
{
if(!User[playerid][Login] || !IsAGang(playerid)) return true;
new h; gettime(h);
if(h < 11 || h > 22 ) return SendClientMessage(playerid, Wisdom_ERROR, "Использовать команду можно только с 11:00 до 23:00");
if(User[playerid][Rank] < Fraction[User[playerid][Member]][fRankMax] - 3) return SendClientMessage(playerid, Wisdom_ERROR, !"Вам недоступна данная функция.");
if(GetPVarInt(playerid, "AntiFlood") > gettime()) return SendClientMessage(playerid, Wisdom_RED, "Подождите немного.");
SetPVarInt(playerid, "AntiFlood", gettime() + 1);
if(!CaptureTime) return SendClientMessage(playerid, Wisdom_ERROR, !"В данное время захват не возможен.");
new faction = User[playerid][Member];
new isplayerinzone = 0;
if(FrakCD[faction] != 0) return SendClientMessage(playerid, Wisdom_ERROR, !"Захват территории возможен раз в час.");
for(new i = 1; i <= TOTALGZ; i++)
{
if(PlayerToKvadrat(playerid, GZInfo[i][gCoords][0], GZInfo[i][gCoords][1], GZInfo[i][gCoords][2], GZInfo[i][gCoords][3]))
{
if(GZInfo[i][gFrak] == faction) return SendClientMessage(playerid, Wisdom_ERROR, !"Вы не можете захватывать территорию своей банды.");
if(GZInfo[i][gSpawn] || GZInfo[i][gBattle]) return SendClientMessage(playerid, Wisdom_ERROR, !"Вы не можете начать захват данной территории.");
if(FrakCD[GZInfo[i][gFrak]] > 0) return SendClientMessage(playerid, Wisdom_ERROR, !"Банда уже воюет, либо недавно воевала.");
if(IsPlayerInBandOnline(faction) < 2) return SendClientMessage(playerid,Wisdom_ERROR, "В вашей банде мало игроков онлайн!");
if(IsPlayerInBandOnline(GZInfo[i][gFrak]) < 2) return SendClientMessage(playerid,Wisdom_ERROR, "У банды \"%s\" мало игроков!", Fraction[faction][fText]);
new string[120];
format(string, sizeof(string), "[F] Банда %s напала на вашу территорию. У Вас есть 2 минуты, чтобы подготовиться.", Fraction[faction][fText]);
SendFrac(GZInfo[i][gFrak], Wisdom_RED, string);
if(User[playerid][Sex] == 1) format(string, sizeof(string), "[F] %s напал на территорию банды %s. У Вас есть 2 минуты, чтобы подготовиться.", User[playerid][Name], Fraction[GZInfo[i][gFrak]][fText]);
else format(string, sizeof(string), "[F] %s напала на территорию банды %s. У Вас есть 2 минуты, чтобы подготовиться.", User[playerid][Name], Fraction[GZInfo[i][gFrak]][fText]);
SendFrac(faction, Wisdom_GREEN, string);
format(string, sizeof(string), "[capture] Банда %s напала на территорию банды %s.", Fraction[faction][fText], Fraction[GZInfo[i][gFrak]][fText]);
SendAdmin(string, COLOR_LIGHTRED);
CountOnZone[GZInfo[i][gNapad]] = 0;
CountOnZone[GZInfo[i][gFrak]] = 0;
GZInfo[i][gTime] = 120; // 120
FrakCD[GZInfo[i][gFrak]] = 3600;
FrakCD[faction] = 3600;
GZInfo[i][gNapad] = faction;
GZInfo[i][gTimer] = 600 + random(300); // 600
GZInfo[i][gBattle] = 1;
for(new idx = 0, x = 0; idx < cvector_size(players); idx++)
{
x = cvector_get(players, idx);
if(!User[x][Login]) continue;
ShowGZ(x);
if(User[x][Member] == GZInfo[i][gNapad] || User[x][Member] == GZInfo[i][gFrak]) TextDrawShowForPlayer(x, CaptureInfo[User[x][Member]]);
}
isplayerinzone = 1;
break;
}
}
if(!isplayerinzone) return SendClientMessage(playerid, Wisdom_ERROR, !"Вы должны находиться на территории, которую хотите захватить.");
return true;
}



___________________________

Help me Please this is importent part for my project, thanks
Reply
#2

On which line are you getting that warning?

use [pawn]"code here"[ /pawn] to post code
Reply
#3

Quote:
Originally Posted by ReD_HunTeR
Посмотреть сообщение
On which line are you getting that warning?

use [pawn]"code here"[ /pawn] to post code
pawn Код:
if(IsPlayerInBandOnline(GZInfo[i][gFrak]) < 2) return SendClientMessage(playerid,Wisdom_ERROR, "У банды \"%s\" мало игроков!", Fraction[faction][fText]);
Reply
#4

You cannot format messages in SendClientMessage so that is why you are getting that warning

Use format instead, like this

pawn Код:
new string[120];
if(IsPlayerInBandOnline(GZInfo[i][gFrak]) < 2)
{
    format(string, sizeof(string), "У банды \"%s\" мало игроков!", Fraction[faction][fText]);
    return SendClientMessage(playerid, Wisdom_ERROR, string);
}
Reply
#5

Pawn compiler 3.10.20160907 Copyright © 1997-2006, ITB CompuPhase

Header size: 15232 bytes
Code size: 4287704 bytes
Data size: 8829848 bytes
Stack/heap size: 16384 bytes; estimated max. usage=2286 cells (9144 bytes)
Total requirements:13149168 bytes

Done.


-

Cool Bro! You Rock! Thanks a lot! +rep 1
Reply
#6

Quote:
Originally Posted by Dainteresebuli
Посмотреть сообщение
pawn Код:
if(IsPlayerInBandOnline(GZInfo[i][gFrak]) < 2) return SendClientMessage(playerid,Wisdom_ERROR, "У банды \"%s\" мало игроков!", Fraction[faction][fText]);
You can't use SendClientMessage with this parameters.

SendClientMessage is used as follows:

Код:
SendClientMessage(playerid, color, your_text);
If you want to format a string directly without using a code like: (code that applies to you, for this error):
pawn Код:
new string[128];
format(string, sizeof string, "У банды \"%s\" мало игроков!", Fraction[faction][fText]);
SendClientMessage(playerid, Wisdom_ERROR, string);
You need y_va to do this directly, just in a line.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)