When someone joins , join message is bugged
#1

Hello.

This is the code

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && playerid != i)
        {
            if(PlayerInfo[i][pAdmin] > 1)
            {
                SendClientMessage(i,COLOR_GREEN,string);
                if(SendIP == 1)
                {
                    SendClientMessage(i,COLOR_GREEN,string2);
                    SendIP = 0;
                }
   }
   else
            {
                format(string,sizeof(string),"%s(%d) has joined.", plname, playerid);
                SendClientMessageToAll(COLOR_VIOLET,string);
            }
        }
    }
When someone joins, depending on the players it multiplies

like

[name] has joined united kingdom rp <-- 1/2 players


[name] has joined united kingdom rp
[name] has joined united kingdom rp <--- 3/4 players..
[name] has joined united kingdom rp

Im not sure what makes that happen...
Reply
#2

Use this(10x better):
pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[128];
    format(string, sizeof(string), "%s has joined United Kingdom RP!", plname);
    return 1;
}
Reply
#3

Oh, Alright. Thank you!
Reply
#4

pawn Код:
public OnPlayerConnect(playerid)
{
    new string[128];
    format(string, sizeof(string), "%s has joined United Kingdom RP!", plname);
    return 1;
}
it's on player connect
Reply
#5

Wait, why is it on OnPlayerText?
Reply
#6

Sorry I wasn't thinking >.<
Reply
#7

When i do that

i get

[pawn]
error 017: undefined symbol "string"
error 017: undefined symbol "string"
[pawn] it said it was already defined when i had the 'new string[128];'
Reply
#8

Just ignore all of them. They are trying to fuck your server.
Windows32 doesn't even know what he is doing.
Mr. Rudy"_" is just copy/pasting.

pawn Код:
public
    OnPlayerConnect(playerid)
    {
        new
            string[128],
            nameoftheplayerhaha[MAX_PLAYER_NAME]
        ;
       
        GetPlayerName(playerid, nameoftheplayerhaha, MAX_PLAYER_NAME);
        format(string, sizeof(string), "%s (%d) has joined YOUR SERVER NAME HERE", nameoftheplayerhaha, playerid);
        SendClientMessageToAll(-1, string); // You don't simply send message to all in role play servers
    }
Use this. You have to edit things according to your need though.

Just for a quick note, OnPlayerText is called when a player writes something in the chat box and presses enter. Sending a message for every player who writes something in the chat is just trolling or plain foolishness.
Reply
#9

Quote:
Originally Posted by Cell_
Посмотреть сообщение
Just ignore all of them. They are trying to fuck your server.
Windows32 doesn't even know what he is doing.

pawn Код:
public
    OnPlayerConnect(playerid)
    {
        new
            string[128],
            nameoftheplayerhaha[MAX_PLAYER_NAME]
        ;
       
        GetPlayerName(playerid, nameoftheplayerhaha, MAX_PLAYER_NAME);
        format(string, sizeof(string), "%s (%d) has joined YOUR SERVER NAME HERE", nameoftheplayerhaha, playerid);
        SendClientMessageToAll(-1, string); // You don't simply send message to all in role play servers
    }
LOL Really? Get your facts right. I have been scripting samp since 2008(don't moan about the joindate, I have a different account). Everyone makes mistakes sometimes, not everyone is a smartass, not even you. So don't even start.

Also take a look at your code. I don't even have to say anything.
Reply
#10

Quote:
Originally Posted by Cell_
Посмотреть сообщение
Mr . Rudy -.- is just Copying/Pasting
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)