Fire Truck
#1

Some way to deactivate the water that throws the firefighter cars I have thought a system so that they have to load the water truck to be able to throw water

Is there any way to disable water by default?
Reply
#2

You can try

IfPlayerIsInACar function

Create a command /putwater which sets PlayerInfo[playerid][water] = level


if level is higher than 1, you can click.
if level is lower than 0, you can't click.



check ifPlayerIsInACar FireTruck id

and disable or enable BUTTON (which is click)

disable = freeze the player.

otherwise no, you can't disable water
Reply
#3

How could I make a function so that these firefighter vehicles can not throw water until you activate it with an example command, /load water

CarFire[7];
Reply
#4

Add in playerenum

"FireWater"


create command /addwater

add your if's,

and command will set PlayerInfo[playerid][FireWater] = 100


then check ifplayerisinacar with Firetruck ID.

if playerid firewater = 100, then don't set anything
if playerid firewater = 100 then set player freeze.


if player freeze = he can't click.
Reply
#5

I did for myself in a way to set a player condition as a passanger even if he is an driver so he couldn't activate it.
Reply
#6

Quote:
Originally Posted by Zeus666
Посмотреть сообщение
Add in playerenum

"FireWater"


create command /addwater

add your if's,

and command will set PlayerInfo[playerid][FireWater] = 100


then check ifplayerisinacar with Firetruck ID.

if playerid firewater = 100, then don't set anything
if playerid firewater = 100 then set player freeze.


if player freeze = he can't click.
Yes thanks Could I have a function to guide me
Reply
#7

just slap player, when he tries to use water
Reply
#8

Could I have a function to guide me pls?
Reply
#9

PHP код:
CMD:addwater(playerid,params[])
{
    if(
PlayerInfo[playerid][pFaction] == 2// faction id 2(LSFD)
    
{
        new 
targetid,level,string[200];
        if(
sscanf(params"ud"targetidlevel)) return  SendClientMessage(playerid,-1,"COMMAND: /addwater [Driver's ID] [Liter]"); // So, that means you need a "team" to full the water, but you can do it itself too. 
        
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat"Driver is not online!");
    if(
level || level 1) return SendClientMessage(playerid,-1,""chat" Choose EMPTY(0) or FULL(1)");
       new 
Float:xFloat:yFloat:z;//these are the defines of your x,y and z position.
      
GetPlayerPos(playeridxyz);//this will store your position to be used in the following codes.((this stores the your x,y, and z position in to the variables we created.))
       
if(IsPlayerInRangeOfPoint(targetid5.0xyz))//this will check that if the player you want to add water is near you or not.
                   
{
        
PlayerInfo[targetid][Water] = level;
        
format(stringsizeof(string), ""COL_RED"%s has set water %s in %s's firetruck.",PlayerName(playerid),level,PlayerName(targetid));
        
SendClientMessage(playerid,-1,string); 
      
SendClientMessage(targetid,-1,string); 
    }
}
    else {
        
SendClientMessage(playerid,-1,""COL_RED"You can't use this.");
    }
    return 
1;

In this command you can add also the points of where you can add water.



PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
 if(
vehicleid == 407)
 { 
   if(
PlayerInfo[playerid][Water] == 1)
PlayerInfo[playerid][Water] = 0//we set this because we assume that player will use the water.
   
{
     
SendClientMessage(playeridCOLOR_COLOR,"Let's go!");
   }
   else
   {
    
SendClientMessage(playeridCOLOR_COLOR"This vehicle doesn't have water, where are you going?");
    
RemovePlayerFromVehicle(playerid);
   }
 }
 return 
1;

Quote:
Originally Posted by Spawe
Посмотреть сообщение
Could I have a function to guide me pls?
Reply
#10

Did it work?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)