Textdraw shows for everyone?.... - 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 shows for everyone?.... (
/showthread.php?tid=172521)
Textdraw shows for everyone?.... -
bartje01 - 30.08.2010
Hey guys. I want that when you enter a bus only the person that enters it will have the textdraw.
But when I enter it other people have it too.
pawn Код:
public busstart()
{
for(new i; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
TextDrawShowForPlayer(i, Textdraw1);
TogglePlayerControllable(i,0);
}
}
return 1;
}
What's wrong now?
Re: Textdraw shows for everyone?.... -
CyNiC - 30.08.2010
pawn Код:
public busstart()
{
for(new i; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if( IsPlayerInVehicle(i, ID_OF_BUS) )
{
TextDrawShowForPlayer(i, Textdraw1);
TogglePlayerControllable(i,0);
}
}
}
return 1;
}
Re: Textdraw shows for everyone?.... -
bartje01 - 30.08.2010
ok. Then how about this one?
pawn Код:
public nowhavelic2()
{
for(new i; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
TextDrawHideForPlayer(i, nowhavelic);
}
}
return 1;
}
Re: Textdraw shows for everyone?.... -
bartje01 - 30.08.2010
Sorry for this fast bump but I need this. Otherwhise I can't go on scripting.
Re: Textdraw shows for everyone?.... -
CyNiC - 30.08.2010
What your code does? And what want do with him?
Re: Textdraw shows for everyone?.... -
bartje01 - 30.08.2010
at onplayerentercheckpoint blahblah.
pawn Код:
else if(carlicbusy[playerid] == 7)
{
carlicbusy[playerid] = 0;
carlic[playerid] = 1;
SendClientMessage(playerid,COLOR_YELLOW,"Gefeliciteerd, je hebt je rijbewijs gehaald!");
TextDrawHideForPlayer(playerid, carlicdraw);
TextDrawHideForPlayer(playerid, nowhavelic);
SetTimer("nowhavelic2",3000,false);
}
When you drive in that checkpoint the textdraw shows up.
Here it's gone.
pawn Код:
public nowhavelic2()
{
for(new i; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
TextDrawHideForPlayer(i, nowhavelic);
}
}
return 1;
}
But with that code it will closes for everyone and not for only the player that is done.
Re: Textdraw shows for everyone?.... -
CAR - 30.08.2010
First the Textdraw isn't shown when you get your Driving License:
Change this line:
pawn Код:
TextDrawHideForPlayer(playerid, nowhavelic);
To this:
pawn Код:
TextDrawShowForPlayer(playerid, nowhavelic);
Then you need to get the ID in your public function so like this:
pawn Код:
forward nowhavelic2(playerid);
public nowhavelic2(playerid)
{
if(IsPlayerConnected(playerid))
{
TextDrawHideForPlayer(playerid, nowhavelic);
}
return 1;
}
Now we need to send the player ID in the timer like this:
pawn Код:
SetTimerEx("nowhavelic2",3000,false, "i", playerid);
Hope it works!
Re: Textdraw shows for everyone?.... -
bartje01 - 30.08.2010
WORKS
Thankyuaa