19.03.2016, 16:48
Problem 1 :
Problem 2 :
PHP код:
CMD:alock(playerid, params[])
{
if( pInfo[playerid][pAdmin] < 1 )
return 0;
new vehicleid;
if( sscanf(params, "u", vehicleid ))
return SendUsageError( playerid, "/alock [Vehicle ID]" );
if(!IsValidVehicle(vehicleid)) return 1; // Check if the veh exist
SendClientMessage(playerid, 0xBF60FFFF, "You have locked the doors on this vehicle");
static
engine,
lights,
alarm,
doors,
bonnet,
boot,
objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, engine, lights, alarm, 1, bonnet, boot, objective);
return 1;
}
PHP код:
new
spawnedcar[MAX_VEHICLES];
stock CreateVehicleEx(playerid, modelid)
{
new
world = GetPlayerVirtualWorld(playerid),
interior = GetPlayerInterior(playerid),
Float:x, Float:y, Float:z, Float:a,
vehicleid;
GetPlayerPos(playerid, x,y,z);
GetPlayerFacingAngle(playerid, a);
vehicleid = CreateVehicle(modelid, x+3,y,z, a, -1, -1, -1);
spawnedcar[vehicleid] = 1;
LinkVehicleToInterior(spawnedcar, interior);
SetVehicleVirtualWorld(spawnedcar, world);
PutPlayerInVehicle(playerid, spawnedcar, 0);
SetPlayerInterior(playerid, interior);
return 1;
}
if(spawnedcar[GetPlayerVehicleID(playerid)] != 1)
return Error(playerid, "You can only delete spawned vehicles");