
new Float:x, Float:y, Float:z, Float:ang;
new VehicleID = GetPlayerVehicleID(playerid);
new cmd[128];
if(strcmp(cmd, "/Infernus", true) == 0)
{
if (!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, 0xFFFF00FF, "You are already inside a vehicle.");
return 1;
}
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, ang);
CreateVehicle(411, x+1, y+1, z+1, 0, 0, 0, 600);
SetVehicleZAngle(VehicleID, ang);
return 1;
}
PutPlayerInVehicle(playerid, CreateVehicle(411, x+1, y+1, z+1, 0, 0, 0, 600), 0);

?
|
thx it worked with a little editing
![]() another question i want to ask about: When the cars explode they respawn the place i wrote /infernus. how can i get them removed when they explode ? |
.//Put In The Top of your GameMode:
new CreatedVehicleVar[MAX_PLAYERS];
//In your command, change this line:
CreateVehicle(411, x+1, y+1, z+1, 0, 0, 0, 600);
//for:
CreatedVehicleVar[playerid] = CreateVehicle(411, x+1, y+1, z+1, 0, 0, 0, 600);
//And at least, put it in OnVehicleDeath callback:
for(new x = 0; x < MAX_PLAYERS; x++)
{
if(CreatedVehicleVar[x] == vehicleid)
{
DestroyVehicle(vehicleid);
}
}
?
new Float:x, Float:y, Float:z, Float:ang;
new VehicleID = GetPlayerVehicleID(playerid);
if (strcmp("/infernus", cmdtext, true, 10) == 0)
{
if (IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, 0xAA3333AA, "( ! ) You are already inside a vehicle.");
return 1;
}
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, ang);
SetVehicleZAngle(VehicleID, ang);
PutPlayerInVehicle(playerid, CreateVehicle(411, x+1, y+1, z+1, 0, 123, 123, 600), 0);
return 1;
}