I don't get it... - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I don't get it... (
/showthread.php?tid=187779)
I don't get it... -
knackworst - 04.11.2010
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...
Re: I don't get it... -
JaTochNietDan - 04.11.2010
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.
Re: I don't get it... -
<Weponz> - 04.11.2010
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
Re: I don't get it... -
knackworst - 04.11.2010
It's so easy?
I thought it was with strings and stuff...?
Re: I don't get it... -
<Weponz> - 04.11.2010
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....
Re: I don't get it... -
Karlip - 04.11.2010
It's always with strings, only that you're misunderstanding the meaning of a string.
Re: I don't get it... -
knackworst - 04.11.2010
Yes, but I don't understand the string info on the wiki...
Re: I don't get it... -
Alex_Valde - 04.11.2010
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;
}
Re: I don't get it... -
knackworst - 04.11.2010
I see, so the gametext will be: the stuff you made the string?
Re: I don't get it... -
Alex_Valde - 04.11.2010
Quote:
Originally Posted by knackworst
I see, so the gametext will be: the stuff you made the string?
|
Thats right.
I hope that helped