Where must i put this?
#1

So where must i put this for vehicle auto repair?
Код:
new vehicleid = GetPlayerVehicleID(playerid);
new Float:VehHealth;
GetVehicleHealth(vehicleid,VehHealth);
if(VehHealth <= 50) return RepairVehicle(GetPlayerVehicleID(playerid));
PlayerPlaySound(playerid, 1056, 0.0,0.0, 0.0);
SendClientMessage(playerid, COLOR_KRED, "Your vehicle has been fixed");
and also when i type /setcarhealth it shows me "Your vehicle has been fixed" and SERVER:Unknown command WHYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
Reply
#2

Depends, do you want it like a command or how should it work?
Reply
#3

If a player's vehicle is smoking i want it to say in COLOR_KRED your vehicle has been fixed, and ofcourse to fix it
Reply
#4

You cut make a timer, to check if the vehcile's health is low:

on top of your script put
Код:
forward vcheck();
OnGameModeInnit:
Код:
   SetTimer("vcheck",500,1);
Bottom of script:
Код:
public vcheck()
{
   if(GetVehicleHealth(vehcileid) < 300)
   {
       new vehicleid = GetPlayerVehicleID(playerid);
       new Float:VehHealth;
       GetVehicleHealth(vehicleid,VehHealth);
       if(VehHealth <= 50) return RepairVehicle(GetPlayerVehicleID(playerid));
       PlayerPlaySound(playerid, 1056, 0.0,0.0, 0.0);
       SendClientMessage(playerid, COLOR_KRED, "Your vehicle has been fixed");
       return 1;
   }
    return 1;
}
And because your cmd says SERVER: Unknow command
is becuase you have "return 0;" under OnPlayerCommand
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)