24.09.2013, 10:56
PHP код:
LockNearbyVehicles(playerid, Float:radi)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new i=1; i<MAX_VEHICLES; i++)
{
if(GetVehicleModel(i))
{
TimeRunning[i] = 40;
new Float:posx, Float:posy, Float:posz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetVehiclePos(i, posx, posy, posz);
tempposx = (posx - x);
tempposy = (posy - y);
tempposz = (posz - z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
if(i != GetPlayerVehicleID(playerid)) {
GetVehicleParamsEx(i, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(i, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_ON, alarm, doors, bonnet, boot, objective); }
}
}
}
}
PHP код:
forward SecUpdate2();
public SecUpdate2()
{
MafiaCheck();
for(new i =0; i <= MAX_VEHICLES; i++)
{
if(TimeRunning[i] > 0) {
TimeRunning[i]--; }
}
}
HELP :/

