[Quest] small object & edit message -
tomsalmon - 17.02.2012
hi, i have two questions;
1. if i wrote a message "Hello World!" and i want to edit it to "Hello World !!! ~!~!~!~!~", can i do it ? if yes, how?
2. i saw in some server the water ball is small, the size of the player... how to do it?
thx for help
Re: [Quest] small object & edit message -
[HK]Ryder[AN] - 17.02.2012
What fo u mean by edit it
Re: [Quest] small object & edit message -
tomsalmon - 17.02.2012
i mean if someone write message "Fuck you idiot" i edit it to "other message" with comand /EDITMESSAGE or something... i can do it?
Re: [Quest] small object & edit message -
X-Box - 17.02.2012
You should Use /fakechat
Re: [Quest] small object & edit message -
tomsalmon - 17.02.2012
but i wanna edit message of wrote in the chat... look screen:
Re: [Quest] small object & edit message -
TheGamer! - 17.02.2012
It will fully resend all chat messages (but not send client messages)
pawn Код:
new Chat[256][999], ChatLines, PlayerColor[999], PlayerName[999];
public OnPlayerText(playerid, text[])
{
format(Chat[ChatLines], 256, "%s", text);
ChatLines++;
PlayerColor[ChatLines]=GetPlayerColor(playerid);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128], idx;
cmd = strtok(cmdtext, idx);
if (strcmp("/editmessage", cmd, true, 10) == 0)
{
new tmp[128];
tmp = strtok(cmdtext, idx);
if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /editmessage [line] [text]");
new tmp2[128];
tmp2 = strtok(cmdtext, idx);
if(strlen(tmp2) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /editmessage [line] [text]");
new id=ChatLines-strval(tmp);
format(Chat[id], 256, "%s", tmp2);
for(new i; i<ChatLines; i++)
{
new string[256]; format(string, 256, "%s: %s", PlayerName[i], Chat[i]);
SendClientMessageToAll(PlayerColor[i], string);
}
return 1;
}
return 0;
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
I didn't tested it but I hope it will work
Re: [Quest] small object & edit message -
tomsalmon - 17.02.2012
2 errors:
PHP код:
C:\Users\ъен\Desktop\SAMPPPPPP\gamemodes\Mode.pwn(221) : error 047: array sizes do not match, or destination array is too small
C:\Users\ъен\Desktop\SAMPPPPPP\gamemodes\Mode.pwn(224) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.
how to fix them? thanks for the command
PHP код:
if (strcmp("/editmessage", cmd, true, 10) == 0)
{
new tmp1[128];
tmp1 = strtok(cmdtext, idx);//221 line---------------------------------
if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /editmessage [line] [text]");
new tmp2[128];
tmp2 = strtok(cmdtext, idx);//224 line-------------------------
if(strlen(tmp2) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /editmessage [line] [text]");
new id2=ChatLines-strval(tmp1);
format(Chat[id2], 256, "%s", tmp2);
for(new i; i<ChatLines; i++)
{
format(string, 256, "%s: %s", PlayerName[i], Chat[i]);
SendClientMessageToAll(PlayerColor[i], string);
}
return 1;
}
Re: [Quest] small object & edit message -
KingHual - 17.02.2012
You want it to be auto edited when a user posts something, or you want the command so u can enable-disable auto editing?
Re: [Quest] small object & edit message -
tomsalmon - 17.02.2012
I mean, if a player recorded a curse I can edit it another trial.
**from ****** translate**