engine command
#6

Do you have a givekey command ?

Код:
COMMAND:engine(playerid, params[])
{
    new xr = GetPlayerVehicleID(playerid);
    new engine,lights,alarm,doors,bonnet,boot,objective;
    new sender[MAX_STRING];
    if(PlayerTemp[playerid][hname]==1) myStrcpy(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 (PlayerInfo[playerid][pCarKeys] == 0) { // Change pCarKeys if you have someting else
		SendClientMessage(playerid,COLOR_GREY,"   You can not start the car engine, if you dont have any car keys.");
		return 1;
		}
		if(engine == 0)
        {
            SetVehicleParamsEx(vid, 1, lights, alarm, doors, bonnet, boot, objective);
            format(stringa,sizeof(stringa),"%s has turned the engine on.",sender);
            NearMessage(playerid,stringa,COLOR_ME2);
            PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
            TogglePlayerControllable(playerid, true);
        }
        else
        {
            SetVehicleParamsEx(vid, 0, lights, alarm, doors, bonnet, boot, objective);
            format(stringa,sizeof(stringa),"%s has turned the engine off.",sender);
            NearMessage(playerid,stringa,COLOR_ME2);
            TogglePlayerControllable(playerid, true);
        }
    }
    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)