Textdraw at class selection
#1

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

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

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

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

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

public OnPlayerRequestClass(playerid, classid)

Check which classid(skin) is it.
Reply
#7

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

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

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!
Reply
#10

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


Forum Jump:


Users browsing this thread: 2 Guest(s)