SA-MP Forums Archive
Help me in Car Respawn - 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: Help me in Car Respawn (/showthread.php?tid=659214)



Help me in Car Respawn - Kalciker - 27.09.2018

Hello good community and forum.sa-mp.com, I come to ask for the following help, well the thing is that I want to add to my gamemode.

A user gets on an "x" car and I want to respawn another Instantly, I do not work AddStaticVehicleEx

Please help


Re: Help me in Car Respawn - Gforcez - 27.09.2018

Check OnPlayerEnterVehicle and CreateVehicle, that should give you an idea how to build it


Re: Help me in Car Respawn - Kalciker - 27.09.2018

Hi, could you give me an idea of ​​how to do it? Please, I'm a novice


Re: Help me in Car Respawn - solstice_ - 27.09.2018

What is an altiro


Re: Help me in Car Respawn - Kalciker - 27.09.2018

Instantly


Re: Help me in Car Respawn - Kalciker - 27.09.2018

up
up
up


Re: Help me in Car Respawn - Kaliber - 27.09.2018

Your question is not really clear

So if someone enters a vehicle, this Callback will be called: https://sampwiki.blast.hk/wiki/OnPlayerEnterVehicle

To respawn a vehicle you use https://sampwiki.blast.hk/wiki/SetVehicleToRespawn

So, but now i don't know what vehicle do you wanna respawn?


Re: Help me in Car Respawn - Zeus666 - 27.09.2018

A user gets on an "x" car and I want to respawn another Instantly, I do not work AddStaticVehicleEx


So. If I enter on an INFERNUS, another INFERNUS should SPAWN near me

or

if I enter on an INFERNUS, the infernus which I'm on it should respawn?

or

If I enter on an INFERNUS, my previous last car which i've been on it should respawn?

which one?


Re: Help me in Car Respawn - Kalciker - 27.09.2018

Quote:
Originally Posted by Zeus666
Посмотреть сообщение
A user gets on an "x" car and I want to respawn another Instantly, I do not work AddStaticVehicleEx


So. If I enter on an INFERNUS, another INFERNUS should SPAWN near me

or

if I enter on an INFERNUS, the infernus which I'm on it should respawn?

or

If I enter on an INFERNUS, my previous last car which i've been on it should respawn?

which one?
hi yes, like that
So. If I enter an INFERNUS, another INFERNUS must SPAWN near me in the same spawn of the vehicle that you took out nose if I explain myself


Re: Help me in Car Respawn - Zeus666 - 28.09.2018

PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    new 
string[128], FloatfPos[3];
    
format(stringsizeof(string), "You are spawning near you vehicle id %i"vehicleid);
    
SendClientMessage(playerid, -1string);
      
GetPlayerPos(playerid,fPos[0],fPos[1],fPos[2]);
      
AddStaticVehicle(vehicleidfPos[0]+1fPos[1]+1fPos[2]+10.000)
  

and if you want to work AS ADMIN (only admin can spawn)

PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    if(
PlayerInfo[playerid][AdminLevel] > 4// vehicle will spawn only if admin is greator than  level 4
    
{
    new 
string[128], FloatfPos[3];
    
format(stringsizeof(string), "You are spawning near you vehicle id %i"vehicleid);
    
SendClientMessage(playerid, -1string);
      
GetPlayerPos(playerid,fPos[0],fPos[1],fPos[2]);
      
AddStaticVehicle(vehicleidfPos[0]+1fPos[1]+1fPos[2]+10.000)
      }
  

you must set your "playerinfo" 'adminlevel" as it's in your gamemode