My CMD remains unknown -
Sojo12 - 05.03.2014
I recently coded an ANNOUNCEMENT Command for my Server it gave me no errors nothing ecept some warnings which are not from the code either.But when i type the command in serverit says unknown.Could you please help me.I use dcmd!
Here is the code:
Код:
dcmd_announcement(playerid,params[])
{
new string[128];
if(!strlen(params))
{
SendClientMessage(playerid, -1,"{FF0099}[ADMIN]{FFFFFF} /announcement [TEXT]");
return 1;
}
if(IsSpawned[playerid] == 0)
{
SendClientMessage(playerid, -1,"{FF0000}[ERROR]{FFFFFF}You must be spawned in order to be able to use this command.");
return 1;
}
format(string,sizeof(string),"{FF0000}[ANNOUNCEMENT]{FFFFFF}: %s.",PlayerName(playerid),playerid,params);
SendClientMessageToAll(COLOR_ERROR,string);
return 1;
}
Re: My CMD remains unknown -
]Rafaellos[ - 05.03.2014
Show us the warnings.
Re: My CMD remains unknown -
Sojo12 - 05.03.2014
Код:
C:\Users\HACK IF YOU CAN\Desktop\NEW\FunGaming Stunt-Freeroam\gamemodes\SFCRRPG.pwn(5420) : warning 203: symbol is never used: "params"
C:\Users\HACK IF YOU CAN\Desktop\NEW\FunGaming Stunt-Freeroam\gamemodes\SFCRRPG.pwn(5426) : warning 203: symbol is never used: "params"
C:\Users\HACK IF YOU CAN\Desktop\NEW\FunGaming Stunt-Freeroam\gamemodes\SFCRRPG.pwn(12981) : warning 203: symbol is never used: "udb_RenameUser"
C:\Users\HACK IF YOU CAN\Desktop\NEW\FunGaming Stunt-Freeroam\gamemodes\SFCRRPG.pwn(14573) : warning 202: number of arguments does not match definition
C:\Users\HACK IF YOU CAN\Desktop\NEW\FunGaming Stunt-Freeroam\gamemodes\SFCRRPG.pwn(14580) : warning 202: number of arguments does not match definition
C:\Users\HACK IF YOU CAN\Desktop\NEW\FunGaming Stunt-Freeroam\gamemodes\SFCRRPG.pwn(14603) : warning 202: number of arguments does not match definition
C:\Users\HACK IF YOU CAN\Desktop\NEW\FunGaming Stunt-Freeroam\gamemodes\SFCRRPG.pwn(14610) : warning 202: number of arguments does not match definition
C:\Users\HACK IF YOU CAN\Desktop\NEW\FunGaming Stunt-Freeroam\gamemodes\SFCRRPG.pwn(16805) : warning 203: symbol is never used: "gameday"
C:\Users\HACK IF YOU CAN\Desktop\NEW\FunGaming Stunt-Freeroam\gamemodes\SFCRRPG.pwn(16805) : warning 203: symbol is never used: "gameweek"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
9 Warnings.
Re: My CMD remains unknown -
Avi Raj - 05.03.2014
CTRL+F and delete all the defines which have :- "gameday - gameweek - udb_RenameUser - params"
defines here means like :-
pawn Код:
new gameday;
new gameweek;
new params;
Re: My CMD remains unknown -
Konstantinos - 05.03.2014
pawn Код:
format(string,sizeof(string),"{FF0000}[ANNOUNCEMENT]{FFFFFF}: %s.",PlayerName(playerid),playerid,params);
1 placeholder and 3 arguments, they do not match. An example of the other 2 placeholders would be:
pawn Код:
format(string,sizeof(string),"{FF0000}[ANNOUNCEMENT]{FFFFFF}: %s (%d): %s.",PlayerName(playerid),playerid,params);
About the warnings, in the line 5420 and 5426 (assuming those are from commands) use:
inside the commands that do not use params.
About the warnings number of arguments does not match, post those 4 lines.
Last about the unknown command, it could be because of more than 1 command processor.
Quote:
Originally Posted by iThePunisher
up to new string[128];
add #pragma unused params
|
He uses params at the strlen check.
Re: My CMD remains unknown -
iThePunisher - 05.03.2014
up to new string[128];
add #pragma unused params
Re: My CMD remains unknown -
Sojo12 - 05.03.2014
@ Konstantinos thanks it worked now!
Off Topic:Konstantinos i can't PM you here.I'm trying to create a Text above an ADMIN who is on duty.Could you please help me?
Text:Admin On Duty!