RP chat
#1

Hello, i started to edit my script, and i dont know how but i played with my friend and we wanted to talk and we saw thats show it for all the players, i mean like DM server, picture:

someone can say me what i am supposed to do ?
Reply
#2

Show us your "OnPlayerText" contents.
Reply
#3

That's because you need code under OnPlayerText in order to convert it to a more 'roleplay' style of talking if that's what you mean. This is my OnPlayerText, along with a stock ProxDetector that is used to get the player's position and send messages based on how close the player is to another person.

Код:
public OnPlayerText(playerid, text[])
{
    new
        message[128];
    format(message, sizeof(message), "%s says: %s", GetName(playerid), text);
    ProxDetector(30.0, playerid, message, -1);
    return 0;
}

stock ProxDetector(Float:radi, playerid, string[],color)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    foreach(Player,i)
    {
        if(IsPlayerInRangeOfPoint(i,radi,x,y,z))
        {
            SendClientMessage(i,color,string);
        }
    }
}
Of course, you can change the OnPlayerText however you want in order to fit your server.
Reply
#4

You need to add a return at the end of that stock maybe?
Reply
#5

@BryanD just add return 0; in OnPlayerText

i think it has return 1; so replace it
Hoe Work
Reply
#6

i didnt understand OnPlayerText:
Quote:

public OnPlayerText(playerid, text[])
{
if(gPlayerLogged[playerid] != 1)
{
SendClientMessage(playerid, COLOR_RED, "You're not logged in.");
return 0;
}
if(PlayerInfo[playerid][pTut] == 0)
{
return 0;
}

new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new string[128];
playerLastTyped[playerid] = 0;

if(TextSpamUnmute[playerid] != 0)
{
if(PlayerInfo[playerid][pAdmin] < 6)
{
SendClientMessage(playerid, COLOR_WHITE, "You're muted from submitting text right now.");
return 0;
}
}

if(PlayerInfo[playerid][pAdmin] < 6)
{
TextSpamTimes[playerid]++;

if(TextSpamTimes[playerid] == 5)
{
TextSpamTimes[playerid] = 0;
TextSpamUnmute[playerid] = 10;
SendClientMessage(playerid, COLOR_YELLOW, "You have been muted automatically for spamming. Please wait 10 seconds and try again.");
SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_FLOODPROTECTION);
return 0;
}
}

if(strfind(text, "|", true) != -1)
{
SendClientMessage(playerid, COLOR_RED, "You can't use the '|' character in text.");
return 0;
}

if(PlayerInfo[playerid][pAdmin] < 4)
{
if(strfind(text, ":", true) != -1)
{
new
i_numcount,
i_period,
i_pos;

while(text[i_pos]) {
if('0' <= text[i_pos] <= '9') i_numcount++;
else if(text[i_pos] == '.') i_period++;
i_pos++;
}
if(i_numcount >= 8 && i_period >= 3) {
format(string,sizeof(string),"Warning: %s may be server advertising: '%s'.", GetPlayerNameEx(playerid),text);
ABroadCast(COLOR_RED, string, 2);
Log("logs/hack.log", string);
return 0;
}
}
}
Reply
#7

someone? please!
Reply
#8

PHP код:
public onPlayerText(playeridtext[])
{
    new 
Float:X,Y,Z;
    
GetPlayerPos(playerid,X,Y,Z);
    new 
message[128];
    
format(messagesizeof(message), "%s says: %s"GetName(playerid), text);
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerInRangeOfPoint(i,30,X,Y,Z);
        
SendClientMessage(i,-1,message);
    }
    return 
0;

Reply
#9

What do you mean? You want that your chats be seen by people near your character? If thats the case, use ProxDetector... You can use RP scripts uploaded. Try looking and test it for yourself
Reply
#10

Quote:
Originally Posted by [Bios]Marcel
Посмотреть сообщение
PHP код:
public onPlayerText(playeridtext[])
{
        new 
Float:X,Y,Z;
    
GetPlayerPos(playerid,X,Y,Z);
    new 
message[128];
    
format(messagesizeof(message), "%s says: %s"GetName(playerid), text);
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerInRangeOfPoint(i,30,X,Y,Z);
        
SendClientMessage(i,-1,message);
    }
    return 
0;

Shouldn't It be? -

pawn Код:
public onPlayerText(playerid, text[])
{
       
    new Float:X,Y,Z;
    GetPlayerPos(playerid,X,Y,Z);
    new message[128];
    format(message, sizeof(message), "%s says: %s", GetName(playerid), text);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInRangeOfPoint(i,30,X,Y,Z)
        {
            SendClientMessage(i,-1,message);
        }
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)