Textdraw
#1

So i made a phone textdraw to show if phone is on/off:

pawn Код:
Phone Status: ~r~%s
My question is, i wanna make it if is ON, color should be ~g~, otherwise ~r~ (as above).

How?

I use: Player[playerid][PhoneStatus] = 0/1;

Thanks.
Reply
#2

Quote:
Originally Posted by KinderClans
Посмотреть сообщение
So i made a phone textdraw to show if phone is on/off:

pawn Код:
Phone Status: ~r~%s
My question is, i wanna make it if is ON, color should be ~g~, otherwise ~r~ (as above).

How?

I use: Player[playerid][PhoneStatus] = 0/1;

Thanks.
I don't know if I'm right, but you can try something like

PHP код:
if(pInfo[playerid][PhoneStatus] = 0)
{
Phone Status: ~r~%s(pInfo[playerid][PhoneStatus]);
}
else {
Phone Status: ~G~%spInfo[playerid][PhoneStatus]);

and you can set in a stock cases to set their names (ON/OFF) instead of (1/0)
PHP код:
Case 0ON
Case 1OFF 
As I said, I haven't worked for a long time with textdraws, and I don't even know if it's a good ideea, but it's a start
Reply
#3

No that's not what i want. About the stock, i already do it.
Reply
#4

PHP код:
if(Player[playerid][PhoneStatus] == 0)
{
    new 
string[50];
    
format(stringsizeof(string), "Phone Status: ~r~OFF");
    
TextDrawSetString(yourtextdrawstring); // Change "yourtextdraw" to how you defined your phone textdraw
}
else
{
    new 
string[50];
    
format(stringsizeof(string), "Phone Status: ~g~ON");
    
TextDrawSetString(textdrawstring);  // Change "yourtextdraw" to how you defined your phone textdraw

What about this?
Reply
#5

Because i don't have only "phone status" in that textdraw. I have other info too. I'm sure there is a way, i found it long time ago.

Something like this.

pawn Код:
PlayerData[targetid][pGender] == 2) ? ("Female") : ("Male"),
Reply
#6

PHP код:
new phonestatus[32];
if(
Player[playerid][PhoneStatus] == 0) { phonestatus"{FF0000}OFF"; }
else if(
Player[playerid][PhoneStatus] == phonestatus"{00AA00}ON"; }
else { 
phonestatus"OFF"; } 
This is what I use sometimes and it works fine for me, you can try it.
Reply
#7

Quote:
Originally Posted by KinderClans
Посмотреть сообщение
Because i don't have only "phone status" in that textdraw. I have other info too. I'm sure there is a way, i found it long time ago.

Something like this.

pawn Код:
PlayerData[targetid][pGender] == 2) ? ("Female") : ("Male"),
Do you mean this?
https://sampforum.blast.hk/showthread.php?tid=216730
Reply
#8

PHP код:
Player[playerid][PhoneStatus] ? ("ON") : ("OFF"
Reply
#9

Quote:
Originally Posted by Undef1ned
Посмотреть сообщение
PHP код:
Player[playerid][PhoneStatus] ? ("ON") : ("OFF"
maybe like this
Код:
new status[30];
status = Player[playerid][PhoneStatus] ? ("~w~ON") : ("~w~OFF");
Reply
#10

He knows how to add the colors. Also why create a chain?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)