Got a little problem
#1

Hello. I need help again, this time about two commands. Command /announce works, but /say doesn't (it says SERVER: Unknown Command.) Here's the script:

Код:
dcmd_say(playerid,params[]) {
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, red, "ERROR: You must to be an admin before using this command!");
	if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /say [text]");
	new string[128]; format(string,sizeof(string),"[Admin %s]: %s", GetName(playerid),params);
	SendClientMessageToAll(red,string);
	return 1;
}

dcmd_announce(playerid,params[]) {
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, red, "ERROR: You must to be an admin before using this command!");
   	if(!strlen(params)) return SendClientMessage(playerid,red,"USAGE: /announce [text]");
   	new string[128]; format(string,sizeof(string),"Admin %s has announced text \"%s\"!",GetName(playerid),params);
	SendMessageToAdmins(red,string);
	GameTextForAll(params,10000,3);
	return 1;
}
Announce command works perfectly, looks like the same like command /say. But when I type "/say" it says SERVER: Unknown Command. If I type "/say text", it says "This command you entered is unknown! Type /cmds for a list of commands!" (I used a tutorial to prevent SERVER: Unknown Command message). Could anyone help me and fix it? Beer waits
Reply
#2

Little *bump*
Reply
#3

pawn Код:
dcmd_say(playerid,params[]) {
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, red, "ERROR: You must to be an admin before using this command!");
    if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /say [text]");
    new string[128]; format(string,sizeof(string),"[Admin %s]: %s", GetName(playerid),params[2]);
    SendClientMessageToAll(red,string);
    return 1;
}
If you forgot, on OnPlayerCommandText:
pawn Код:
dcmd(say,3,cmdtext);
Reply
#4

Oh, my fail. I had number 5, not 3 But have a beer!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)