My CMD remains unknown
#1

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;
}
Reply
#2

Show us the warnings.
Reply
#3

Код:
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.
Reply
#4

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;
Reply
#5

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:
pawn Код:
#pragma unused params
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.
Reply
#6

up to new string[128];
add #pragma unused params
Reply
#7

@ 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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)