command /me (easy help)
#1

I want a /me like

Username goes to bar and grabs something to eat while he sp..
..eaks to the barman ((Username))

Код:
SendCustomPlayerMessage(playerid, color, text[])
{
    if(strlen(text) > 112)
    {
        new text1[112],
            text2[112],
            pos = strfind(text," "false,102)
			string[224];

        strmid(text1, text, 0, pos);
        strmid(text2, text, pos, strlen(text));

        format(string, sizeof(string), "%s...", text1);
        SendClientMessage(playerid, color, string);

        format(string, sizeof(string), "...%s", text2);
        SendClientMessage(playerid, color, string);
    }
    else SendClientMessage(playerid, color, text);
}

CMD:me(playerid, params[])
{
    new string[128], action[128];
    if(sscanf(params, "s[128]", action))
    {
        SendClientMessage(playerid, -1, ""chat" /me [action]");
        return 1;
    }
    else
    {
        format(string, sizeof(string), "* %s %s", PlayerName(playerid), action);
        ProxDetector(30, playerid, string, COLOR_PURPLE);
    }
    return 1;
}
This is my code, but doesn't work.
Reply
#2

You dont want all of tht lol.
Just
New String[128], action[128];
if(sscanf(params, "u", action)) return SendClientMessage(playerid, color, "USE: /me {Text}");
format(string, sizeof(string), "* %d %d", PlayerName(playerid), action);
SendClientMessageToAll(color, string);
return 1;

Under CMD:me(playerid, params[])
Reply
#3

I want to make line to divide to 2 lines

like


Username goes to bar and grabs something to eat while he sp..
..eaks to the barman ((Username
Reply
#4

How the cmd will be?
Give me example how will u type it in game.
My cmd will be like
* oktokt1 goes to bar and grabs something to eat while he sp...eaks to the barman.
Tha will show that "*Oktokt goes to bar and grabs something to eat while he sp..
..eaks to the barman"
Reply
#5

I think he means something like that.
Код:
* Dayrion HIIMDAYRION WHATS UP TODAY BLABLABLABLA NO WORRIS I GOT THIS
to
Код:
Dayrion HIIMDAYRION WHATS UP TODAY BLABLABLABLA
... NO WORRIS I GOT THIS
Because the /me is too long.
Reply
#6

new text1[112],
text2[112],
string[224],
pos = strfind(text," ", false, 102);
Reply
#7

Quote:
Originally Posted by oktokt1
Посмотреть сообщение
How the cmd will be?
Give me example how will u type it in game.
My cmd will be like
* Zeus666 goes to bar and grabs something to eat while he sp...eaks to the barman.
Tha will show that "*Oktokt goes to bar and grabs something to eat while he sp..
..eaks to the barman"
Quote:
Originally Posted by Dayrion
Посмотреть сообщение
I think he means something like that.
Код:
* Zeus666 HIIMDAYRION WHATS UP TODAY BLABLABLABLA NO WORRIS I GOT THIS
to
Код:
Dayrion HIIMDAYRION WHATS UP TODAY BLABLABLABLA
... NO WORRIS I GOT THIS
Because the /me is too long.

That's correct.

Zeus666 goes to Los Santos with his car while he listens to th...
... e music and enjoys himself


something like that.


and gives me error warning 203: symbol is never used: "SendCustomPlayerMessage"


I want this for all chats. Normal chat, /b chat, /pm chat, everything.

I need to switch formatstring to sendcustomplayermessage maybe but i don't know how
Reply
#8

Quote:
Originally Posted by Zeus666
Посмотреть сообщение
That's correct.


and gives me error warning 203: symbol is never used: "SendCustomPlayerMessage"
It's a warning,just remove it (if you never use it) SendCustomPlayerMessage from your script and then recompile it again
Reply
#9

Код:
CMD:me(playerid,params[])
{
    new msg[64],str[128];
    if(sscanf(params,"s",msg)) return SendClientMessage(playerid,color,"[ ! ] Usage: /me <message>");
    format(str,sizeof(str),"[ ! ]Player ID [%d] : %s",playerid,msg);
    SendClientMessageToAll(color,str);
    return 1;
}
Try using it, and i am sure it will work, But as i have read you previous comments you need something that divide the msg into 2 lines, So that's possible when you divide the string. try it
Reply
#10

I've changed the splitmessage into


Код:
stock SendSplitMessage(playerid, color, final[])
{
	new buffer[EX_SPLITLENGTH+5];
	new len = strlen(final);
	if(len>EX_SPLITLENGTH)
	{
	    new times = (len/EX_SPLITLENGTH);
		for(new i = 0; i < times+1; i++)
		{
			strdel(buffer, 0, EX_SPLITLENGTH+5);
			if(len-(i*EX_SPLITLENGTH)>EX_SPLITLENGTH)
			{
				strmid(buffer, final, EX_SPLITLENGTH*i, EX_SPLITLENGTH*(i+1));
				format(buffer, sizeof(buffer), "%s ...", buffer);
			}
			else
			{
			    strmid(buffer, final, EX_SPLITLENGTH*i, len);
			}
			SendClientMessage(playerid, color, buffer);
		}
	}
	else
	{
		SendClientMessage(playerid, color, final);
	}
}
this is my command me

Код:
CMD:me(playerid, params[])
{
    new string[128], action[128];
    if(sscanf(params, "s[128]", action))
    {
        SendClientMessage(playerid, -1, ""chat" /me [action]");
        return 1;
    }
    else
    {
        format(string, sizeof(string), "* %s %s", PlayerName(playerid), action);
        SendSplitMessage(playerid, COLOR_PURPLE, string);
        ProxDetector(30, playerid, string, COLOR_PURPLE);
    }
    return 1;
}
error in chat:

http://i.imgur.com/l2K2kuq.png

I want

Zeus666 wants to be friend with everyone but he never goes fully retarded like ....
... them i don't know why


and / or

Zeus666 wants to be friend with everyone but he never goes fully retarded li ....
... ke them i don't know why
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)