over nick the player id
#6

Quote:
Originally Posted by knackworst
Посмотреть сообщение
pawn Код:
new
                szStr[128],
                szPName[MAX_PLAYER_NAME];
            GetPlayerName(playerid, szPName, MAX_PLAYER_NAME);
            format(szStr, sizeof(szStr), "{4169FF}%s:{FFFFFF} %s", szPName, text[0]);

            for(new i; i < MAX_PLAYERS; i++)//if you use foreach use that, if you don't - then you should start.
                if(IsPlayerConnected(i))
                    SendClientMessageToAll(COLOR_WHITE,szStr);
Your code will send a message to all players each time it finds a connected player causing the chat to be flooded.

pawn Код:
public OnPlayerText(playerid, text[]) {

    new
        cString[128],
        pName[MAX_PLAYER_NAME]
    ;
   
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    format(cString, sizeof(cString), "%s(%d): %s", pName, playerid, text);
    SendClientMessageToAll(-1, cString);
   
    return 0;
}
Reply


Messages In This Thread
PlayerID near player nick - by V4at - 31.10.2011, 08:52
Re : over nick the player id - by V4at - 31.10.2011, 11:13
Re: over nick the player id - by Scenario - 31.10.2011, 11:16
Re: over nick the player id - by knackworst - 31.10.2011, 11:18
Re : over nick the player id - by V4at - 31.10.2011, 11:18
Re: over nick the player id - by Psymetrix - 31.10.2011, 11:46
Re: over nick the player id - by knackworst - 31.10.2011, 11:55
Re : over nick the player id - by V4at - 31.10.2011, 12:12
Re: over nick the player id - by Psymetrix - 31.10.2011, 12:40
Re: over nick the player id - by knackworst - 31.10.2011, 12:49

Forum Jump:


Users browsing this thread: 4 Guest(s)