|Class selection|
#1

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
Reply
#2

Use OnPlayerRequestClass...

I mean add your textdraw there
Reply
#3

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
    }
Reply
#4

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.
Reply
#5

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
Reply
#6

I know how to create text draws...
But anyway thanks!
Got it now
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)