engine command
#1

Hey boys i made a engine command but i cant make it example if some one doesnt have the key he cant turn car engine on pls if some one know tell me
Here is the script

PHP код:
COMMAND:engine(playeridparams[])
{
    new 
xr GetPlayerVehicleID(playerid);
    new 
engine,lights,alarm,doors,bonnet,boot,objective;
    new 
sender[MAX_STRING];
    if(
PlayerTemp[playerid][hname]==1myStrcpy(sender,"Stranger");
    else 
myStrcpy(sender,NameEx(playerid));
    if(
IsPlayerInAnyVehicle(playerid) && Vehicles[xr][carmodel] == 481 && Vehicles[xr][carmodel] == 509) return SendClientError(playerid"You are not in any vehicle, or there is no engine implented.");
    {
        if(!
IsPlayerInAnyVehicle(playerid)) return SendClientError(playerid"You are not in any vehicle!");
        new 
State;
        
State GetPlayerState(playerid);
        if(
State!=PLAYER_STATE_DRIVER)    return SendClientMessage(playerid,COLOR_GREY,"You are not the driver!");
        new 
stringa[MAX_STRING];
        new 
vid GetPlayerVehicleID(playerid);
        
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
        if(
engine == 0)
        {
            
SetVehicleParamsEx(vid1lightsalarmdoorsbonnetbootobjective);
            
format(stringa,sizeof(stringa),"%s has turned the engine on.",sender);
            
NearMessage(playerid,stringa,COLOR_ME2);
            
PlayerPlaySound(playerid11330.00.00.0);
            
TogglePlayerControllable(playeridtrue);
        }
        else
        {
            
SetVehicleParamsEx(vid0lightsalarmdoorsbonnetbootobjective);
            
format(stringa,sizeof(stringa),"%s has turned the engine off.",sender);
            
NearMessage(playerid,stringa,COLOR_ME2);
            
TogglePlayerControllable(playeridtrue);
        }
    }
    return 
1;

Reply


Messages In This Thread
engine command - by Diti1 - 09.12.2014, 16:56
Re: engine command - by Clad - 09.12.2014, 18:25
Re: engine command - by Diti1 - 09.12.2014, 20:26
Re: engine command - by Diti1 - 10.12.2014, 05:27
Re: engine command - by BroZeus - 10.12.2014, 05:34
Re: engine command - by IndependentGaming - 10.12.2014, 06:42
Re: engine command - by Diti1 - 10.12.2014, 12:07
Re: engine command - by dominik523 - 10.12.2014, 12:36
Re: engine command - by Diti1 - 10.12.2014, 14:11

Forum Jump:


Users browsing this thread: 1 Guest(s)