SA-MP Forums Archive
Problem : Enter the car at death - 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: Problem : Enter the car at death (/showthread.php?tid=635645)



Problem : Enter the car at death - wilking - 11.06.2017

I want after death, enter a car next door will be disabled.
Please ask the Pro help .


Re: Problem : Enter the car at death - Kane - 11.06.2017

Not sure what you're saying.

Do you want cars to be locked for a player after they die?


Re: Problem : Enter the car at death - wilking - 11.06.2017

Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
Not sure what you're saying.

Do you want cars to be locked for a player after they die?
Yup , I want cars to be locked for a player after die.


Re: Problem : Enter the car at death - wilking - 11.06.2017

help me , Pls


Re: Problem : Enter the car at death - Whatname - 11.06.2017

Will lock all cars for player if he died in a car

PHP код:

public OnPlayerDeath(playerid)
{
     if(
IsPlayerInAnyVehicle(playerid))
     {
         for(new 
0MAX_VEHICLESi++)
         {
             
SetVehicleParamsForPlayer(iplayerid01);
         }
     }
     return 
1;

or lock only the car player died in

PHP код:
public OnPlayerDeath(playerid)
{
     if(
IsPlayerInAnyVehicle(playerid))
     {
          
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), playerid01);
     }
     return 
1;




Re: Problem : Enter the car at death - wilking - 11.06.2017

Quote:
Originally Posted by Whatname
Посмотреть сообщение
Will lock all cars for player if he died in a car

PHP код:

public OnPlayerDeath(playerid)
{
     if(
IsPlayerInAnyVehicle(playerid))
     {
         for(new 
0MAX_VEHICLESi++)
         {
             
SetVehicleParamsForPlayer(iplayerid01);
         }
     }
     return 
1;

or lock only the car player died in

PHP код:
public OnPlayerDeath(playerid)
{
     if(
IsPlayerInAnyVehicle(playerid))
     {
          
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), playerid01);
     }
     return 
1;

It is normal, when death is still enter the car next door.
Is there any other solution?


Re: Problem : Enter the car at death - Dokins - 11.06.2017

Quote:
Originally Posted by Whatname
Посмотреть сообщение
Will lock all cars for player if he died in a car

PHP код:

public OnPlayerDeath(playerid)
{
     if(
IsPlayerInAnyVehicle(playerid))
     {
         for(new 
0MAX_VEHICLESi++)
         {
             
SetVehicleParamsForPlayer(iplayerid01);
         }
     }
     return 
1;

or lock only the car player died in

PHP код:
public OnPlayerDeath(playerid)
{
     if(
IsPlayerInAnyVehicle(playerid))
     {
          
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), playerid01);
     }
     return 
1;

This may not work to be honest as players get removed from vehicles upon death, the best method would be to create a variable of the last vehicle ID then OnPlayerDeath, use that variable to set params.


Re: Problem : Enter the car at death - Private200 - 12.06.2017

I think he is trying to say that he does not want players to enter the car next to them after dying. But this is not possible by default, unless you are using some roleplay script which forces player into 'injured' mode and forces them an animation.