[Quest] small object & edit message
#1

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
Reply
#2

What fo u mean by edit it
Reply
#3

i mean if someone write message "Fuck you idiot" i edit it to "other message" with comand /EDITMESSAGE or something... i can do it?
Reply
#4

You should Use /fakechat
Reply
#5

but i wanna edit message of wrote in the chat... look screen:


Reply
#6

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
Reply
#7

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 
(c1997-2006ITB CompuPhase
2 Errors

how to fix them? thanks for the command

PHP код:
   if (strcmp("/editmessage"cmdtrue10) == 0)
   {
   new 
tmp1[128];
   
tmp1 strtok(cmdtextidx);//221 line---------------------------------
   
if(strlen(tmp) == 0) return SendClientMessage(playerid0xFFFFFFFF"USAGE: /editmessage [line] [text]");
   new 
tmp2[128];
   
tmp2 strtok(cmdtextidx);//224 line-------------------------
   
if(strlen(tmp2) == 0) return SendClientMessage(playerid0xFFFFFFFF"USAGE: /editmessage [line] [text]");
   new 
id2=ChatLines-strval(tmp1);
   
format(Chat[id2], 256"%s"tmp2);
   for(new 
ii<ChatLinesi++)
   {
   
format(string256"%s: %s"PlayerName[i], Chat[i]);
   
SendClientMessageToAll(PlayerColor[i], string);
   }
   return 
1;
   } 
Reply
#8

You want it to be auto edited when a user posts something, or you want the command so u can enable-disable auto editing?
Reply
#9

I mean, if a player recorded a curse I can edit it another trial.

**from ****** translate**
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)