SA-MP Forums Archive
GameTextForPlayer help please - 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: GameTextForPlayer help please (/showthread.php?tid=567815)



GameTextForPlayer help please - Guss - 16.03.2015

Hi, I have made this code:

PHP код:
        new admin;
        {
        
admin = :P_LEVEL_HELPER;
        
GameTextForPlayeradmin"~r~New Report"50003);
        } 
I am testing with a friend but my friend did not appear the message, why?


Re: GameTextForPlayer help please - Luis- - 16.03.2015

I really intrigued with this, did it actually compile for you?


Respuesta: GameTextForPlayer help please - Guss - 16.03.2015

Код:
GameTextForPlayer( :P_LEVEL_HELPER, "~r~New Report", 5000, 3);
The same, my friend can't see the text


Respuesta: GameTextForPlayer help please - Guss - 16.03.2015

Yes, and compiled. As I do?


Re: GameTextForPlayer help please - Luis- - 16.03.2015

I honestly don't know how it's compiling, as said above, it's not valid syntax. I'd advise you to actually look at some tutorials to see how the syntax works.

Anywho, shouldn't it be this?
pawn Код:
new admin;
        {
        admin = :P_LEVEL_HELPER;
        GameTextForPlayer( playerid, "~r~New Report", 5000, 3);
        }



Respuesta: Re: GameTextForPlayer help please - Guss - 16.03.2015

Quote:
Originally Posted by Luis-
Посмотреть сообщение
I honestly don't know how it's compiling, as said above, it's not valid syntax. I'd advise you to actually look at some tutorials to see how the syntax works.

Anywho, shouldn't it be this?
pawn Код:
new admin;
        {
        admin = :P_LEVEL_HELPER;
        GameTextForPlayer( playerid, "~r~New Report", 5000, 3);
        }
code that sends the text to the player reports


Re: GameTextForPlayer help please - SickAttack - 16.03.2015

Well, it only complies if you remove the two points.




Respuesta: GameTextForPlayer help please - Guss - 17.03.2015



compiled


Respuesta: GameTextForPlayer help please - Guss - 17.03.2015

Now can you tell me if it's the right way?


Re: Respuesta: GameTextForPlayer help please - SickAttack - 17.03.2015

Quote:
Originally Posted by Guss
Посмотреть сообщение
Now can you tell me if it's the right way?
It isn't right, where did you even get that?

If you want to send a game text to the server helpers, then loop through the players. Even if you code worked, it would send the game text to only one player. Example:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i ++)
{
    if(aUserInfo[i][user_admin_level] => P_LEVEL_HELPER)
    {
        GameTextForPlayer(i, "~r~New Report", 5000, 3);
    }
}
* Note that, that isn't a copy/paste code, it's only an example.