Textdraw - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Textdraw (
/showthread.php?tid=658972)
Textdraw -
KinderClans - 18.09.2018
So i made a phone textdraw to show if phone is on/off:
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.
Re: Textdraw -
Zeus666 - 18.09.2018
Quote:
Originally Posted by KinderClans
So i made a phone textdraw to show if phone is on/off:
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 0: ON
Case 1: OFF
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
Re: Textdraw -
KinderClans - 18.09.2018
No that's not what i want. About the stock, i already do it.
Re: Textdraw -
solstice_ - 18.09.2018
PHP код:
if(Player[playerid][PhoneStatus] == 0)
{
new string[50];
format(string, sizeof(string), "Phone Status: ~r~OFF");
TextDrawSetString(yourtextdraw, string); // Change "yourtextdraw" to how you defined your phone textdraw
}
else
{
new string[50];
format(string, sizeof(string), "Phone Status: ~g~ON");
TextDrawSetString(textdraw, string); // Change "yourtextdraw" to how you defined your phone textdraw
}
What about this?
Re: Textdraw -
KinderClans - 18.09.2018
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"),
Re: Textdraw -
solstice_ - 18.09.2018
PHP код:
new phonestatus[32];
if(Player[playerid][PhoneStatus] == 0) { phonestatus= "{FF0000}OFF"; }
else if(Player[playerid][PhoneStatus] == 1 { phonestatus= "{00AA00}ON"; }
else { phonestatus= "OFF"; }
This is what I use sometimes and it works fine for me, you can try it.
Re: Textdraw -
v1k1nG - 19.09.2018
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
Re: Textdraw -
Undef1ned - 19.09.2018
PHP код:
Player[playerid][PhoneStatus] ? ("ON") : ("OFF")
Re: Textdraw -
UFF - 19.09.2018
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");
Re: Textdraw -
Undef1ned - 19.09.2018
He knows how to add the colors. Also why create a chain?