I don't get it...
#1

I don't how to use,

Gametext for all...
It's something with strings, but I don't understand strings! even after reading the wiki!
please help, I just want that when a player types a command, all players can see a simple gametext...
Reply
#2

Quote:
Originally Posted by knackworst
Посмотреть сообщение
I don't how to use,

Gametext for all...
It's something with strings, but I don't understand strings! even after reading the wiki!
please help, I just want that when a player types a command, all players can see a simple gametext...
Well...here's a simple example...

pawn Код:
if(strcmp(cmdtext,"/gametext",true) == 0)
{
    GameTextForAll("Hello...this is a big announcement",5000,3);
    return 1;
}
Put that under OnPlayerCommandText.
Reply
#3

GameTextForPlayer(playerid,"~w~ Welcome To My Server Server!",3000,0);

Goes..."Message",Time in milliseconds(3000 is 3 secs),Type

****** GameText Types

And SAMP wiki search GameTextForPlayer...

EDIT: He explained it better xD
Reply
#4

It's so easy?

I thought it was with strings and stuff...?
Reply
#5

Quote:
Originally Posted by knackworst
Посмотреть сообщение
It's so easy?

I thought it was with strings and stuff...?
Its all mostly easy...Would u beleive a Anti-Team kill is just onne line
Код:
SetPlayerTeam(playerid,0);
etc etc And a
Код:
SetPlayerTeamFromClass
callback....
Reply
#6

It's always with strings, only that you're misunderstanding the meaning of a string.
Reply
#7

Yes, but I don't understand the string info on the wiki...
Reply
#8

Okay I'll try to show you...

pawn Код:
if (strcmp("/myname", cmdtext, true, 10) == 0)
    {
        new string[64];/* With this you create string with enought space for 63 characters...
        Doesn't have to be "string[64]"..you can have it like "mytext[some number what you need]" */

        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));// This will get the name of a player.
       
        format(string, sizeof(string), "My name is %s", name);
        //This will make the text like : My name is Alex_Valde, or what ever your(players who called this commad) name is.
        //BUT THIS WILL ONLY CREATE AND FORMAT TEXT AND WILL NOT OUTPUT IT!
        GameTextForAll(string, 3000, 3);
        //This will create GameTextForAll with your "string", time is in miliseconds (3000), and style (1).
       
        return 1;
    }
Reply
#9

I see, so the gametext will be: the stuff you made the string?
Reply
#10

Quote:
Originally Posted by knackworst
Посмотреть сообщение
I see, so the gametext will be: the stuff you made the string?
Thats right. I hope that helped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)