Got a little problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Got a little problem (
/showthread.php?tid=226410)
Got a little problem -
Libra_PL - 15.02.2011
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
Re: Got a little problem -
Libra_PL - 15.02.2011
Little *bump*
Re: Got a little problem -
blackwave - 15.02.2011
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:
Re: Got a little problem -
Libra_PL - 15.02.2011
Oh, my fail. I had number 5, not 3

But have a beer!