05.12.2015, 13:02
Alright so the problem is quite simple. Im able to attach these lights on my truck but unable to detach them. It entirely ignores the check before the last one ie: vAttachedSiren[vid]
Maybe Im making some really small mistake and I cant see it (havent slept for a while now) so yeah if you find anything thats bugged let me know
So basically if(vAttachedSiren[vid] == 0) { doesnt work
Maybe Im making some really small mistake and I cant see it (havent slept for a while now) so yeah if you find anything thats bugged let me know
PHP код:
if(PRESSED(KEY_FIRE)) {
if(IsPlayerInAnyVehicle(playerid)) {
new vid = GetPlayerVehicleID(playerid);
if(AccInfo[playerid][PlayerFaction] == 1) {
if(VehInfo[vid][VehFaction] == 1) {
if(vAttachedSiren[vid] == 0) { //ignores this part, continues going forward
if(GetVehicleModel(vid) == 554) {
VehicleSiren[vid] = CreateDynamicObject(19419,0,0,0,0,0,0,0,0);
VehicleSiren[vid] = AttachDynamicObjectToVehicle(VehicleSiren[vid],vid,-0.00282, -0.13681, 0.83630, 0.00000, 0.00000, 0.00000);
vAttachedSiren[vid] = 1;
}
else if(GetVehicleModel(vid) == 515) {
VehicleSiren[vid] = CreateDynamicObject(19419, 0.00461, 1.29206, 1.23484, 0.00000, 0.00000, 0.00000);
VehicleSiren[vid] = AttachDynamicObjectToVehicle(VehicleSiren[vid],vid,0.00461, 1.29206, 1.23484, 0.00000, 0.00000, 0.00000);
vAttachedSiren[vid] = 1;
}
}
else {
DestroyDynamicObject(VehicleSiren[vid]);
vAttachedSiren[vid] = 0;
}
}
}
}
}