[HELP] +1 Untill == 10
#1

i need +1 Untill == 10 code for my fuel command
this is example of what i'm having now
Код:
if(VehicleFuel[GetPlayerVehicleID(playerid)]==10)
 {
   SendClientMessage(playerid, c_r, "Tank Is Already Full");
  }
else
  {
  VehicleFuel[GetPlayerVehicleID(playerid)]=VehicleFuel[GetPlayerVehicleID(playerid)]+1;
   }
this code adds +1 fuel every time i enter /afuel comamnd
i wan't this script to Continue adding +1 to VehicleFull untill it's count gets to 10 without re entering command /afuel

p.s.
and wiki link please on all codes with definitions like"
==
!=
>+
etc..
Reply
#2

Код:
if(VehicleFuel[GetPlayerVehicleID(playerid)]==10)
 {
   SendClientMessage(playerid, c_r, "Tank Is Already Full");
   return 1;
  }
Reply
#3

https://sampwiki.blast.hk/wiki/Control_Structures

You will want a "for loop".
Reply
#4

pawn Код:
if(VehicleFuel[GetPlayerVehicleID(playerid)]==10)
 {
   SendClientMessage(playerid, c_r, "Tank Is Already Full");
  }
else
  {
  for(new i; i < 12; i++){
    if(VehicleFuel[GetPlayerVehicleID(playerid)]>=10)break;
    VehicleFuel[GetPlayerVehicleID(playerid)]+=1;
  }
   }
Reply
#5

Quote:
Originally Posted by iggy1
Посмотреть сообщение
Thanx for the link it helped me to solve my other problem
Quote:
Originally Posted by gamer_Z
Посмотреть сообщение
pawn Код:
(code)
thank you very very very much it works i was already having a headeach
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)