/me command
#1

Help me! I need something like, if a player typed /me watches, it says ex. '' Everybody watches ''

How can i do it, it will send the message to all players.
Reply
#2

[me=Lajko1]SendClientMessageToAll[/me]

thats alll what u need to know
Reply
#3

Yes, i know that sendclientmessagetoall, but how i use it? i must use GetPLayerName, and so on, please, give me the full command!
Reply
#4

You need to learn how to make commands with parameters first.

https://sampwiki.blast.hk/wiki/Fast_Commands
Reply
#5

How about this:
Код:
if(strcmp(cmd, "/me", true) == 0)
{
    new text;
	new name[MAX_PLAYER_NAME], string[44];
  	GetPlayerName(playerid, name, sizeof(name));
  	format(string, sizeof(string), "%s %s.",name, text);
  	SendClientMessageToAll(YOUR_COLOR, string); 
    return 1;
}
Reply
#6

Quote:
Originally Posted by WSD
How about this:
Код:
if(strcmp(cmd, "/me", true) == 0)
{
	new name[MAX_PLAYER_NAME], string[44];
  	GetPlayerName(playerid, name, sizeof(name));
  	format(string, sizeof(string), "%s watches.",name);
  	SendClientMessageToAll(YOUR_COLOR, string); 
    return 1;
}
Donґt use this. This will show only XYNAME watches.

My /me command is this ( I hope you donґt ask again for a whole command and you learn to script -.-*

Quote:

dcmd_me(playerid,params[])
{
new ReturnPlayer;
if(PlayerIsMuted[ReturnPlayer] == 1) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You canґt speak. You are muted!");
new string[128];
if(!strlen(params)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "Usage: /me <action>.");
format(string, sizeof(string), "* %s %s", pNick(playerid), params);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
return 1;
}
stock pNick(playerid)
{
new nick[MAX_PLAYER_NAME];
GetPlayerName(playerid, nick, MAX_PLAYER_NAME);
return nick;
}

Reply
#7

Quote:

#include <a_samp>
#include <dudb>

public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new cmd[256];
new tmp[256];
new sendername[MAX_PLAYER_NAME];
new idx;
cmd = strtok(cmdtext, idx);
if(!strcmp(cmd, "/me",true) || !strcmp(cmd, "/eu",true))
{
new dir[256];
dir = strtok(cmdtext, idx);
strmid(tmp, cmdtext, 4, strlen(cmdtext));
if(!strlen(dir))
{
SendClientMessage(playerid,0xFFFF00AA,"[USAGE]> /me [Message/Action]");
return 1;
}
dir = strtok(cmdtext, idx);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "==> %s %s", sendername, tmp);
SendClientMessageToAll(0xFFFF00AA,string);
print(string);
return 1;
}
return 0;
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)