Announce command?
#1

Hello,

Im trying to make a announce command wich broadcast a gametext for player,
And im using ZCMD, i tried using a string and using params,
That works ingame but it does the command as it should AND sends Server:Unknown Command,
And it dosent let me do spaces, How would i make it let me do spaces?
For example:

/announce Hello im joe

Ingame:

Hello im joe,

Reply
#2

well try this ?? :

Код:
dcmd_announce(playerid,params[]) {
  if(IsPlayerAdmin(playerid)) {
  	if(!strlen(params)) return SendClientMessage(playerid,red,"USAGE: /announce <text>");
		return GameTextForAll(params,4000,3);
  } else return SendClientMessage(playerid,red,"ERROR: You Aren't Rcon Admin");
}
Reply
#3

Tried it, Still says Unknown command, But does the message, And if i add another space it says unknwon command and dus nothing
Reply
#4

weird it works in my server normally but did u forget to add something like :
Код:
dcmd(announce,8,cmdtext);
?
?
because it works perfectly in my server
Reply
#5

Hehe,
Quote:
Originally Posted by Joe Torran C
And im using ZCMD,
Reply
#6

heres my announce command works fine for me


COMMAND:announce(playerid,params[])
{
if(announce == 1) return SendClientMessage(playerid,orange,"Error: An announcement message is already on screen.");
if (level[playerid] >= 1)
{
new result[128], idx, string[128];
result = bigstrtok(params, idx);
if(!strlen(result))
{
SendClientMessage(playerid, orange, "Error: /announce message");
SendClientMessage(playerid, orange, "This will announce a message to all players!");
return 1;
}
announce = 1;
format(string, sizeof(string), "[Admin]: %s", result);
Announce0 = TextDrawCreate(1.000000,310.000000,string);
Announce1 = TextDrawCreate(73.000000,311.000000," ");
TextDrawUseBox(Announce1,1);
TextDrawBoxColor(Announce1,0x0000ffff);
TextDrawTextSize(Announce1,0.000000,3.000000);
TextDrawAlignment(Announce0,0);
TextDrawAlignment(Announce1,0);
TextDrawBackgroundColor(Announce0,0x000000ff);
TextDrawBackgroundColor(Announce1,0x000000ff);
TextDrawFont(Announce0,3);
TextDrawLetterSize(Announce0,0.499999,1.400000);
TextDrawFont(Announce1,3);
TextDrawLetterSize(Announce1,1.000000,1.000000);
TextDrawColor(Announce0,0xff0000ff);
TextDrawColor(Announce1,0xffffffff);
TextDrawSetOutline(Announce0,1);
TextDrawSetOutline(Announce1,1);
TextDrawSetProportional(Announce0,1);
TextDrawSetProportional(Announce1,1);
TextDrawSetShadow(Announce0,1);
TextDrawSetShadow(Announce1,1);
TextDrawShowForAll(Announce0);
SetTimer("AnnounceTimer", 5000, false);
SendClientMessageToAll(dpink, string);
print(string);
new File:ftw=fopen("logs/admin.txt", io_append);
new string1[128];
format(string1, 150, "%s\r\n", string);
fwrite(ftw, string1);
fclose(ftw);
}
else SendClientMessage(playerid, red, "Error: You are either not a admin or you are not a admin with the correct level.");
return 1;
}
Reply
#7

sorry i couldn't help but i gave the command which on my server and it works , maybe there is something wrong , i hope anyone can help u
Reply
#8

Lol i forgot to compile Lol works now ty
Reply
#9

lol xD happens , NP
Reply
#10

can someone make this in *if* format thanks ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)