Textdraw problem - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Textdraw problem (
/showthread.php?tid=125197)
Textdraw problem -
hardstop - 02.02.2010
How to make Textdraw showing When Certain Gate is opened or closed
When the gate is opened the Textdraw says Trader: OPENED
and when Gate is closed the textdraw says Trader: CLOSED
[
I know how to make a textdraw but
i dont know how to make textdraw show when OPENED and when CLOSED ]
Re: Textdraw problem - [03]Garsino - 02.02.2010
Just create a variable
pawn Код:
if(MyVariable == 1)
{
MyTextdraw = TextDrawCreate(155.000000, 119.000000, "Gate Status: Opened");
}
if(MyVariable == 0)
{
MyTextdraw = TextDrawCreate(155.000000, 119.000000, "Gate Status: Closed");
}
Re: Textdraw problem -
hardstop - 02.02.2010
Where i have to put it under, I dont understand
Re: Textdraw problem -
Miguel - 02.02.2010
pawn Код:
MyTextdraw = TextDrawCreate(155.000000, 119.000000, "Gate Status: Opened");
At the moment of opening the gate.
pawn Код:
MyTextdraw = TextDrawCreate(155.000000, 119.000000, "Gate Status: Closed");
At the moment of closing the gate.
EG:
pawn Код:
OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/open", true) == 0)
{
// the code to open the gate
MyTextdraw = TextDrawCreate(155.000000, 119.000000, "Gate Status: Opened");
return 1;
}
else if(strcmp(cmdtext, "/close", true) == 0)
{
// code to close the gate
MyTextdraw = TextDrawCreate(155.000000, 119.000000, "Gate Status: Closed");
return 1;
}
return 0;
}
Re: Textdraw problem -
hardstop - 02.02.2010
Gate opens automatically in 3 minutes and closes in 1 minute
GATE IS NOT CONTROLLED BY COMMAND
Re: Textdraw problem - [03]Garsino - 02.02.2010
Show us your gate code.
Re: Textdraw problem -
hardstop - 02.02.2010
forward Traders();
Under OnGameModeInit:
Код:
SetTimer("Traders",180000,true);
Код:
public Traders()
{
print("Traders doors are now open");
MoveObject(Trader1,0.0,0.0,0.0,1.5000);
SetTimer("close",100000,false);
//Opens every 3min Closes every 10 Sec
}
forward close();
public close()
{
print("Traders doors are now closed");
MoveObject(Trader1,1644.0217285156, -1714.6821289063, 15.864986419678,1.5000);
}
Re: Textdraw problem -
LuxurioN™ - 02.02.2010
Try this (
Not Tested):
In Top:
pawn Код:
new Text: GateStats[MAX_PLAYERS];
InOnGameModeInit:
pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
GateStats[i] = TextDrawCreate(155.000000, 119.000000, " ");
}
//Your complete TextDraw code...
In "Traders":
pawn Код:
public Traders()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
TextDrawShowForPlayer(playerid, GateStats[i]);
TextDrawSetString(GateStats[i], "Gate Status: Opened!");
}
print("Traders doors are now open");
MoveObject(Trader1,0.0,0.0,0.0,1.5000);
SetTimer("close",100000,false);
}
In "close":
pawn Код:
public close()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
TextDrawSetString(GateStats[i], "Gate Status: Closing!");
}
print("Traders doors are now closed");
SetTimer("HideTD",5000,false);
MoveObject(Trader1,1644.0217285156, -1714.6821289063, 15.864986419678,1.5000);
}
And "HideTD":
pawn Код:
public HideTD()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
TextDrawHideForPlayer(playerid, GateStats[i]);
}