Command issue
#1

I was trying to make a /me command, but it doesn't work, no warnings, when I type /me and the message nothing happens, what I want is that players that in a close Radius of a guy who is about to say something on /me would be able to see it, can you check the script and correct, I don't want that to be Global to the whole server.
PHP код:
new cmd[256],idx;
    new 
tmp[256];
    
cmd strtok(cmdtext,idx);
 if(
strcmp(cmd,"/Me",true)==0)
{
new 
string[256];
new 
name[24];
new 
Players LimitGlobalChatRadius(10);
tmp strrest(cmdtext,idx);
if(!
strlen(tmp)) return SendClientMessage(playerid,0xFF66FFAA," /Me [Text]");
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string)," [Me] %s : %s",name,tmp);
SendClientMessage(Players,0xFFFF00AA,string);
 return 
1;

And this placed in the bottom of the script :
PHP код:
public OnPlayerClickPlayer(playeridclickedplayeridsource)
{
    return 
1;
}
stock strrest(const string[],index)
{
    new 
length strlen(string),offset index,result[256];
    while((
index length) && ((index offset) < (sizeof(result) - 1)) && (string[index] > '\r')) result[index offset] = string[index],index++;
    
result[index offset] = EOS;
    if(
result[0] == ' ' && string[0] != ' 'strdel(result,0,1);
    return 
result;

Reply


Messages In This Thread
Command issue - by Scriptissue - 28.09.2010, 11:57
Re: Command issue - by Voldemort - 28.09.2010, 12:02
Re: Command issue - by DarkPower - 28.09.2010, 12:11
Re: Command issue - by mmrk - 28.09.2010, 12:16
Re: Command issue - by Scriptissue - 28.09.2010, 13:17
Re: Command issue - by <Weponz> - 28.09.2010, 13:42
Re: Command issue - by Scriptissue - 28.09.2010, 15:39
Re: Command issue - by Scenario - 28.09.2010, 16:01
Re: Command issue - by Scriptissue - 29.09.2010, 07:35
Re: Command issue - by samgreen - 29.09.2010, 07:42

Forum Jump:


Users browsing this thread: 1 Guest(s)