Fire Truck
#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


Messages In This Thread
Fire Truck - by Spawe - 14.10.2018, 20:29
Re: Fire Truck - by Zeus666 - 14.10.2018, 20:54
Re: Fire Truck - by Spawe - 14.10.2018, 21:47
Re: Fire Truck - by Zeus666 - 15.10.2018, 11:31
Re: Fire Truck - by Hunud - 15.10.2018, 11:59
Re: Fire Truck - by Spawe - 15.10.2018, 22:32
Re: Fire Truck - by g1venchy - 16.10.2018, 09:23
Re: Fire Truck - by Spawe - 16.10.2018, 19:20
Re: Fire Truck - by Zeus666 - 17.10.2018, 08:29
Re: Fire Truck - by Zeus666 - 17.10.2018, 19:51

Forum Jump:


Users browsing this thread: 1 Guest(s)