Help me in Car Respawn
#1

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

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

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

What is an altiro
Reply
#5

Instantly
Reply
#6

up
up
up
Reply
#7

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

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

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)