problem (Help fast)
#1

so I got this OnGaemodeInit
its removing the car doors driver/co-driver
but there is a problem
in this code 67371620 is a mistake
can anyone fix it for me ?
the car doors remove good
but ..
the trunk is damage..
anyone give me a help ?
pawn Код:
for(new i = 0; i < MAX_VEHICLES; i++) UpdateVehicleDamageStatus(i, panels, 67371620, lights, tires);
Reply
#2

Why 67371620 ?
Reply
#3

pawn Код:
//Damaged
for(new i = 0; i < MAX_VEHICLES; i++) UpdateVehicleDamageStatus(i, panels, 1, lights, tires);
pawn Код:
//Not damaged
for(new i = 0; i < MAX_VEHICLES; i++) UpdateVehicleDamageStatus(i, panels, 0, lights, tires);
Reply
#4

i made them fall down
used that code to check the DM status of vehicle witch printed to console
when the car doors get removed i typed /dmg to print it
but it seems trunk saved too as (Doors)
so the trunk got DMged too when cars spawn
can you help me ?
pawn Код:
CMD:dmg(playerid, params[])
{
    new panels,doors,lights,tires;
    new vehicleid = GetPlayerVehicleID(playerid);
    if(IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid,0x00FF00AA,"You're in a vehicle.");
    GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
    printf("Vehicle Status : [Panels] : %d - [Doors] : %d - [Lights] : %d - [Tires] : %d",panels,doors,lights,tires);
    return 1;
}
Reply
#5

To remove all doors (expect rear ones) use 67372036 which is 0b00000100_00000100_00000100_00000100

https://sampwiki.blast.hk/wiki/DoorStates
Reply
#6

can you tell me how did you convect the numbers ?
EDIT: i need only driver/-co driver door remove .. not all :/
Reply
#7

The binary number is explained in the wiki page (last reply)
You can simply use it or convert it by any calculator

What you want is 0b00000100_00000100_00000000_00000000
pawn Код:
UpdateVehicleDamageStatus(i, panels, 0b00000100_00000100_00000000_00000000, lights, tires);
// or
UpdateVehicleDamageStatus(i, panels, 67371008, lights, tires);
// or
UpdateVehicleDamageStatus(i, panels, 0x4040000, lights, tires);
Reply
#8

I prefer this: https://code.******.com/p/samp-alex0.../utils.inc?r=5

It makes life so much easier [for newbs]!

pawn Код:
enum
{
    VEHICLE_DOOR_UNDAMAGED, // цело
    VEHICLE_DOOR_SWINGING, // открыто(качается)
    VEHICLE_DOOR_DAMAGED, // помято
    VEHICLE_DOOR_DAMAGED_SWINGING, // помято и открыто(качается)
    VEHICLE_DOOR_FELL_OF // оторвано
};

enum
{
    VEHICLE_BOOT_UNDAMAGED, // цело
    VEHICLE_BOOT_SWINGING, // открыто(качается)
    VEHICLE_BOOT_DAMAGED, // помято
    VEHICLE_BOOT_DAMAGED_SWINGING, // помято и открыто(качается)
    VEHICLE_BOOT_FELL_OF // оторвано
};

enum
{
    VEHICLE_BONNET_UNDAMAGED, // цело
    VEHICLE_BONNET_SWINGING, // открыто(качается)
    VEHICLE_BONNET_DAMAGED, // помято
    VEHICLE_BONNET_DAMAGED_SWINGING, // помято и открыто(качается)
    VEHICLE_BONNET_FELL_OF // оторвано
};

enum
{
    VEHICLE_WINDSHIELD_UNDAMAGED, // цело
    VEHICLE_WINDSHIELD_CRACKED_1, // треснуло
    VEHICLE_WINDSHIELD_CRACKED_2, // треснуло
    VEHICLE_WINDSHIELD_DESTROYED // разбито
};

enum
{
    VEHICLE_TIRE_UNDAMAGED, // цело
    VEHICLE_TIRE_DAMAGED // пробито
};

enum
{
    VEHICLE_LIGHT_UNDAMAGED, // целы
    VEHICLE_LIGHT_DAMAGED // разбиты
};

stock encode_panels(flp, frp, rlp, rrp, windshield, front_bumper, rear_bumper)
{
    return flp | (frp << 4) | (rlp << 8) | (rrp << 12) | (windshield << 16) | (front_bumper << 20) | (rear_bumper << 24);
}

stock encode_doors(bonnet, boot, driver_door, passenger_door)
{
    return bonnet | (boot << 8) | (driver_door << 16) | (passenger_door << 24);
}

stock encode_lights(light1, light2, light3, light4)
{
    return light1 | (light2 << 1) | (light3 << 2) | (light4 << 3);
}

stock encode_tires(tire1, tire2, tire3, tire4)
{
    return tire1 | (tire2 << 1) | (tire3 << 2) | (tire4 << 3);
}
// специально для байков
stock encode_tires_bike(rear, front)
{
    return rear | (front << 1);
}
Pop front tires and remove doors:
pawn Код:
encode_tires(VEHICLE_TIRE_DAMAGED, VEHICLE_TIRE_DAMAGED, VEHICLE_TIRE_UNDAMAGED, VEHICLE_TIRE_UNDAMAGED) | encode_doors(VEHICLE_DOOR_UNDAMAGED, VEHICLE_DOOR_UNDAMAGED, VEHICLE_DOOR_FELL_OF, VEHICLE_DOOR_FELL_OF)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)