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;
}
* Dayrion HIIMDAYRION WHATS UP TODAY BLABLABLABLA NO WORRIS I GOT THIS
Dayrion HIIMDAYRION WHATS UP TODAY BLABLABLABLA ... NO WORRIS I GOT THIS
|
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" |
|
I think he means something like that.
Код:
* Zeus666 HIIMDAYRION WHATS UP TODAY BLABLABLABLA NO WORRIS I GOT THIS
Код:
Dayrion HIIMDAYRION WHATS UP TODAY BLABLABLABLA ... NO WORRIS I GOT THIS |
|
That's correct.
and gives me error warning 203: symbol is never used: "SendCustomPlayerMessage" |
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;
}
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);
}
}
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;
}