How to lock car? and INF Vehicle HP
#1

Hey guys,
I need help and I really want to know the command to lock a vehicle, I want to put it on my server and I also want to know how to put Infinite Car Health so that it will not take any damage?

Also I just downloaded a Car Menu Script and I want to edit it and I wanna know how to destroy the previous car I spawned after spawning a new car?

Help please. I'll REP+1 If it works for me
Reply
#2

https://sampwiki.blast.hk/wiki/SetVehicleHealth
Try setting the value of health to a large value.

You need to get the Vehicle id(Plate) to destroy the cars that you have spawned
it will be like this

example:-

pawn Код:
new CreatedCars[100];
if the createdcar vehicle id is stored

pawn Код:
CMD:destroycars(playerid, params[])
      for(new i = 0; i < sizeof(CreatedCars); i++) {
        if(CreatedCars[i] != INVALID_VEHICLE_ID) {
            DestroyVehicle(CreatedCars[i]);
            CreatedCars[i] = INVALID_VEHICLE_ID;
        }
    }
    SendClientMessageEx(playerid, COLOR_GREY, "   Created vehicles destroyed!");
    return 1;
here is example of lock system
http://pastebin.com/f104e7ce2
Reply
#3

Here you can see lock command a...
nd description of two functions https://sampwiki.blast.hk/wiki/SetVehicleParamsForPlayer , and use https://sampwiki.blast.hk/wiki/SetVehicleHealth to define vehicle's health
Reply
#4

Quote:
Originally Posted by ******
Посмотреть сообщение
Try set the health to (exactly) "(Float:0x7F800000)". That is the IEEE754 definition of infinity.
I put that on the cmd to set the health like exactly what you wrote, but the car still takes damage ...
Reply
#5

Quote:
Originally Posted by CoaPsyFactor
Посмотреть сообщение
Here you can see lock command a...
nd description of two functions https://sampwiki.blast.hk/wiki/SetVehicleParamsForPlayer , and use https://sampwiki.blast.hk/wiki/SetVehicleHealth to define vehicle's health
I tried using the SetVehicleParamsForPlayer and I always get error and also the health I want it to be infinity so when it takes damage it repairs itself.... I want to know the exact cmd for locking it and having infinite car health
Reply
#6

Quote:
Originally Posted by Neo Karls
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/SetVehicleHealth
Try setting the value of health to a large value.

You need to get the Vehicle id(Plate) to destroy the cars that you have spawned
it will be like this

example:-

pawn Код:
new CreatedCars[100];
if the createdcar vehicle id is stored

pawn Код:
CMD:destroycars(playerid, params[])
      for(new i = 0; i < sizeof(CreatedCars); i++) {
        if(CreatedCars[i] != INVALID_VEHICLE_ID) {
            DestroyVehicle(CreatedCars[i]);
            CreatedCars[i] = INVALID_VEHICLE_ID;
        }
    }
    SendClientMessageEx(playerid, COLOR_GREY, "   Created vehicles destroyed!");
    return 1;
here is example of lock system
http://pastebin.com/f104e7ce2
I am a beginner for using pawno and dont know where to put stuff and I meant destroy car when you spawn another car, so when you are currently in a vehicle and you spawn another vehicle, your other vehicle will disappear.... and I am confused with lock system and also about the car health, i meant no damage as in repairing itself straight away when it takes damage
Reply
#7

Quote:
Originally Posted by ******
Посмотреть сообщение
No damage and infinite health are not the same thing. You can have a seriously battered car, but it will never blow up.
Oh, sorry I thought they were the same, do you know how to make it get no damage?
Reply
#8

Bump
Reply
#9

Bump
Reply
#10

Check in timer your current vehicle status. If something has been changed (like health) set it to your value again. Timer must be looping. Or check it by GetVehicleDamageStatus
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)