TextDrawHideForPlayer when player change skin in class chaning mode.
#1

Hello, I've created a TextDraw that's saying a skin ID when a player is choosing a skin at OnPlayerRequestClass. But I want to make it dissapear whenever new skin is appearing, now they're overlap on each other.

Код:
public OnPlayerRequestClass(playerid, classid)
{

new string[16];
format(string, sizeof(string), "~y~ID: %d", classid);

new Text: SKIN_ID;
TextDrawSetShadow(SKIN_ID, 1);

SKIN_ID = TextDrawCreate(297, 100, string);

    SetPlayerPos(playerid, 2503.7522,-1667.3984,13.3655);
    SetPlayerFacingAngle(playerid, 90);
    SetPlayerCameraPos(playerid, 2498.7522,-1667.3984,13.3655);
    SetPlayerCameraLookAt(playerid,2503.7522,-1667.3984,13.3655);
    TextDrawShowForPlayer(playerid, SKIN_ID); 


    
    return 1;
}
Код:
public OnGameModeInit()
{
    for(new i = 0; i < 312; i++)
    {
        AddPlayerClass(i,2503.7522,-1667.3984,13.3655,95.4930,0,0,0,0,0,0);
    }
return 1;
}
Reply
#2

Try adding TextDrawHideForPlayer(playerud, SKIN_ID); before the TextDrawShowForPlayer(playerid, SKIN_ID);
Reply
#3

Quote:
Originally Posted by AndreiWow
Посмотреть сообщение
Try adding TextDrawHideForPlayer(playerud, SKIN_ID); before the TextDrawShowForPlayer(playerid, SKIN_ID);
Doesn't help.
Reply
#4

I have created a sample Textdraw and it is for each player, according to me this is how you should create this type of textdraws

PHP код:
new PlayerText:Textdraw0[MAX_PLAYERS]; 
PHP код:
public OnPlayerConnect(playerid)
{
    
Textdraw0[playerid] = CreatePlayerTextDraw(playerid,320.000000360.000000"Id: 100");
    
PlayerTextDrawAlignment(playerid,Textdraw0[playerid], 2);
    
PlayerTextDrawBackgroundColor(playerid,Textdraw0[playerid], 255);
    
PlayerTextDrawFont(playerid,Textdraw0[playerid], 2);
    
PlayerTextDrawLetterSize(playerid,Textdraw0[playerid], 0.7000003.000000);
    
PlayerTextDrawColor(playerid,Textdraw0[playerid], -1); 
    
PlayerTextDrawSetOutline(playerid,Textdraw0[playerid], 1); 
    
PlayerTextDrawSetProportional(playerid,Textdraw0[playerid], 1);
    
PlayerTextDrawSetSelectable(playerid,Textdraw0[playerid], 0);    
    return 
1;

PHP код:
PlayerTextDrawShow(playeridTextdraw0[playerid]) //Add this wherever you want the TextDraw to be displayed, for example when the player is connected 
PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    new 
string[16];
    
format(stringsizeof(string), "~y~ID: %d"classid);
    
SetPlayerPos(playerid2503.7522,-1667.3984,13.3655);
    
SetPlayerFacingAngle(playerid90);
    
SetPlayerCameraPos(playerid2498.7522,-1667.3984,13.3655);
    
SetPlayerCameraLookAt(playerid,2503.7522,-1667.3984,13.3655);
    
PlayerTextDrawSetString(playeridTextdraw0[playerid], string); 
    return 
1;

This to hide the textdraw

PHP код:
PlayerTextDrawHide(playeridTextdraw0[playerid]); 
Here you can see all the functions that the PlayerTextDraw has
https://sampwiki.blast.hk/wiki/PlayerTextDrawShow
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)