[Tutorial] How to make a /engine and a /lock command.
#4

Quote:
Originally Posted by ThomasRiddle
Посмотреть сообщение
I guess this is for RP servers , can you make it so it gives /unlock? I can't do it. Thanks in advance.
There you go.
PHP код:
    if (strcmp("/unlock"cmdtexttrue10) == 0)//your command.
    
{
        new 
enginelightsalarmdoorsbonnetbootobjective;
        new 
vehicleid GetPlayerVehicleID(playerid);//defining vehicleid is = to GetPlayerVehicleID.
        
if(IsPlayerInAnyVehicle(playerid))//Thsi will check that is a player In a vehcile or not.
            
{
                
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);//will check that what is the state of the vehicle lock.
                
if(doors == 1)//will check if the doors are already loocked it not.
                
{
                    
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    
SetVehicleParamsEx(vehicleid,engine,lights,alarm,false,bonnet,boot,objective);//same as the engine one.
                    
GameTextForPlayer(playerid,"Vehicle Unlocked!",2000,6);//for a text to appar on the screen for only 2 seconds.
                    
return 1;
                }
            }
            else
            
SendClientMessage(playerid,-1,"Error: You are not in a vehicle!");//the error message.
    
}
    if (
strcmp("/lock"cmdtexttrue10) == 0)//your command.
    
{
        new 
enginelightsalarmdoorsbonnetbootobjective;
        new 
vehicleid GetPlayerVehicleID(playerid);//defining vehicleid is = to GetPlayerVehicleID.
        
if(IsPlayerInAnyVehicle(playerid))//Thsi will check that is a player In a vehcile or not.
            
{
                
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);//will check that what is the state of the vehicle lock.
                
if(doors == 0)//will check if the doors are already loocked it not.
                
{
                    
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    
SetVehicleParamsEx(vehicleid,engine,lights,alarm,true,bonnet,boot,objective);//same as the engine one.
                    
GameTextForPlayer(playerid,"Vehicle Unlocked!",2000,6);//for a text to appar on the screen for only 2 seconds.
                    
return 1;
                }
            }
            else
            
SendClientMessage(playerid,-1,"Error: You are not in a vehicle!");//the error message.
    

And thanks for nice comments.
Reply


Messages In This Thread
How to make a /engine and a /lock command. - by TaLhA XIV - 20.08.2012, 21:46
Re: How to make a /engine and a /lock command. - by ThomasRiddle - 21.08.2012, 18:18
Re: How to make a /engine and a /lock command. - by Team_PRO - 22.08.2012, 08:06
Re: How to make a /engine and a /lock command. - by TaLhA XIV - 22.08.2012, 15:41
Re: How to make a /engine and a /lock command. - by DeadLy™ - 22.08.2012, 15:43
Re: How to make a /engine and a /lock command. - by Lordzy - 22.08.2012, 15:45
Re: How to make a /engine and a /lock command. - by TaLhA XIV - 22.08.2012, 15:55
Re: How to make a /engine and a /lock command. - by MoDee - 24.08.2012, 18:16
Re: How to make a /engine and a /lock command. - by Beljulji - 18.09.2012, 14:41
Re: How to make a /engine and a /lock command. - by TaLhA XIV - 18.09.2012, 14:43
Re: How to make a /engine and a /lock command. - by Private200 - 19.11.2012, 09:21
Re: How to make a /engine and a /lock command. - by goviscrap - 27.11.2012, 13:50
Re: How to make a /engine and a /lock command. - by iGetty - 01.12.2012, 16:00
Re: How to make a /engine and a /lock command. - by xXtremeXx - 28.06.2016, 11:12
Re: How to make a /engine and a /lock command. - by Dutheil - 28.06.2016, 12:02
Re: How to make a /engine and a /lock command. - by SickAttack - 28.06.2016, 13:22
Re: How to make a /engine and a /lock command. - by EiresJason - 28.06.2016, 13:29
Re: How to make a /engine and a /lock command. - by Quinncell - 28.06.2016, 13:55
Respuesta: How to make a /engine and a /lock command. - by REMAK3 - 28.06.2016, 22:47
Re: How to make a /engine and a /lock command. - by DarkSkull - 02.07.2016, 20:53

Forum Jump:


Users browsing this thread: 1 Guest(s)