SA-MP Forums Archive
OnPlayerEnterVehicle - 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: OnPlayerEnterVehicle (/showthread.php?tid=625753)



OnPlayerEnterVehicle - Ramin - 05.01.2017

PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    if((
vehicleid) == 447)
    {
          
TogglePlayerControllable(playeridtrue);
        
SendClientMessage(playerid,COLOR_RED,"Bayad Level 14 Bashi Ta Betooni Savar Shi");
    }
    return 
1;

Not to enter the ring


Re: OnPlayerEnterVehicle - ISmokezU - 05.01.2017

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { 
    if(GetVehicleModel(vehicleid) == 447)  { 
      TogglePlayerControllable(playerid, true); 
      SendClientMessage(playerid,COLOR_RED,"Bayad Level 14 Bashi Ta Betooni Savar Shi"); 
    } return 1; 
}



Re: OnPlayerEnterVehicle - Ramin - 06.01.2017

Thank You <3


Re: OnPlayerEnterVehicle - BiosMarcel - 06.01.2017

Hope i am not confusing something here, but:

I'd suggest using OnPlayerStateChange instead, because you can check if the player actually entered a vehicle.
Look at OnPlayerEnterVehicle - "This callback is called when a player starts to enter a vehicle, meaning the player is not in vehicle yet at the time this callback is called."

I am probably am confusing something, sorry in advance.


Re: OnPlayerEnterVehicle - saffierr - 06.01.2017

Quote:
Originally Posted by [Bios]Marcel
Посмотреть сообщение
Hope i am not confusing something here, but:

I'd suggest using OnPlayerStateChange instead, because you can check if the player actually entered a vehicle.
Look at OnPlayerEnterVehicle - "This callback is called when a player starts to enter a vehicle, meaning the player is not in vehicle yet at the time this callback is called."

I am probably am confusing something, sorry in advance.
You're not confusing it, your suggest is optional though, depends on what he wants.


Re: OnPlayerEnterVehicle - BiosMarcel - 06.01.2017

Quote:
Originally Posted by saffierr
Посмотреть сообщение
You're not confusing it, your suggest is optional though, depends on what he wants.
Well, i was confused , because he used TogglePalyerControllable(playerid, true);, so maybe he wants to prevent the player from entering specific vehicles (can't rellay judge cause i dont speak his language and he didnt provide further info)