Why is this not working please help me
#1

I am trying to make it so you can set the vehicles health level


pawn Код:
CMD:setvehiclehealth(playerid, params[])
{
    if(PlayerData[ID][AdminLevel] >= 1)
    {
        new VehicleHealth;
        new vehicleid = GetPlayerVehicleID(playerid);
        if(sscanf(params, "f", VehicleHealth)) return SendClientMessage(playerid, COLOR_GREEN, "/setvehiclehealth [Health]");
        new pstring[128];
        format(pstring,sizeof(pstring),"You have set your vehicle health to %f",VehicleHealth);
        SendClientMessage(playerid, COLOR_GREEN, pstring);
        SetVehicleHealth(vehicleid,VehicleHealth);
    }
    return 1;
}
But when i put a number in the health bit it says "You have set your vehicle health to (the number) but when i drive around the car still gets damaged ( bonet coming off doors coming off ) but it never blows up even if i put the number to 1


Thank You


Please Help Me Please
Reply
#2

You should either replace
pawn Код:
new VehicleHealth;
with
pawn Код:
new Float:VehicleHealth;
or replace
pawn Код:
SetVehicleHealth(vehicleid,VehicleHealth);
with
pawn Код:
SetVehicleHealth(vehicleid,float(VehicleHealth));
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)