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(playerid, vehicleid, ispassenger)
{
new string[128], Float: fPos[3];
format(string, sizeof(string), "You are spawning near you vehicle id %i", vehicleid);
SendClientMessage(playerid, -1, string);
GetPlayerPos(playerid,fPos[0],fPos[1],fPos[2]);
AddStaticVehicle(vehicleid, fPos[0]+1, fPos[1]+1, fPos[2]+1, 0.0, 0, 0)
}
and if you want to work AS ADMIN (only admin can spawn)
PHP код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(PlayerInfo[playerid][AdminLevel] > 4) // vehicle will spawn only if admin is greator than level 4
{
new string[128], Float: fPos[3];
format(string, sizeof(string), "You are spawning near you vehicle id %i", vehicleid);
SendClientMessage(playerid, -1, string);
GetPlayerPos(playerid,fPos[0],fPos[1],fPos[2]);
AddStaticVehicle(vehicleid, fPos[0]+1, fPos[1]+1, fPos[2]+1, 0.0, 0, 0)
}
}
you must set your "playerinfo" 'adminlevel" as it's in your gamemode