Engine timer
#7

pawn Код:
CMD:engine(playerid, params[])
{
    new engine, lights, alarm, doors, bonnet, boot, objective, vehicleid, string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!PlayerInfo[playerid][pVeh] && !PlayerInfo[playerid][pVVeh] && !PlayerInfo[playerid][pBVeh]) return SendClientMessage(playerid, COLOR_GREY, "You don't own a vehicle.");
    if(GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pVeh] && GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pVVeh] && GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pBVeh]) return SendClientMessage(playerid, COLOR_GREY, "You dont have the keys for this vehicle.");
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You are not driving a vehicle.");
    if(vehicleid == 509 || vehicleid == 481 || vehicleid == 510) return SendClientMessage(playerid, COLOR_GREY, "Bicycles have no engine.");
    vehicleid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    if(!engine)
    {
        SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
        if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVeh])
        {SetVehicleParamsEx(vehicleid, 1, lights, alarm, PlayerInfo[playerid][vLocked], bonnet, boot, objective);}
        else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVVeh])
        {SetVehicleParamsEx(vehicleid, 1, lights, alarm, PlayerInfo[playerid][vVLocked], bonnet, boot, objective);}
        else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pBVeh])
        {SetVehicleParamsEx(vehicleid, 1, lights, alarm, PlayerInfo[playerid][vBLocked], bonnet, boot, objective);}
        format(string, sizeof(string), "* %s turns the key's engine on.", RPN(playerid));
        if(PlayerInfo[playerid][pMaskOn] == 1)
        {
            format(string, sizeof(string), "* Stranger puts their key in the ignition and turns it.");
        }
        else
        {
            format(string, sizeof(string), "* %s puts their key in the ignition and turns it.", RPN(playerid));
        }
        SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
    }
    else
    {
        SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
        if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVeh])
        {SetVehicleParamsEx(vehicleid, 0, lights, alarm, PlayerInfo[playerid][vLocked], bonnet, boot, objective);}
        if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVVeh])
        {SetVehicleParamsEx(vehicleid, 0, lights, alarm, PlayerInfo[playerid][vVLocked], bonnet, boot, objective);}
        if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pBVeh])
        {SetVehicleParamsEx(vehicleid, 0, lights, alarm, PlayerInfo[playerid][vBLocked], bonnet, boot, objective);}
        format(string, sizeof(string), "* %s turns the vehicle's engine off.", RPN(playerid));
        if(PlayerInfo[playerid][pMaskOn] == 1)
        {
            format(string, sizeof(string), "* Stranger turns the key in the ignition and takes it out.");
        }
        else
        {
            format(string, sizeof(string), "* %s turns the key in the ignition and takes it out.", RPN(playerid));
        }
        SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
    }
    return 1;
}
This is the code, how should i put it in?
Reply


Messages In This Thread
Engine timer - by CalvinC - 08.12.2014, 12:42
Re: Engine timer - by DaniceMcHarley - 08.12.2014, 13:04
Re: Engine timer - by Schneider - 08.12.2014, 13:14
Re: Engine timer - by UltraScripter - 08.12.2014, 14:23
Re: Engine timer - by CalvinC - 08.12.2014, 14:49
Re: Engine timer - by Schneider - 08.12.2014, 14:59
Re: Engine timer - by CalvinC - 08.12.2014, 19:28
Re: Engine timer - by CalvinC - 09.12.2014, 07:22
Re: Engine timer - by CalvinC - 10.12.2014, 07:45
Re: Engine timer - by iOxide - 10.12.2014, 08:09

Forum Jump:


Users browsing this thread: 4 Guest(s)