Some strange bug - 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: Some strange bug (
/showthread.php?tid=124875)
Some strange bug -
VonLeeuwen - 01.02.2010
Hey guys,
I made an 'announce' command, so that when an admin types '/announce hi' the chat will say: "ADMIN ANNOUNCEMENT: hi", but it only shows "ADMIN ANNOUNCEMENT:" at the moment..
Here's my script:
Код:
if(strcmp(cmd, "/announce", true) == 0)
{
if(adminlevel[playerid] <= 1)
{
SendClientMessage(playerid,COLOR_RED,"You need to be at least admin level 2 to use this command!");
return 0;
}
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_YELLOW,"USAGE: /announce [message]");
return 1;
}
new message[150],message1;
message1 = strval(tmp);
{
format(message,sizeof(message),"ADMIN ANNOUNCEMENT: %s", message1);
SendClientMessageToAll(COLOR_RED,message);
}
return 1;
}
Thanks if you can help me
Re: Some strange bug -
actiwe - 01.02.2010
pawn Код:
if(strcmp(cmd, "/announce", true) == 0)
{
if(adminlevel[playerid] <= 1)
{
SendClientMessage(playerid,COLOR_RED,"You need to be at least admin level 2 to use this command!");
return 0;
}
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_YELLOW,"USAGE: /announce [message]");
return 1;
}
new message[128],message1;
message1 = strlen(tmp);
{
format(message,sizeof(message),"ADMIN ANNOUNCEMENT: %s", message1);
SendClientMessageToAll(COLOR_RED,message);
}
return 1;
}
Try but I'm not sure that it works
Re: Some strange bug -
VonLeeuwen - 01.02.2010
That doesn't work either - Same problem.
Re: Some strange bug -
¤Adas¤ - 01.02.2010
Lames...
pawn Код:
if(strcmp(cmd, "/announce", true) == 0)
{
if(adminlevel[playerid] <= 1)
{
SendClientMessage(playerid,COLOR_RED,"You need to be at least admin level 2 to use this command!");
return 0;
}
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_YELLOW,"USAGE: /announce [message]");
return 1;
}
new message[128];
{
format(message,sizeof(message),"ADMIN ANNOUNCEMENT: %s", tmp);
SendClientMessageToAll(COLOR_RED,message);
}
return 1;
}
Re: Some strange bug -
VonLeeuwen - 01.02.2010
Thank you