Help vehicle health
#1

Help me :confuso::confuso::confuso::confuso::confuso:

What to do to not flood the message when the vehicle reaches 280 health



PHP код:
if(IsPlayerInAnyVehicle(playerid))
    {
    new 
Float:Vehicleid GetPlayerVehicleID(playerid);
        
GetVehicleHealth(idVehicle);
        if(
Vehicle <= 280.0 
        {
            
            
SetVehicleHealth(id280.0);
              new 
enginelightsalarmdoorsbonnetbootobjective;
              new 
vid GetPlayerVehicleID(playerid);
            
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            if(
engineSetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet,boot,objective); // engine off
            
            
            
SendClientMessage(playerid, -1," Text flood ? :(");
            
        }
        
    
    } 
Reply
#2

If you set the health to 280 it is still "smaller than or equal to" 280 the next time it is checked. So it runs forever.
Reply
#3

yes help me ?
Reply
#4

PHP код:
if(IsPlayerInAnyVehicle(playerid))
    {
    new 
Float:Vehicleid GetPlayerVehicleID(playerid);
        
GetVehicleHealth(idVehicle);
        if(
Vehicle 280.0 
        {
            
            
SetVehicleHealth(id280.0);
              new 
enginelightsalarmdoorsbonnetbootobjective;
              new 
vid GetPlayerVehicleID(playerid);
            
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            if(
engineSetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet,boot,objective); // engine off
            
            
            
SendClientMessage(playerid, -1," Text flood ? :(");
            
        }
        
    

    } 
Reply
#5

Quote:
Originally Posted by Alucynious
Посмотреть сообщение
yes help me ?
I can't fix your logic reasoning. If I had given you the solution you would've copy-pasted it (like you did now, probably) and you wouldn't have learned a thing. Give a man a fish and you feed him for a day, teach a man to fish and you feed him for a lifetime.
Reply
#6

If it is not help, do not comment!
Reply
#7

Quote:
Originally Posted by Alucynious
Посмотреть сообщение
If it is not help, do not comment!
That is not true. I've looked at the code before Vince and couldn't figure out what was wrong. When he posted his comment, I noticed what mistake you made and you still didn't understand. And when you further needed help, That's why I gave you the code. If you knew something about scripting, You could've fixed it yourself.

Quote:
Originally Posted by Vince
Give a man a fish and you feed him for a day, teach a man to fish and you feed him for a lifetime.
REP+.
Reply
#8

ja consegui arumar e nao precisei de ajuda de ngm flw vlw todo mundo que esta aki precisa de algo ou sempre tem duvidas
Reply
#9

English please.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)