Jump to content
  • 0

Ajutor OnPlayerText


MiLaS

Question

5 answers to this question

Recommended Posts

Salut, as vrea sa stiu cum se poate modifica textul de la chat(sa apara de ex [VIP] PlayerName):Chat...cum e posibil?

Da este posibil.Poftim un exemplu care arata in fata numelui [OWNER] atunci cand esti logat cu RCON:

[pawn]public OnPlayerText( playerid , text[ ] )  { // Functia OnPlayerText.

    if ( IsPlayerAdmin ( playerid ) ) { // Verifica daca este administrator.

        new msg [ 128 ] , pName [ MAX_PLAYER_NAME ] ; // Aici se creaza "new"-urile.

        GetPlayerName ( playerid , pName , MAX_PLAYER_NAME ) ; // Preia numele jucatorilor.

        format ( msg , sizeof ( msg ) , "[OWNER] %s (ID %d): %s" , pName , playerid , text ) ; // Formarea mesajului.

        SendClientMessageToAll ( 0xFFFFFFFF , msg ) ; } // Trimite mesajul tuturor.

    return (1) ; } // Reintoarce valoarea 1.[/pawn]

Link to comment
Share on other sites

Scuze, am gresit eu codul.Incearca asa:

[pawn]public OnPlayerText( playerid , text[ ] )  { // Functia OnPlayerText.

    if ( IsPlayerAdmin ( playerid ) ) { // Verifica daca este administrator.

        new pName [ MAX_PLAYER_NAME ] ,  string [ 128 ] ; // Aici se creaza "new"-urile.

        GetPlayerName ( playerid , pName , 24 ) ; // Preia numele jucatorului logat cu RCON.

        format ( string , sizeof ( string ) , "[Admin]%s: %s", pName , text ) ; // Formarea mesajului.

        SendClientMessageToAll ( -1 , string ) ; // Trimite mesajul tuturor.

        return 0 ; } // Blocheaza trimiterea mesajului de 2 ori.

    return 1 ; } // Reintoarce valoarea 1.[/pawn]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.