25.12.2012, 00:34
Is this possible? By typing a command, a vehicle explodes?
CMD:ve(playerid, params[]) //vehicle explode = ve
{
if(IsPlayerInAnyVehicle(playerid)
{
SetVehicleHealth(vehicleid, 0);
}else{
SendClientMessage(playerid, COLOR_RED, You arent in any vehicle!);
}
}
CMD:explode(playerid, params[])
{
new vehicleid;
if(sscanf(params, "i", vehicleid)) return SendClientMessage(playerid, -1, "/explode [vehicleid]");
if(vehicle == INVALID_VEHICLE_ID) return SendClientMessage(playerid, -1, "Invalid vehicleid");
new Float:x, Float:y, Float:z;
GetVehiclePos(vehicleid, x, y, z);
CreateExplosion(x, y, z, 12, 10.0);
return 1;
}
CMD:explode(playerid, params[])
{
new vehicleid;
if(sscanf(params, "i", vehicleid)) return SendClientMessage(playerid, -1, "/explode [vehicleid]");
if(vehicle == INVALID_VEHICLE_ID) return SendClientMessage(playerid, -1, "Invalid vehicleid");
new engine, lights, alarm, doors, bonnet, boot, objective, Float:x, Float:y, Float:z;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 0, lights, false, doors, bonnet, boot, objective);
GetVehiclePos(vehicleid, x, y, z);
CreateExplosion(x, y, z, 12, 10.0);
return 1;
}
CMD:explode(playerid, params[])
{
new vehicleid;
if(sscanf(params, "i", vehicleid)) return SendClientMessage(playerid, -1, "/explode [vehicleid]");
if(vehicle == INVALID_VEHICLE_ID) return SendClientMessage(playerid, -1, "Invalid vehicleid");
new Float:x, Float:y, Float:z;
GetVehiclePos(vehicleid, x, y, z);
SetVehiclePos(vehicleid, x, y, z);
CreateExplosion(x, y, z, 12, 10.0);
return 1;
}