SA-MP Forums Archive
Textdraw at 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)
+--- Thread: Textdraw at class selection (/showthread.php?tid=296101)



Textdraw at class selection - needhack - 09.11.2011

Hello.
I have multiple classes at class selection to choose from.
I was wondering if you could put a textdraw while looking at that skin.

Example:
You are looking at
Mafia skin 1, mafia skin 2, mafia skin 3 - Textdraw: MAFIA.
You are now looking at
Gang skin 1, Gang skin 2, Gang skin 3 - Textdraw changes to: GANGSTER

Thanks in advance


Re: Textdraw at class selection - Ironboy - 09.11.2011

Quote:
Originally Posted by needhack
View Post
Hello.
I have multiple classes at class selection to choose from.
I was wondering if you could put a textdraw while looking at that skin.

Example:
You are looking at
Mafia skin 1, mafia skin 2, mafia skin 3 - Textdraw: MAFIA.
You are now looking at
Gang skin 1, Gang skin 2, Gang skin 3 - Textdraw changes to: GANGSTER

Thanks in advance
For that you can use GameTextForPlayer
https://sampwiki.blast.hk/wiki/GameTextForPlayer
Text Styles https://sampwiki.blast.hk/wiki/GameTextStyle


Re: Textdraw at class selection - needhack - 09.11.2011

And how can I make it appear during the time you have a skin selected?


Re: Textdraw at class selection - grand.Theft.Otto - 09.11.2011

Put it in each case statement:

pawn Code:
GameTextForPlayer(playerid,"~r~mafia skin 1",5000,3);
For example.

~r~ = red
5000 = display for 5 seconds
3 = gametextstyle


Re: Textdraw at class selection - needhack - 09.11.2011

Sorry if I'm not understanding, but where do I have to put this in order to show it when looking at that skin?


Re: Textdraw at class selection - wups - 09.11.2011

public OnPlayerRequestClass(playerid, classid)

Check which classid(skin) is it.


Re: Textdraw at class selection - needhack - 09.11.2011

pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
    if(classid == 111 && (playerid))
    {
        GameTextForPlayer(playerid,"~r~mafia skin 1",5000,3);
        return 0;
    }
    SetPlayerPos(playerid, 2219.1265,-1145.6003,25.7858);
    SetPlayerFacingAngle(playerid, 0.0);
    SetPlayerCameraPos(playerid, 2219.7051,-1142.6036,25.7969);
    SetPlayerCameraLookAt(playerid, 2219.1265,-1145.6003,25.7858);
    return 1;
}
I just checked the wiki gta info about OnPlayerRequestClass and modified it to my skin, doesn't show anything.


Re: Textdraw at class selection - Stigg - 09.11.2011

Try:
pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
    if(classid == 0) GameTextForPlayer(playerid,"~r~cj",2000,5);
    if(classid == 1) GameTextForPlayer(playerid,"~w~truth",2000,5);
    if(classid == 2) GameTextForPlayer(playerid,"~b~maccer",2000,5);
    //Ect...
    return 1;
}
You can change the style here:

https://sampwiki.blast.hk/wiki/GameTextStyle


Re: Textdraw at class selection - needhack - 09.11.2011

This is my code:

pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
    if(classid == 111) GameTextForPlayer(playerid,"~r~Mafia 1",2000,5);
    SetPlayerPos(playerid, 2219.1265,-1145.6003,25.7858);
    SetPlayerFacingAngle(playerid, 0.0);
    SetPlayerCameraPos(playerid, 2219.7051,-1142.6036,25.7969);
    SetPlayerCameraLookAt(playerid, 2219.1265,-1145.6003,25.7858);
    return 1;
}
And this is how my class selection looks like, still no text while looking at it (Check attachment)

Help would be appreciated, many thanks in advance!


Re: Textdraw at class selection - needhack - 10.11.2011

Sorry for the bump but I can really use some help right here because I'm stuck