Hello -
Hybris - 04.03.2015
Hello,I need a /v command which spawns a nrg and after the player exits the nrg it gets destroyed +rep for the one who can provide me with this command.
Best regards,
Re: Hello -
Hybris - 05.03.2015
*bump*
Re: Hello -
Sledgehammer - 05.03.2015
Even though this should be under scripting help, the code to do such thing should be:
pawn Код:
#include <a_samp>
#include <zcmd>
new PlayerVehicle[MAX_PLAYERS];
CMD:v(playerid, params[])
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
PlayerVehicle[playerid] = CreateVehicle(522, x, y, z, 0, 0, 0, -1);
return 1;
}
public OnPlayerConnect(playerid)
{
PlayerVehicle[playerid] = -1;
return 1;
}
public OnPlayerExitVehicle(playerid)
{
DestroyVehicle(PlayerVehicle[playerid]);
return 1;
}
Code not tested, however adjust it to your needs.
Re: Hello -
Hybris - 05.03.2015
doesn't
Код:
public OnPlayerExitVehicle(playerid)
{
DestroyVehicle(PlayerVehicle[playerid]);
return 1;
}
destroy server spawned vehicles or only vehicles spawned by the command?
Re: Hello -
CalvinC - 05.03.2015
Quote:
PlayerVehicle[playerid] = CreateVehicle
DestroyVehicle(PlayerVehicle[playerid])
|
It declares the PlayerVehicle for the playerid that used the command as the vehicle created.
And then it destroys that vehicle, for the specific player.
So no it doesn't destroy all vehicles.
Re: Hello -
Hybris - 05.03.2015
ok thanks +rep for both
Re: Hello -
Hybris - 05.03.2015
One more question how do I make it spawn infront of me not ontop of me?
Re: Hello -
CalvinC - 05.03.2015
Just plus the x or y coordinate by like 2 or 3
pawn Код:
CreateVehicle(522, x, y, z
To
pawn Код:
CreateVehicle(522, x + 3, y, z
Re: Hello -
Hybris - 05.03.2015
and if I would want it to put me automaticly in the vehicle what would I have to do I tried adding to the command
PutPlayerInVehicle(playerid, 522, 0);
but it still doesnt automaticly put me in the driver seat
Re: Hello -
CalvinC - 05.03.2015
No, the vehicle was defined as
PlayerVehicle[playerid]
So you have to
PutPlayerInVehicle(playerid, PlayerVehicle[playerid], 0);