SA-MP Forums Archive
/emotion. - 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: /emotion. (/showthread.php?tid=249128)



/emotion. - davelord - 17.04.2011

Hey, can someone give me a /me command? With a stock so it sends the message only to people in a certain radius.


Re: /emotion. - Vince - 17.04.2011

For god sake, SEARCH! There are hundreds of roleplay scripts, each with a /me command.


Re: /emotion. - Stigg - 17.04.2011

Quote:
Originally Posted by davelord
View Post
Hey, can someone give me a /me command? With a stock so it sends the message only to people in a certain radius.
Why the second thread. You have already been answered here:

http://forum.sa-mp.com/showthread.ph...=%2Fme+command


Re: /emotion. - davelord - 17.04.2011

Quote:

C:\Users\Mijn pc\Desktop\NYC\gamemodes\LOCALCHAT.pwn(156) : error 017: undefined symbol "cmd"
C:\Users\Mijn pc\Desktop\NYC\gamemodes\LOCALCHAT.pwn(160) : error 017: undefined symbol "gPlayerLogged"
C:\Users\Mijn pc\Desktop\NYC\gamemodes\LOCALCHAT.pwn(160) : warning 215: expression has no effect
C:\Users\Mijn pc\Desktop\NYC\gamemodes\LOCALCHAT.pwn(160) : error 001: expected token: ";", but found "]"
C:\Users\Mijn pc\Desktop\NYC\gamemodes\LOCALCHAT.pwn(160) : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\NYC\gamemodes\LOCALCHAT.pwn(160) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.

Line 160: GetPlayerName(playerid, sendername, sizeof(sendername));


Re: /emotion. - iJumbo - 17.04.2011

Show Full command please


Re: /emotion. - davelord - 17.04.2011

Here. EDIT: took it out the Godfather.
Quote:

//----------------------------------[Emote]-----------------------------------------------
if(strcmp(cmd, "/me", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /me [action]");
return 1;
}
format(string, sizeof(string), "* %s %s", sendername, result);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
printf("%s", string);
}
return 1;
}




Re: /emotion. - iJumbo - 17.04.2011

Have you some command processor (es: zcmd) ?


Re: /emotion. - davelord - 17.04.2011

Nope.


Re: /emotion. - iJumbo - 17.04.2011

Install dcmd
https://sampwiki.blast.hk/wiki/Fast_Commands


and try this
put under OnPlayerCommandText

dcmd(me,2,cmdtext);

pawn Code:
dcmd_me(playerid,params[])
{
    if(!strlen(params)) return SendClientMessage(playerid, RED, "USAGE: /me [action]");
    new string[128],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string,sizeof(string),"* %s %s",name,params);
    print(string);
    return ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
}



Re: /emotion. - davelord - 17.04.2011

Got this..
Quote:

C:\Users\Mijn pc\Desktop\NYC\gamemodes\LOCALCHAT.pwn(222) : error 017: undefined symbol "dcmd_me"
C:\Users\Mijn pc\Desktop\NYC\gamemodes\LOCALCHAT.pwn(224) : error 017: undefined symbol "dcmd_me"
C:\Users\Mijn pc\Desktop\NYC\gamemodes\LOCALCHAT.pwn(226) : error 017: undefined symbol "params"
C:\Users\Mijn pc\Desktop\NYC\gamemodes\LOCALCHAT.pwn(226) : error 017: undefined symbol "RED"
C:\Users\Mijn pc\Desktop\NYC\gamemodes\LOCALCHAT.pwn(229) : error 017: undefined symbol "params"
C:\Users\Mijn pc\Desktop\NYC\gamemodes\LOCALCHAT.pwn(231) : error 017: undefined symbol "COLOR_PURPL"
C:\Users\Mijn pc\Desktop\NYC\gamemodes\LOCALCHAT.pwn(231) : error 017: undefined symbol "E"
C:\Users\Mijn pc\Desktop\NYC\gamemodes\LOCALCHAT.pwn(231) : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\NYC\gamemodes\LOCALCHAT.pwn(231) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


9 Errors.