|Class selection| - 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: |Class selection| (
/showthread.php?tid=196663)
|Class selection| -
Baboon - 06.12.2010
Hi there!
Ofc I am having classes. But how can I add TextDraws to it? I mean like: skin id 285 gets USA and skin id 287 gets Vietnam as name.
Greetzzzzzz
me
Re: |Class selection| -
TouR - 06.12.2010
Use OnPlayerRequestClass...
I mean add your textdraw there
Re: |Class selection| -
Luis- - 06.12.2010
Add this on to OnGameModeInit
pawn Код:
AddPlayerClass(285, /*Spawn Code's*/, 0, 0, 0, 0, 0, 0); // 0
AddPlayerClass(297, /*Spawn Code's*/, 0, 0, 0, 0, 0, 0); // 1
Add this on to OnPlayerRequestClass
pawn Код:
if (classid == 0) // Skin 285
{
// Code here
}
if (classid == 1) // Skin 297
{
// another code here
}
Re: |Class selection| -
tjying95 - 06.12.2010
show the textdraw at OnPlayerRequestClass. Also there is a classid which can help you to know which skin is which. Refer to sample gamemode like "rivershell" for more info.
Re: |Class selection| - rjjj - 06.12.2010
You have to do a TextDraw code in the OnGameModeInit callback, like this:
pawn Код:
new Text:Example;//In the top of the GameMode
//In OnGameModeInit
Example = TextDrawCreate(1.0, 433.0, "~g~LOL!");
TextDrawAlignment(Example,0);
TextDrawBackgroundColor(Example,0x000000ff);
TextDrawFont(Example,2);
TextDrawLetterSize(Example,0.2999, 1.4);
TextDrawBoxColor(Example,0x00000050);
TextDrawColor(Example,0xffffffff);
TextDrawSetOutline(Example,1);
TextDrawSetProportional(Example,1);
TextDrawSetShadow(Example,1);
After this you will be able to use this kind of functions in any place that you want:
pawn Код:
TextDrawShowForPlayer(playerid, Example);//To show a TextDraw.
TextDrawShowForPlayer(playerid, Example);//To hide a TextDraw.
To do the code of textdraws, you can use Zamaroth's TextDraw Editor.
I hope that i have helped
Re: |Class selection| -
Baboon - 06.12.2010
I know how to create text draws...
But anyway thanks!
Got it now