SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 22/08/2019, 09:02 AM   #1
Mohaowmad
Little Clucker
 
Join Date: Oct 2018
Posts: 48
Reputation: 0
Default Textdraw issue

Hello
I Have These
& When i Spawn Textdraw Won't Show UP

PHP Code:

forward SetClass
(playerid);
#define MAX_CLASSES 10
#define CLASS_SOLDIER 1

new ClassName[MAX_CLASSES][10];
new 
Text:Class[MAX_CLASSES];

public 
OnGameModeInit()
{
       
SetTimer("SetClass",1000,true);
       
format(ClassName[CLASS_SOLDIER],10"Soldier");
       return 
1;
}

public 
OnPlayerConnect(playerid)
{
    Class[
playerid] = TextDrawCreate(4.400009428.586547"-------------");
    return 
1;
}

public 
SetClass(playerid)
{
        new 
string[256];
        
format(stringsizeof string"%s"ClassName[playerid]);
        
TextDrawSetString(Class[playerid], string);

Mohaowmad is offline   Reply With Quote
Old 22/08/2019, 09:11 AM   #2
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,064
Reputation: 50
Default Re: HELP

You have to use TextDrawShowForPlayer to show, later use TextDrawHideForPlayer to hide it.

in SetClass, use TextDrawShowForPlayer(playerid, Class[playerid]);
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Old 22/08/2019, 09:21 AM   #3
Mohaowmad
Little Clucker
 
Join Date: Oct 2018
Posts: 48
Reputation: 0
Default Re: HELP

Hello Again
i Have TextDrawShowForPlayer(playerid, Class[playerid]); in OnPlayerSpawn
But Doesen't Work :/
Mohaowmad is offline   Reply With Quote
Old 22/08/2019, 11:58 AM   #4
Mohaowmad
Little Clucker
 
Join Date: Oct 2018
Posts: 48
Reputation: 0
Default Re: Textdraw issue

Anyone :/
Mohaowmad is offline   Reply With Quote
Old 22/08/2019, 12:55 PM   #5
Plastikmensch
Huge Clucker
 
Join Date: Aug 2016
Posts: 270
Reputation: 22
Default Re: Textdraw issue

You should use player textdraws.
Code:
new PlayerText:Class;

Class[playerid] = PlayerTextDrawCreate(4.400009, 428.586547, "-------------"); 
//etc
Plastikmensch is offline   Reply With Quote
Old 22/08/2019, 01:03 PM   #6
Mohaowmad
Little Clucker
 
Join Date: Oct 2018
Posts: 48
Reputation: 0
Default Re: Textdraw issue

oh my mistake
thanks, that worked!
Mohaowmad 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
textdraw issue alexanderjb918 Scripting Help 2 25/02/2016 01:11 PM
Textdraw issue kevin1990 Scripting Help 5 25/03/2015 12:51 AM
Textdraw issue Ananisiki Scripting Help 3 29/08/2013 03:42 AM
Textdraw issue Zaila Scripting Help 4 16/10/2012 09:28 AM
Textdraw issue STMatt Scripting Help 3 23/12/2011 11:01 AM


All times are GMT. The time now is 06:38 AM.


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