09.05.2010, 07:22
So I am fairly new to PAWNO, I just started a couple of months ago, but I'm picking it up pretty quick. I am stuck with a certain part that I am adding into the script for level 9+ admins. I'm making it so they can spawn a hydra at any time, I have the whole spawning part working fine but removing it entirely when they exit the Hydra is something I can't figure out... As well as locking the vehicle when it spawns so that it can't be jacked.
I looked around on the forums and tried many methods that people have posted, which includes assigning a timer with DestroyVehicle and OnPlayerExitVehicle. I have removed all the attempts I made, this script just spawns the hydra with the player inside.
Any help would be much appreciated :P
I looked around on the forums and tried many methods that people have posted, which includes assigning a timer with DestroyVehicle and OnPlayerExitVehicle. I have removed all the attempts I made, this script just spawns the hydra with the player inside.
Any help would be much appreciated :P
pawn Код:
dcmd_ahydra(playerid,params[])
{
#pragma unused params
if(Variables[playerid][Level] >= 9 && Variables[playerid][LoggedIn] == true)
{
new Float:X;
new Float:Y;
new Float:Z;
new Float:Angle;
new ahydra;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
ahydra = CreateVehicle(520,X,Y,Z,Angle,-1,-1,-0);
PutPlayerInVehicle(playerid,ahydra,0);
TogglePlayerControllable(playerid,true);
if(GetPlayerInterior(playerid)) LinkVehicleToInterior(ahydra,GetPlayerInterior(playerid));
SetVehicleVirtualWorld(ahydra,GetPlayerVirtualWorld(playerid));
return 1;
}
return 1;
}