SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 12/01/2016, 07:27 PM   #1
N0FeaR
High-roller
 
N0FeaR's Avatar
 
Join Date: Nov 2011
Location: Los Santos, Idlewood
Posts: 2,347
Reputation: 152
Default Label with textdraw help

EDIT: Sloved!


When i go near the house is show once the label and then is disappear and then wont show up again


PHP Code:
stock CreateLableText(playerid,lable[],text[])
{
    if(
GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return 1;
    new 
string[128];
    if(
GetPVarInt(playerid"LableDraw") > 0)
    {
        
TextDrawSetString(Text:LableDraw[playerid],lable);
        
format(stringsizeof(string),"~n~~n~%s~n~~n~",text);
        return 
TextDrawSetString(Text:UsedDraw[playerid],string);
    }
    
PlayerPlaySound(playerid,10540.00.00.0);
    
TextDrawHideForPlayer(playerid,LableDraw[playerid]);
    
TextDrawShowForPlayer(playerid,LableDraw[playerid]);
    
TextDrawSetString(Text:LableDraw[playerid],lable);
    
TextDrawDestroy(UsedDraw[playerid]);
    
UsedDraw[playerid] = TextDrawCreate(440.000000,173.000000," ");
    
TextDrawUseBox(UsedDraw[playerid],1);
    
TextDrawBoxColor(UsedDraw[playerid],0x00000066);
    
TextDrawTextSize(UsedDraw[playerid],636.000000,308.000000);
    
TextDrawAlignment(UsedDraw[playerid],0);
    
TextDrawBackgroundColor(UsedDraw[playerid],0x000000ff);
    
TextDrawFont(UsedDraw[playerid],2);
    
TextDrawLetterSize(UsedDraw[playerid],0.300000,1.000000);
    
TextDrawColor(UsedDraw[playerid],0xffffffff);
    
TextDrawSetOutline(UsedDraw[playerid],1);
    
TextDrawSetProportional(UsedDraw[playerid],1);
    
TextDrawSetShadow(UsedDraw[playerid],1);
    
TextDrawShowForPlayer(playerid,UsedDraw[playerid]);
    
format(stringsizeof(string),"~n~~n~%s~n~~n~",text);
    
TextDrawSetString(Text:UsedDraw[playerid],string);
    
KillTimer(HideBox[playerid]);
    
HideBox[playerid] = SetTimerEx("HideTextBox"1000false"i"playerid);
    return 
SetPVarInt(playerid"LableDraw"4);

PHP Code:
}
forward HideTextBox(playerid);
public 
HideTextBox(playerid)
{
    
TextDrawHideForPlayer(playerid,LableDraw[playerid]);
    
TextDrawHideForPlayer(playerid,UsedDraw[playerid]);
    return 
1;


PHP Code:
forward OnPlayerPickUpDynamicPickup(playeridpickupid);
public 
OnPlayerPickUpDynamicPickup(playeridpickupid)
{
    for(new 
0sizeof(HouseInfo); h++)
    {
        if(
IsPlayerInRangeOfPoint(playerid,2.0,HouseInfo[h][hExteriorX],HouseInfo[h][hExteriorY],HouseInfo[h][hExteriorZ]))
        {
            if(
GetPlayerVirtualWorld(playerid) == HouseInfo[h][hExtVW])
            {
                switch(
HouseInfo[h][hOwned])
                {
                    case 
0:
                    {
                        new 
string[258];
                        
format(stringsizeof(string), " ~r~Property For Sale!~n~ ~g~Value: ~w~$%d~n~ ~g~Level: ~w~%d~n~ ~g~ID: ~w~%d~n~~n~ Type ~g~/house buy."HouseInfo[h][hValue], HouseInfo[h][hLevel], HouseInfo[h][hSQLId]);
                        
CreateLableText(playerid,"Property",string);
                    }
                    case 
1:
                       {
                           new 
string[258];
                        new 
price[50];
                        if(
HouseInfo[h][hValue] <= 1price="Donated";
                        else 
format(price50"$%d"HouseInfo[h][hValue]);
                        switch(
HouseInfo[h][hRentable])
                        {
                            case 
0format(stringsizeof(string), " ~g~Owner: ~w~%s~n~ ~g~Value: ~w~%s"HouseInfo[h][hOwned], price);
                            case 
1format(stringsizeof(string), " ~g~Owner: ~w~%s~n~ ~g~Rent: ~w~$%d~n~~n~ Type ~g~/house rent ~w~to~n~ rent."HouseInfo[h][hOwned], HouseInfo[h][hRentFee]);
                        }
                        
CreateLableText(playerid,"Property",string); 
__________________
Check out this sh*t


Last edited by N0FeaR; 12/01/2016 at 09:03 PM.
N0FeaR is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Name label iShawn Scripting Help 4 05/11/2014 03:08 PM
[FilterScript] AFK System with 3D Text Label and Textdraw aizeah555 Filterscripts 11 30/10/2014 05:18 PM
[Tutorial] How to make a Textdraw ( Simple Textdraw or Selectable/Clickable Textdraw) Reputation Tutorials 8 18/09/2014 09:52 AM
Label bug Sliceofdeath Scripting Help 0 13/09/2013 04:33 PM


All times are GMT. The time now is 03:32 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.