SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 23/02/2016, 03:01 PM   #1
N0FeaR
High-roller
 
N0FeaR's Avatar
 
Join Date: Nov 2011
Location: Los Santos, Idlewood
Posts: 2,347
Reputation: 152
Default Map name with textdraw

Have some problem try to make textdraw that show location, but the problem is for ex if i am at ganton says i am Idlewood and if i stand still its just showing some random names. i hope u guys can help me out.

PHP Code:
    Mapdraw TextDrawCreate(48.000000326.000000"");
    
TextDrawBackgroundColor(Mapdraw255);
    
TextDrawFont(Mapdraw1);
    
TextDrawLetterSize(Mapdraw0.5000001.200000);
    
TextDrawColor(Mapdraw, -1);
    
TextDrawSetOutline(Mapdraw0);
    
TextDrawSetProportional(Mapdraw1);
    
TextDrawSetShadow(Mapdraw1);
    
TextDrawSetSelectable(Mapdraw0);


stock GetPlayerArea(playerid)
{
    new 
str[128];
    
format(str,sizeof(str),"%s",Zones[GetPlayerZone(playerid)][zone_name]);
    if(
GetPlayerInterior(playerid) > 0)
    {
        if(
GetPVarInt(playerid"GarageEnter") != 1000 && GetPlayerInterior(playerid) == GarageInfo[GetPVarInt(playerid"GarageEnter")][gInterior])
        {
            
format(str,sizeof(str),"%s"GarageInfo[GetPVarInt(playerid"GarageEnter")][gName]);
        }
        else if(
GetPVarInt(playerid"HouseEnter") != 1000 && GetPlayerInterior(playerid) == HouseInfo[GetPVarInt(playerid"HouseEnter")][hInterior])
        {
            
format(str,sizeof(str),"%s"HouseInfo[GetPVarInt(playerid"HouseEnter")][hName]);
        }
        else if(
GetPVarInt(playerid"IntEnter") != 1000 && GetPlayerInterior(playerid) == IntInfo[GetPVarInt(playerid"IntEnter")][iInt])
        {
            
format(str,sizeof(str),"%s"IntInfo[GetPVarInt(playerid"IntEnter")][iName]);
        }
        else if(
GetPVarInt(playerid"BizzEnter") != 1000 && GetPlayerInterior(playerid) == BizzInfo[GetPVarInt(playerid"BizzEnter")][bInterior])
        {
            
format(str,sizeof(str),"%s"BizzInfo[GetPVarInt(playerid"BizzEnter")][bName]);
        }
        else 
str="Interior";
    }
    return 
str;
}
stock GetPlayerZone(playerid)
{
    new 
Float:x,Float:y,Float:z;
    
GetPlayerPos(playerid,x,y,z);
    for(new 
i=0;i<sizeof(Zones);i++)
    {
        if(
Zones[i][zone_minx] && Zones[i][zone_miny] && Zones[i][zone_minz] && Zones[i][zone_maxx] && Zones[i][zone_maxy] && Zones[i][zone_maxz])
        return 
i;
    }
    return 
false;
}
//============================================//
stock LoadAreaPl(playeridtypenum)
{
    new 
string[128];
    switch(
type)
    {
        case 
0format(string128"%s"GetPlayerArea(playerid));
        case 
1format(string128"%s"HouseInfo[num][hName]);
        case 
2format(string128"%s"IntInfo[num][iName]);
        case 
3format(string128"%s"BizzInfo[num][bName]);
        case 
4format(string128"%s"GarageInfo[num][gName]);
        case 
5string="Interior";
    }
    if(
GetPVarInt(playerid,"HudHide") == 0TextDrawSetString(Text:Mapdrawstring);
    
//if(GetPVarInt(playerid,"HudHide") == 0) GameTextForPlayer(playerid, string, 2000, 1);
    
return true;

__________________
Check out this sh*t

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
[Tutorial] Making a Health/armour textdraw! (Global textdraw) -Rebel Son- Tutorials 21 23/10/2017 09:00 AM
[Tutorial] How to make a Textdraw ( Simple Textdraw or Selectable/Clickable Textdraw) Reputation Tutorials 8 18/09/2014 09:52 AM
Moving a textdraw on the y-axis doesn't work. (TextDraw Editor) AndySedeyn Scripting Help 1 14/06/2014 02:50 PM
[FilterScript] [FS] TextDraw editor 0.6 - Multiple textdraw support, for proffesional textdraws Zamaroht Filterscripts 369 20/01/2013 02:46 PM
[Tutorial] --: Creating Textdraw's In The Easiest Way :-- [Helpful for textdraw creators] Nirzor Tutorials 15 04/10/2012 12:32 PM


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


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