Help with CMD
#1

Hey, I recently put a radio CMD into my script and it keeps on saying 'warning 202: number of arguments does not match definition' here is the script:
CMD:radio(playerid, params[])
{
new string[128];
if(isnull(params)) return SendClientMessage(playerid, WHITE, "USAGE: /r(adio) [message]");

new
rank[64];
switch (PlayerVar[playerid][pLSPD])
{
case 1:
{
switch(PlayerVar[playerid][pFactionRank])
{
case 1: rank = "Cadet";
case 2: rank = "Officer";
case 3: rank = "Corporal";
case 4: rank = "Sergeant";
case 5: rank = "Captain";
case 6: rank = "Chief";
default: rank = "Trainee";
}
format(string, sizeof(string), "[Radio] %s %s: %s, over", rank, GetPlayerName(playerid), params);
SendLSPDMessage(LSPD, string);
}
default:
{
SendClientMessage(playerid, WHITE, "You are not in the LSPD");
return 1;
}
}
format(string, sizeof(string), "(RADIO): %s", params);
SetPlayerChatBubble(playerid, string, WHITE, 15.0, 5000);
return 1;
}
It gets the error here: format(string, sizeof(string), "[Radio] %s %s: %s, over", rank, GetPlayerName(playerid), params);
SendLSPDMessage(LSPD, string);

Please help.
Reply
#2

what is the line 202?
Reply
#3

format(string, sizeof(string), "[Radio] %s %s: %s, over", rank, GetPlayerName(playerid), params);
SendLSPDMessage(LSPD, string);
Reply
#4

Try To change
Код:
default:
To
Код:
return 1;
or
Код:
default;
Reply
#5

pawn Код:
format(string, sizeof(string), "[Radio] %d %s: %s, over", rank, GetPlayerName(playerid), params);
SendLSPDMessage(LSPD, string);
Reply
#6

I got loads more errors when I did that.
Reply
#7

SendLSPDMessage(LSPD, COLOR_WHITE, string); try this
Reply
#8

Its only with this code:
Код:
format(string, sizeof(string), "[Radio] %s %s: %s, over", rank, GetPlayerName(playerid), params);
Reply
#9

Try This

PHP код:
format(stringsizeof(string), "[Radio] %s %s: %s, over"rankGetPlayerName(playeridparams); 
Reply
#10

Everything is fine except the line "SendLSPDMessage(LSPD, string);".

Can you show us the stock part of it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)