SA-MP Forums Archive
[Help] Chat name no [ID] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help] Chat name no [ID] (/showthread.php?tid=354425)



[Help] Chat name no [ID] - kbalor - 26.06.2012

How can i add id number after my name??

It clearly explains all.



Re: [Help] Chat name no [ID] - newbienoob - 26.06.2012

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(IsPlayerConnected(playerid))
    {
        new msg[256];
        format(msg,sizeof(msg),"(%d){FFFFFF} %s",playerid,text);
        SendPlayerMessageToAll(playerid,msg);
        return 0;
    }
    return 1;
}
Not tested


Re: [Help] Chat name no [ID] - FalconX - 26.06.2012

I believe you want something like this:-

pawn Код:
public OnPlayerText(playerid, text[])
{
    new szChatString[ 150 ];
    format( szChatString, sizeof( szChatString ), "(%d) %s: %s", playerid, PlayerName( playerid ), text );
    SendClientMessageToAll( GetPlayerColor( playerid ), szChatString );
    return 0;
}

stock PlayerName( playerid )
{
     new pName[ MAX_PLAYER_NAME ];
     GetPlayerName( playerid, pName, sizeof( pName ) );
     return pName;
}
Hope this helps?

Regards,
FalconX


Re: [Help] Chat name no [ID] - kbalor - 26.06.2012

Quote:
Originally Posted by FalconX
Посмотреть сообщение
I believe you want something like this:-

pawn Код:
public OnPlayerText(playerid, text[])
{
    new szChatString[ 150 ];
    format( szChatString, sizeof( szChatString ), "(%d) %s: %s", playerid, PlayerName( playerid ), text );
    SendClientMessageToAll( GetPlayerColor( playerid ), szChatString );
    return 0;
}

stock PlayerName( playerid )
{
     new pName[ MAX_PLAYER_NAME ];
     GetPlayerName( playerid, pName, sizeof( pName ) );
     return pName;
}
Hope this helps?

Regards,
FalconX
Both script are working fine thanks. But im just confused whats the difference between you and newbienoob script?


Re: [Help] Chat name no [ID] - ViniBorn - 26.06.2012

Quote:
Originally Posted by kbalor
Посмотреть сообщение
Both script are working fine thanks. But im just confused whats the difference between you and newbienoob script?
newbienoob - SendPlayerMessageToAll

FalconX - SendClientMessageToAll


Re: [Help] Chat name no [ID] - kbalor - 26.06.2012

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
newbienoob - SendPlayerMessageToAll

FalconX - SendClientMessageToAll
then what is better??


Re: [Help] Chat name no [ID] - ViniBorn - 26.06.2012

Not much difference ...


Re: [Help] Chat name no [ID] - [A]ndrei - 26.06.2012

hey cAN someone put this in pastebin because when i copy paste comes out in one line pleaseeeeeeeee?