#1

This is my RealChat now:

pawn Код:
if(realchat)
    {
        if(gPlayerLogged[playerid] == 0)
        {
            return 0;
        }
        else if(PlayerInfo[playerid][pMask] == 1)
        {
            if(strcmp(Accent[playerid],"none",true,3))
            {
                new result[256];
                format(string, sizeof(string), "Stranger says: [%s Accent] %s",Accent[playerid],text);
            }
            else
            {
                format(string, sizeof(string), "Stranger says: %s",text);
            }
        }
        else
        {
            if(strcmp(Accent[playerid],"none",true,3))
            {
                format(string, sizeof(string), "%s says: [%s Accent] %s",PlayerName(playerid),Accent[playerid],text);
            }
            else
            {
                format(string, sizeof(string), "%s says: %s",PlayerName(playerid),text);
            }
        }
        ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        return 0;
    }
    return 1;
}
But how to set it as normal chats, like every server has?

Код:
<playercolor+name>: %s

Example:

SAMP: Hey!

So Cyan is the PlayerColor of the player^
What do I need to replace?
Reply
#2

pls ok
Reply
#3

Use {Hex color here} example :
pawn Код:
SendClientMessage(playerid,-1,"{FF0000}This is red color and this is {FFFFFF}White.");
To find hex colors : http://www.colorpicker.com/
Reply
#4

Quote:
Originally Posted by SilentSoul
Посмотреть сообщение
Use {Hex color here} example :
pawn Код:
SendClientMessage(playerid,-1,"{FF0000}This is red color and this is {FFFFFF}White.");
To find hex colors : http://www.colorpicker.com/
I don't want that... I want to have the chat normal....
Reply
#5

GetPlayerColor(playerid);
Reply
#6

pawn Код:
public OnPlayerText(playerid, text[])
{
    new msg[128], name[MAX_PLAYER_NAME];
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(msg, sizeof(msg), "%s[%d]: %s", name, playerid, text);
    SendClientMessageToAll(GetPlayerColor(playerid), msg);
    }
    return 1;
}
Reply
#7

Do I need to replace it?
Reply
#8

That was just an example, if your script that you provided on the topic is needed for you, you can modify your script using the same method as me. Or if your own code that you provided on the topic isn't needed. Remove it and place mine under OnPlayerText call back.

PS: You said you need a normal chat like every server have. Then replace it with mine.
Reply
#9

Код:
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(2627) : error 004: function "FixHour" is not implemented
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(3997) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(4011) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(4417) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(4432) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(4486) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(4580) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(4590) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(4653) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(4654) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(4708) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(11584) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(11622) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(12647) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(12648) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(12677) : error 017: undefined symbol "encode_tires"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(12693) : error 017: undefined symbol "encode_tires"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(12692) : warning 204: symbol is assigned a value that is never used: "carid"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(12693) : warning 204: symbol is assigned a value that is never used: "tires"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(12691) : warning 203: symbol is never used: "lights"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(12691) : warning 203: symbol is never used: "doors"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(12691) : warning 203: symbol is never used: "panels"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(12709) : error 017: undefined symbol "encode_tires"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(12708) : warning 204: symbol is assigned a value that is never used: "carid"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(12709) : warning 204: symbol is assigned a value that is never used: "tires"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(12707) : warning 203: symbol is never used: "lights"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(12707) : warning 203: symbol is never used: "doors"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(12707) : warning 203: symbol is never used: "panels"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(13627) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(15138) : error 004: function "FixHour" is not implemented
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(16329) : error 004: function "FixHour" is not implemented
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(16401) : error 004: function "FixHour" is not implemented
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(19298) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(19376) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(19464) : error 017: undefined symbol "CreateStrip"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(19495) : error 017: undefined symbol "DeleteClosestStrip"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(19523) : error 017: undefined symbol "DeleteAllStrip"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(20701) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(20720) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(20790) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(22587) : error 004: function "FixHour" is not implemented
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25075) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25101) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25126) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25172) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25186) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25218) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25220) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25249) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25252) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25255) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25267) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25272) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25285) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25289) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25297) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25325) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25337) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25909) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25980) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25981) : error 017: undefined symbol "CMDMessageToAdmins"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25987) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(25994) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(26768) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(26794) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(26823) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(26825) : warning 204: symbol is assigned a value that is never used: "vehicle"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28059) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28061) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28062) : error 017: undefined symbol "CMDMessageToAdmins"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28279) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28281) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28282) : error 017: undefined symbol "CMDMessageToAdmins"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28597) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28616) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28616) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28643) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28643) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28665) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28665) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28686) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28686) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28706) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28706) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28727) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28727) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28750) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28750) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28773) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28773) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28799) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28799) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28829) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(28829) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(29466) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(29507) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(29508) : error 017: undefined symbol "CMDMessageToAdmins"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(29528) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(30378) : warning 204: symbol is assigned a value that is never used: "rands"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(30487) : warning 202: number of arguments does not match definition
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(30513) : warning 202: number of arguments does not match definition
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(30539) : warning 202: number of arguments does not match definition
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(30564) : warning 202: number of arguments does not match definition
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(31018) : warning 202: number of arguments does not match definition
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(31018) : warning 202: number of arguments does not match definition
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(31018) : warning 202: number of arguments does not match definition
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(42068) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(42110) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(42379) : error 017: undefined symbol "sscanf"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(42418) : error 017: undefined symbol "sscanf"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(42468) : error 017: undefined symbol "sscanf"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(42489) : error 017: undefined symbol "sscanf"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(42521) : error 017: undefined symbol "sscanf"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(42604) : error 017: undefined symbol "sscanf"
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(43664) : warning 217: loose indentation
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(43664) : error 029: invalid expression, assumed zero
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(43664) : error 029: invalid expression, assumed zero
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(43675) : warning 225: unreachable code
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(43675) : error 029: invalid expression, assumed zero
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(43675) : error 004: function "ClosePDDoor" is not implemented
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(43684) : warning 225: unreachable code
C:\Users\Justin\Desktop\Oud\CR-RP(LS)\GameModes\GLRP.pwn(43684) : error 029: invalid expression, assumed zero

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
26 errors if I replace it.

Some more of the script:
pawn Код:
}
    public OnPlayerText(playerid, text[])
{
    new msg[128], name[MAX_PLAYER_NAME];
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(msg, sizeof(msg), "%s[%d]: %s", name, playerid, text);
    SendClientMessageToAll(GetPlayerColor(playerid), msg);
    }
    return 1;
}
public ClosePDDoor()
{
    if(DoorOpened == 1)
    {
        MoveObject(door, 222.09, 70.57, 1004.00, 3);
        DoorOpened = 0;
    }
    return 1;
}
public FixHour(hour)
{
    hour = timeshift+hour;
    if(hour < 0)
    {
        hour = hour+24;
    }
    else if(hour > 23)
    {
        hour = hour-24;
    }
    shifthour = hour;
    return 1;
}
Without yours, it's compiling fine.
Reply
#10

Just remove that script and open your gamemode, find OnPlayerText call back then replace the code that i provided above on it. Don't replace it, else it will give you a huge error like that. Cause the code i provided only works under OnPlayerText. Or you can simply disable your script using /*snipped script here*/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)