Textdraw shows for everyone?....
#1

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?
Reply
#2

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;
}
Reply
#3

ok. Then how about this one?
pawn Код:
public nowhavelic2()
{
for(new i; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i))
        {
        TextDrawHideForPlayer(i, nowhavelic);
   
        }
    }

return 1;
}
Reply
#4

Sorry for this fast bump but I need this. Otherwhise I can't go on scripting.
Reply
#5

What your code does? And what want do with him?
Reply
#6

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.
Reply
#7

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!
Reply
#8

WORKS Thankyuaa
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)