Problem Occuirng In Ulric Vehicle System
#1

I Have A Problem In Using Ulric Vehicle System...

When I type /vcall [slot 1,2,3] every time slot 1 vehicles come..i mean if i type /vcall 3 then also vehivle which is in slot 1 spawn.....

Can Anyone Help Me....?

Код:
#include <a_samp>
#include <dini>
#include <sscanf2>

#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

#define Blue 0x0259EAAA
#define Red 0xFF0000AA
#define Green 0x16EB43FF

#define DefVehCost 80000 // You can change this
#define DefVehPlate "~Xav~212"

enum VehicleData
{
        Cost,
        Locked,
        Parked,
        Owner,
        SellCost,
        VehID,
        Alarm,
        AlarmOn,
        ToSell
};
new VehicleInfo[MAX_VEHICLES][VehicleData];

new file[256];
new engine,lights,alarm,doors,bonnet,boot,objective;
new VehNames[212][] =
{
                "Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster",
                "Stretch","Manana","Infernus","Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto",
                "Taxi","Washington","Bobcat","Mr Whoopee","BF Injection","Hunter","Premier","Enforcer","Securicar","Banshee",
                "Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie","Stallion","Rumpo",
                "RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer",
                "Turismo","Speeder","Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer",
                "Pcj - 600","Faggio","Freeway","RC Baron","RC Raider","Glendale","Oceanic","Sanchez","Sparrow","Patriot",
                "Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","Zr3 50","Walton","Regina","Comet","Bmx",
                "Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo",
                "Greenwood","Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa",
                "RC Goblin","Hotring Racer A","Hotring Racer B","Bloodring Banger","Rancher","Super GT","Elegant",
                "Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain","Nebula","Majestic",
                "Buccaneer","Shamal","Hydra","FCR - 900","NRG - 500","Hpv - 1000","Cement Truck","Tow Truck","Fortune","Cadrona",
                "FBI Truck","Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight",
                "Streak","Vortex","Vincent","Bullet","Clover","Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob",
                "Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A","Monster B","Uranus",
                "Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight",
                "Trailer","Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford",
                "BF-400","Newsvan","Tug","Trailer A","Emperor","Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C",
                "Andromada","Dodo","RC Cam","Launch","Police Car (LSPD)","Police Car (SFPD)","Police Car (LVPD)","Police Ranger",
                "Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",
                "Stair Trailer","Boxville","Farm Plow","Utility Trailer"
};

public OnFilterScriptInit()
{
        print("\n--------------------------------------");
        print(" Ulric Vehicle System by Xaviour212");
        print("--------------------------------------\n");
         CreateUlricVehicle(420,2483.50195300,-1653.00598100,13.20846300,84.32843700,-1,-1,2000); //Taxi
	 CreateUlricVehicle(420,2329.87158200,-1741.16137600,13.32373600,84.32843700,-1,-1,2000); //Taxi
	 CreateUlricVehicle(420,2254.36499000,-1801.09814400,13.32627300,84.32843700,-1,-1,2000); //Taxi
	 CreateUlricVehicle(420,2388.76489200,-1886.92651300,13.24068800,84.32843700,-1,-1,2000); //Taxi
	 CreateUlricVehicle(420,2483.63598600,-1951.71252400,13.21911200,84.32843700,-1,-1,2000); //Taxi
	 CreateUlricVehicle(431,1400.19372559,-2443.80566406,525.98114014,3.99902344,-1,-1,5000); //Bus
	 CreateUlricVehicle(406,1393.10400391,-2411.15478516,527.32476807,182.00000000,-1,-1,5000); //Dumper
	 CreateUlricVehicle(406,1399.11865234,-2411.06884766,527.26928711,181.99951172,-1,-1,5000); //Dumper
	 
        for(new i = 0; i < MAX_VEHICLES; i++)
    {
                if(!dini_Exists(VFile(i)))
                {
                    SetVehicleNumberPlate(i, DefVehPlate);//You can change this
                }
                else if(dini_Exists(VFile(i)))
                {
                        SetVehicleNumberPlate(i, dini_Get(VFile(i), "Plate"));
                        VehicleInfo[i][Locked] = dini_Int(VFile(i), "Lock");
                        VehicleInfo[i][Parked] = dini_Int(VFile(i), "Parked");
                        VehicleInfo[i][Alarm] = dini_Int(VFile(i), "Alarm");
                        VehicleInfo[i][AlarmOn] = dini_Int(VFile(i), "AlarmOn");
                        SetVehicleToRespawn(i);
                }
        }
        return 1;
}
 
public OnVehicleSpawn(vehicleid)
{
        new playerid;
        for(new i = 0; i < MAX_VEHICLES; i++)
        if(dini_Exists(VFile(i)))
        {
            SetVehicleNumberPlate(i, dini_Get(VFile(i), "Plate"));
        if(VehicleInfo[i][Parked] == 1)
            {
                 SetVehiclePos(i, dini_Float(VFile(GetPlayerVehicleID(playerid)), "X"), dini_Float(VFile(GetPlayerVehicleID(playerid)), "Y"), dini_Float(VFile(GetPlayerVehicleID(playerid)), "Z"));
                }
        }
    return 1;
}
 
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
        new string[100];
        if(dini_Int(VFile(vehicleid),"UnBuyable") == 0 && dini_Int(VFile(vehicleid),"Owned") == 1 && dini_Int(PFile(playerid),"CarID") != vehicleid)
        {
                format(string, sizeof(string), "~r~This %s has belogs to %s. And this car is not available for purchase", VehNames[GetVehicleModel(vehicleid)-400],dini_Get(VFile(vehicleid),"Owner"));
        GameTextForPlayer(playerid, string, 3000, 3);
        }
        if(dini_Int(VFile(vehicleid),"UnBuyable") == 0 && dini_Int(VFile(vehicleid),"Owned") == 1 && dini_Int(PFile(playerid),"Slot1") == vehicleid)
        {
                format(string, sizeof(string), "~g~Welcome to you %s, %s. Enjoy with you car", VehNames[GetVehicleModel(vehicleid)-400], Gn(playerid));
                GameTextForPlayer(playerid, string, 3000, 3);
        }
        else if(dini_Int(VFile(vehicleid),"UnBuyable") == 0 && dini_Int(VFile(vehicleid),"Owned") == 1 && dini_Int(PFile(playerid),"Slot2") == vehicleid)
        {
                format(string, sizeof(string), "~g~Welcome to you %s, %s. Enjoy with you car", VehNames[GetVehicleModel(vehicleid)-400], Gn(playerid));
                GameTextForPlayer(playerid, string, 3000, 3);
        }
        else if(dini_Int(VFile(vehicleid),"UnBuyable") == 0 && dini_Int(VFile(vehicleid),"Owned") == 1 && dini_Int(PFile(playerid),"Slot3") == vehicleid)
        {
                format(string, sizeof(string), "~g~Welcome to you %s, %s. Enjoy with you car", VehNames[GetVehicleModel(vehicleid)-400], Gn(playerid));
                GameTextForPlayer(playerid, string, 3000, 3);
        }
        else if(dini_Int(VFile(vehicleid),"UnBuyable") == 1)
        {
                format(string, sizeof(string), "~b~This %s in Unbuyable by Administration server", VehNames[GetVehicleModel(vehicleid)-400]);
        GameTextForPlayer(playerid, string, 3000, 4);
        }
        else if(dini_Int(VFile(vehicleid),"UnBuyable") == 0 && dini_Int(VFile(vehicleid),"Owned") == 0 && VehicleInfo[vehicleid][ToSell] == 1)
        {
                format(string, sizeof(string), "~g~This %s in Buyable. \nThe cost is %d", VehNames[GetVehicleModel(vehicleid)-400], VehicleInfo[vehicleid][Cost]);
        GameTextForPlayer(playerid, string, 3000, 4);
        }
        return 1;
}
 
public OnPlayerUpdate(playerid)
{
        new veh1 = GetPlayerVehicleID(playerid);
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(dini_Int(VFile(veh1),"Lock") == 1 && veh1!=Car1(playerid) && veh1!=Car2(playerid) && veh1!=Car3(playerid))
            {
                new string[126];
                new Float:A, Float:B, Float:C;
                GetPlayerPos(playerid, A, B ,C);
                SetPlayerPos(playerid, A, B ,C);
                format(string, sizeof(string), "This %s locked by %s", VehNames[GetVehicleModel(veh1)-400],dini_Get(VFile(veh1),"Owner"));
                SendClientMessage(playerid, Red, string);
                }
                if(dini_Int(VFile(veh1),"AlarmOn") == 1 && veh1!=Car1(playerid) && veh1!=Car2(playerid) && veh1!=Car3(playerid))
            {
                GetVehicleParamsEx(veh1, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(veh1, engine, lights, 1, doors, bonnet, boot, objective);
                SetTimerEx("DisableAlarm",18000,false,"i",veh1);
                }
        }
        return 1;
}
 
public OnPlayerCommandText(playerid, cmdtext[])
{
        dcmd(vbuy,4,cmdtext);
        dcmd(vsell,5,cmdtext);
        dcmd(vcall,5,cmdtext);
        dcmd(vunbuyable,10,cmdtext);
        dcmd(vbuyable,8,cmdtext);
        dcmd(vlock,5,cmdtext);
        dcmd(vunlock,7,cmdtext);
        dcmd(vpark,5,cmdtext);
        dcmd(vplate,6,cmdtext);
        dcmd(vhelp,5,cmdtext);
        //============================Update in v.16================================
        dcmd(vadmpark,8,cmdtext);
        //=============================Added in v2.0================================
        dcmd(setcost,7,cmdtext);
        dcmd(admvhelp,9,cmdtext);
        //=============================Added in v2.2================================
        dcmd(mycar,5,cmdtext);
        dcmd(openbonnet,10,cmdtext);
        dcmd(closebonnet,11,cmdtext);
        dcmd(buyalarm,8,cmdtext);
        dcmd(alarmon,7,cmdtext);
        dcmd(alarmoff,8,cmdtext);
        dcmd(opendoor,8,cmdtext);
        dcmd(closedoor,9,cmdtext);
        dcmd(lighton,7,cmdtext);
        dcmd(lightoff,8,cmdtext);
 
        return 0;
}
 
dcmd_vbuy(playerid, params[])
{
        #pragma unused params
        new vehicleid = GetPlayerVehicleID(playerid), string[218];
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"You must in Vehicle to use this command");
    if(VehicleInfo[vehicleid][ToSell] == 0) return SendClientMessage(playerid,Red,"This is not a buyable");
    if(dini_Int(VFile(vehicleid),"Owned")== 1) return SendClientMessage(playerid,Red,"This car is already owned");
        if(dini_Int(VFile(vehicleid),"UnBuyable")== 1) return SendClientMessage(playerid,Red,"This car in unbuyable");
        if(GetPlayerMoney(playerid)< VehicleInfo[vehicleid][Cost]) return SendClientMessage(playerid,Red,"You dont have a enough money");
        if(Car1(playerid) == 0)
        {
                if(!dini_Exists(PFile(playerid)))
                {
                    dini_Create(PFile(playerid));
                SetPlayerSlot1(playerid, vehicleid);
                }
                else if(dini_Exists(PFile(playerid)))
                {
                SetPlayerSlot1(playerid, vehicleid);
                }
                if(!dini_Exists(VFile(vehicleid)))
                {
                    dini_Create(VFile(vehicleid));
                SetVehicleOwner(vehicleid, playerid);
                }
                else if(dini_Exists(VFile(vehicleid)))
                {
                        SetVehicleOwner(vehicleid, playerid);
                }
                format(string, sizeof(string), "You has buy a %s and placed in slot 1", VehNames[GetVehicleModel(vehicleid)-400]);
                SendClientMessage(playerid, Green, string);
                GivePlayerMoney(playerid, -VehicleInfo[vehicleid][Cost]);
        }
        else if(Car1(playerid) > 0)
        {
                if(Car2(playerid) == 0)
                {
                        if(!dini_Exists(PFile(playerid)))
                        {
                            dini_Create(PFile(playerid));
                        SetPlayerSlot2(playerid, vehicleid);
                        }
                        else if(dini_Exists(PFile(playerid)))
                        {
                        SetPlayerSlot2(playerid, vehicleid);
                        }
                        if(!dini_Exists(VFile(vehicleid)))
                        {
                            dini_Create(VFile(vehicleid));
                        SetVehicleOwner(vehicleid, playerid);
                        }
                        else if(dini_Exists(VFile(vehicleid)))
                        {
                                SetVehicleOwner(vehicleid, playerid);
                        }
                        format(string, sizeof(string), "You havs buy a %s and placed in slot 2", VehNames[GetVehicleModel(vehicleid)-400]);
                        SendClientMessage(playerid, Green, string);
                        GivePlayerMoney(playerid, -VehicleInfo[vehicleid][Cost]);
                }
                else if(Car2(playerid) > 0)
                {
                    if(Car3(playerid) == 0)
                    {
                                if(!dini_Exists(PFile(playerid)))
                                {
                                    dini_Create(PFile(playerid));
                                SetPlayerSlot3(playerid, vehicleid);
                                }
                                else if(dini_Exists(PFile(playerid)))
                                {
                                SetPlayerSlot3(playerid, vehicleid);
                                }
                                if(!dini_Exists(VFile(vehicleid)))
                                {
                                    dini_Create(VFile(vehicleid));
                                SetVehicleOwner(vehicleid, playerid);
                                }
                                else if(dini_Exists(VFile(vehicleid)))
                                {
                                        SetVehicleOwner(vehicleid, playerid);
                                }
                                format(string, sizeof(string), "You has buy a %s and placed in slot 3", VehNames[GetVehicleModel(vehicleid)-400]);
                                SendClientMessage(playerid, Green, string);
                                GivePlayerMoney(playerid, -VehicleInfo[vehicleid][Cost]);
                        }
                        else if(Car3(playerid) > 0)
                        {
                            SendClientMessage(playerid, Red, "You dont have some slot more. You have to sell your vehicle in first");
                        }
                }
        }
        return 1;
}
 
dcmd_vsell(playerid, params[])
{
        #pragma unused params
        new vehicleid = GetPlayerVehicleID(playerid);
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"[ERROR]You must in Vehicle to use this command");
        if(vehicleid==Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
                SetSlot1PlayerEmpty(playerid);
                SetVehicleNotOwned(vehicleid);
                dini_Remove(VFile(vehicleid));
                SendClientMessage(playerid, Green,"You has sell your car in slot 1. Now your slot 1 has empty");
                GivePlayerMoney(playerid, VehicleInfo[vehicleid][Cost]-1000);
                SetVehicleToRespawn(vehicleid);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid==Car2(playerid) && vehicleid!=Car3(playerid))
        {
            SetSlot2PlayerEmpty(playerid);
                SetVehicleNotOwned(vehicleid);
                dini_Remove(VFile(vehicleid));
                SendClientMessage(playerid, Green,"You has sell your car in slot 2. Now your slot 2 has empty");
                GivePlayerMoney(playerid, VehicleInfo[vehicleid][Cost]-1000);
                SetVehicleToRespawn(vehicleid);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid==Car3(playerid))
        {
                SetSlot3PlayerEmpty(playerid);
                SetVehicleNotOwned(vehicleid);
                dini_Remove(VFile(vehicleid));
                SendClientMessage(playerid, Green,"You has sell your car in slot 3. Now your slot 3 has empty");
                GivePlayerMoney(playerid, VehicleInfo[vehicleid][Cost]-1000);
                SetVehicleToRespawn(vehicleid);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            SendClientMessage(playerid, Red, "[ERROR]This is not your car");
        }
        return 1;
}
 
dcmd_vcall(playerid, params[])
{
        new Slot;
    if(sscanf(params,"d",Slot))return SendClientMessage(playerid, Red, "[ERROR]Usage: /vcall [Slot]");
    if(Slot == 1)
    {
        if(Car1(playerid) == 0) return SendClientMessage(playerid, Red, "You didn't have a car in slot 1");
        SetTimerEx("Timer1",5000,false,"i",playerid);
        SendClientMessage(playerid, Green, "You has call you vehicle. Please wait 5 second");
        SetVehicleToRespawn(Car1(playerid));
        }
        else if(Slot == 2)
        {
            if(Car2(playerid) == 0) return SendClientMessage(playerid, Red, "You didn't have a car in slot 2");
            SetTimerEx("Timer1",5000,false,"i",playerid);
            SendClientMessage(playerid, Green, "You has call you vehicle. Please wait 5 second");
            SetVehicleToRespawn(Car2(playerid));
        }
        else if(Slot == 3)
        {
            if(Car3(playerid) == 0) return SendClientMessage(playerid, Red, "You didn't have a car in slot 3");
            SetTimerEx("Timer1",5000,false,"i",playerid);
            SendClientMessage(playerid, Green, "You has call you vehicle. Please wait 5 second");
            SetVehicleToRespawn(Car3(playerid));
        }
        return 1;
}
 
dcmd_vunbuyable(playerid, params[])
{
        #pragma unused params
        new vehicleid = GetPlayerVehicleID(playerid), string[50];
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,Red,"[ERROR]Only RCON Admin can use this command");
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"[ERROR]You must in vehicle to use this command");
        if(VehicleInfo[vehicleid][ToSell] == 0) return SendClientMessage(playerid,Red,"[ERROR]This is not a buyable");
        if(dini_Int(VFile(vehicleid),"UnBuyable")== 1) return SendClientMessage(playerid, Red, "[ERROR]This vehicle already in unbuyable");
        if(!dini_Exists(VFile(vehicleid)))
        {
                dini_Create(VFile(vehicleid));
                SetUnbuyableVehicle(vehicleid, 1);
        }
        else
        {
                SetUnbuyableVehicle(vehicleid, 1);
        }
        format(string, sizeof(string), "Now this %s is in unbuyable", VehNames[GetVehicleModel(vehicleid)-400]);
        SendClientMessage(playerid, Green, string);
        return 1;
}
 
dcmd_vbuyable(playerid, params[])
{
        #pragma unused params
        new vehicleid = GetPlayerVehicleID(playerid), string[50];
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,Red,"[ERROR]Only RCON Admin can use this command");
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"[ERROR]You must in vehicle to use this command");
        if(VehicleInfo[vehicleid][ToSell] == 0) return SendClientMessage(playerid,Red,"[ERROR]This is not a buyable");
        if(dini_Int(VFile(vehicleid),"UnBuyable")== 0) return SendClientMessage(playerid, Red, "[ERROR]This vehicle already in buyable");
        if(!dini_Exists(VFile(vehicleid)))
        {
                dini_Create(VFile(vehicleid));
                SetUnbuyableVehicle(vehicleid, 0);
        }
        else
        {
                SetUnbuyableVehicle(vehicleid, 0);
        }
        format(string, sizeof(string), "Now this %s is in buyable", VehNames[GetVehicleModel(vehicleid)-400]);
        SendClientMessage(playerid, Green, string);
        return 1;
}
 
dcmd_vlock(playerid, params[])
{
    #pragma unused params
    new vehicleid = GetPlayerVehicleID(playerid), string[50];
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"[ERROR]You must in vehicle to use this command");
        if(vehicleid==Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
                if(VehicleInfo[vehicleid][Locked] == 1) return SendClientMessage(playerid, Red, "[ERROR]This vehicle has been locked");
                SetVehicleLockStatus(vehicleid, 1);
                format(string, sizeof(string), "Now this %s has been locked", VehNames[GetVehicleModel(vehicleid)-400]);
                SendClientMessage(playerid, Green, string);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid==Car2(playerid) && vehicleid!=Car3(playerid))
        {
                if(VehicleInfo[vehicleid][Locked] == 1) return SendClientMessage(playerid, Red, "[ERROR]This vehicle has been locked");
                SetVehicleLockStatus(vehicleid, 1);
                format(string, sizeof(string), "Now this %s has been locked", VehNames[GetVehicleModel(vehicleid)-400]);
                SendClientMessage(playerid, Green, string);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid==Car3(playerid))
        {
                if(VehicleInfo[vehicleid][Locked] == 1) return SendClientMessage(playerid, Red, "[ERROR]This vehicle has been locked");
                SetVehicleLockStatus(vehicleid, 1);
                format(string, sizeof(string), "Now this %s has been locked", VehNames[GetVehicleModel(vehicleid)-400]);
                SendClientMessage(playerid, Green, string);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            SendClientMessage(playerid, Red, "[ERROR]This is not your car");
        }
        return 1;
}
 
dcmd_vunlock(playerid, params[])
{
        #pragma unused params
    new vehicleid = GetPlayerVehicleID(playerid), string[100];
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"[ERROR]You must in vehicle to use this command");
        if(vehicleid==Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
                if(VehicleInfo[vehicleid][Locked] == 0) return SendClientMessage(playerid, Red, "[ERROR]This vehicle not in locked");
                SetVehicleLockStatus(vehicleid, 0);
                format(string, sizeof(string), "Now this %s has been unlocked", VehNames[GetVehicleModel(vehicleid)-400]);
                SendClientMessage(playerid, Green, string);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid==Car2(playerid) && vehicleid!=Car3(playerid))
        {
                if(VehicleInfo[vehicleid][Locked] == 0) return SendClientMessage(playerid, Red, "[ERROR]This vehicle not in locked");
                SetVehicleLockStatus(vehicleid, 0);
                format(string, sizeof(string), "Now this %s has been unlocked", VehNames[GetVehicleModel(vehicleid)-400]);
                SendClientMessage(playerid, Green, string);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid==Car3(playerid))
        {
                if(VehicleInfo[vehicleid][Locked] == 0) return SendClientMessage(playerid, Red, "[ERROR]This vehicle not in locked");
                SetVehicleLockStatus(vehicleid, 0);
                format(string, sizeof(string), "Now this %s has been unlocked", VehNames[GetVehicleModel(vehicleid)-400]);
                SendClientMessage(playerid, Green, string);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            SendClientMessage(playerid, Red, "[ERROR]This is not your car");
        }
        return 1;
}
 
dcmd_vpark(playerid, params[])
{
    #pragma unused params
    new vehicleid = GetPlayerVehicleID(playerid), string[100];
    new Float:A, Float:B, Float:C;
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"[ERROR]You must in vehicle to use this command");
        if(vehicleid==Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
                GetPlayerPos(playerid, A, B, C);
                ParkVehicle1(vehicleid, playerid, A, B, C);
                format(string, sizeof(string), "You has park you car in %f, %f, %f", A, B, C);
                SendClientMessage(playerid, Green, string);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid==Car2(playerid) && vehicleid!=Car3(playerid))
        {
                GetPlayerPos(playerid, A, B, C);
                ParkVehicle2(vehicleid, playerid, A, B, C);
                format(string, sizeof(string), "You has park you car in %f, %f, %f", A, B, C);
                SendClientMessage(playerid, Green, string);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid==Car3(playerid))
        {
                GetPlayerPos(playerid, A, B, C);
                ParkVehicle3(vehicleid, playerid, A, B, C);
                format(string, sizeof(string), "You has park you car in %f, %f, %f", A, B, C);
                SendClientMessage(playerid, Green, string);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            SendClientMessage(playerid, Red, "[ERROR]This is not your car");
        }
        return 1;
}
 
dcmd_vplate(playerid, params[])
{
        new string[50], vehicleid = GetPlayerVehicleID(playerid);
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"[ERROR]You must in vehicle to use this command");
        if(!strlen(params)) return SendClientMessage(playerid, Red, "[ERROR]Use: /vplate [plate]");
        if(vehicleid==Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
                dini_Set(VFile(vehicleid),"Plate",params);
                SetVehicleNumberPlate(vehicleid, params);
                format(string, sizeof(string), "You car plate has been changed to %s", params);
                SendClientMessage(playerid, Green, string);
                SetVehicleToRespawn(vehicleid);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid==Car2(playerid) && vehicleid!=Car3(playerid))
        {
                dini_Set(VFile(vehicleid),"Plate",params);
                SetVehicleNumberPlate(vehicleid, params);
                format(string, sizeof(string), "You car plate has been changed to %s", params);
                SendClientMessage(playerid, Green, string);
                SetVehicleToRespawn(vehicleid);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid==Car3(playerid))
        {
                dini_Set(VFile(vehicleid),"Plate",params);
                SetVehicleNumberPlate(vehicleid, params);
                format(string, sizeof(string), "You car plate has been changed to %s", params);
                SendClientMessage(playerid, Green, string);
                SetVehicleToRespawn(vehicleid);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            SendClientMessage(playerid, Red, "[ERROR]This is not your car");
        }
        return 1;
}
 
dcmd_vhelp(playerid, params[])
{
        #pragma unused params
        SendClientMessage(playerid, Blue, "Ulric Vehicle System by ~Xaviour212~");
        SendClientMessage(playerid, Green, "Type /vbuy to buy a vehicle");
        SendClientMessage(playerid, Green, "Type /vsell to sell you car");
        SendClientMessage(playerid, Green, "Type /vcall to call your vehicle");
        SendClientMessage(playerid, Green, "Type /vlock to lock your car");
        SendClientMessage(playerid, Green, "Type /vunlock to unlock your car");
        SendClientMessage(playerid, Green, "Type /vpark to park your vehicle");
        SendClientMessage(playerid, Green, "Type /vplate to change your car plate");
        SendClientMessage(playerid, Green, "Type /mycar for look you car");
        SendClientMessage(playerid, Green, "Type /openbonnet to open you car bonnet");
        SendClientMessage(playerid, Green, "Type /closebonnet to close your car");
        SendClientMessage(playerid, Green, "Type /buyalarm to buy alarm");
        SendClientMessage(playerid, Green, "Type /alarmon for turned alarm");
        SendClientMessage(playerid, Green, "Type /alarmoff for turn off alarm");
        return 1;
}
 
dcmd_admvhelp(playerid, params[])
{
        #pragma unused params
        if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, Red, "You are not a admin");
        SendClientMessage(playerid, Blue, "Rcon Commands");
        SendClientMessage(playerid, Green, "Type /vbuyable to set a car to buyable");
        SendClientMessage(playerid, Green, "Type /vunbuyable to set a car to unbuyable");
        SendClientMessage(playerid, Green, "Type /vadmpark to park a vehicle");
        SendClientMessage(playerid, Green, "Type /setcost to set a vehicle cost");
        return 1;
}
 
dcmd_vadmpark(playerid, params[])
{
        #pragma unused params
    new vehicleid = GetPlayerVehicleID(playerid), string[100];
    new Float:A, Float:B, Float:C;
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,Red,"[ERROR]Only RCON admin can use this command");
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"[ERROR]You must in vehicle to use this command");
    GetPlayerPos(playerid, A, B, C);
        ParkVehicle(vehicleid);
        format(string, sizeof(string), "You has park this %s in %f, %f, %f", VehNames[GetVehicleModel(vehicleid)-400], A, B, C);
        SendClientMessage(playerid, Green, string);
        return 1;
}
 
dcmd_setcost(playerid, params[])
{
        new vehicleid = GetPlayerVehicleID(playerid), string[100];
    new cost;
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,Red,"[ERROR]Only RCON admin can use this command");
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"[ERROR]You must in vehicle to use this command");
    if(VehicleInfo[vehicleid][ToSell] == 0) return SendClientMessage(playerid,Red,"[ERROR]This is not a buyable");
    if(sscanf(params,"d",cost))return SendClientMessage(playerid, Red, "[ERROR]Usage: /setcost [Amount]");
    if(!dini_Exists(VFile(vehicleid)))
    {
        dini_Create(VFile(vehicleid));
                SetVehicleCost(vehicleid, cost);
        }
        else if(dini_Exists(VFile(vehicleid)))
    {
                SetVehicleCost(vehicleid, cost);
        }
        format(string, sizeof(string), "You has changed this %s cost to %d", VehNames[GetVehicleModel(vehicleid)-400], cost);
        SendClientMessage(playerid, Green, string);
        return 1;
}
 
dcmd_mycar(playerid, params[])
{
        #pragma unused params
        PlayerVehicle(playerid);
        return 1;
}
 
dcmd_openbonnet(playerid, params[])
{
        #pragma unused params
        new vehicleid = GetPlayerVehicleID(playerid);
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"[ERROR]You must in vehicle to use this command");
        if(vehicleid==Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, 1, 1, objective);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid==Car2(playerid) && vehicleid!=Car3(playerid))
        {
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, 1, 1, objective);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid==Car3(playerid))
        {
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, 1, 1, objective);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            SendClientMessage(playerid, Red, "[ERROR]This is not your car");
        }
        return 1;
}
 
dcmd_closebonnet(playerid, params[])
{
        #pragma unused params
        new vehicleid = GetPlayerVehicleID(playerid);
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"[ERROR]You must in vehicle to use this command");
        if(vehicleid==Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, 0, 0, objective);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid==Car2(playerid) && vehicleid!=Car3(playerid))
        {
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, 0, 0, objective);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid==Car3(playerid))
        {
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, 0, 0, objective);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            SendClientMessage(playerid, Red, "[ERROR]This is not your car");
        }
        return 1;
}
 
dcmd_opendoor(playerid, params[])
{
        #pragma unused params
        new vehicleid = GetPlayerVehicleID(playerid);
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"[ERROR]You must in vehicle to use this command");
        if(vehicleid==Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, engine, lights, alarm, 1, bonnet, boot, objective);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid==Car2(playerid) && vehicleid!=Car3(playerid))
        {
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, engine, lights, alarm, 1, bonnet, boot, objective);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid==Car3(playerid))
        {
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, engine, lights, alarm, 1, bonnet, boot, objective);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            SendClientMessage(playerid, Red, "[ERROR]This is not your car");
        }
        return 1;
}
 
dcmd_closedoor(playerid, params[])
{
        #pragma unused params
        new vehicleid = GetPlayerVehicleID(playerid);
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"[ERROR]You must in vehicle to use this command");
        if(vehicleid==Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, engine, lights, alarm, 0, bonnet, boot, objective);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid==Car2(playerid) && vehicleid!=Car3(playerid))
        {
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, engine, lights, alarm, 0, bonnet, boot, objective);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid==Car3(playerid))
        {
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, engine, lights, alarm, 0, bonnet, boot, objective);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            SendClientMessage(playerid, Red, "[ERROR]This is not your car");
        }
        return 1;
}
 
dcmd_lighton(playerid, params[])
{
        #pragma unused params
        new vehicleid = GetPlayerVehicleID(playerid);
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"[ERROR]You must in vehicle to use this command");
        if(vehicleid==Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, engine, 1, alarm, doors, bonnet, boot, objective);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid==Car2(playerid) && vehicleid!=Car3(playerid))
        {
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, engine, 1, alarm, doors, bonnet, boot, objective);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid==Car3(playerid))
        {
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, engine, 1, alarm, doors, bonnet, boot, objective);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            SendClientMessage(playerid, Red, "[ERROR]This is not your car");
        }
        return 1;
}
 
dcmd_lightoff(playerid, params[])
{
        #pragma unused params
        new vehicleid = GetPlayerVehicleID(playerid);
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"[ERROR]You must in vehicle to use this command");
        if(vehicleid==Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, engine, 0, alarm, doors, bonnet, boot, objective);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid==Car2(playerid) && vehicleid!=Car3(playerid))
        {
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, engine, 0, alarm, doors, bonnet, boot, objective);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid==Car3(playerid))
        {
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, engine, 0, alarm, doors, bonnet, boot, objective);
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            SendClientMessage(playerid, Red, "[ERROR]This is not your car");
        }
        return 1;
}
 
dcmd_buyalarm(playerid, params[])
{
        #pragma unused params
        new vehicleid = GetPlayerVehicleID(playerid);
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"[ERROR]You must in vehicle to use this command");
        if(vehicleid==Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            if(VehicleInfo[vehicleid][Alarm] == 1) return SendClientMessage(playerid, Red, "[ERROR]This vehicle already have alarm");
            VehicleInfo[vehicleid][Alarm] = 1;
            dini_IntSet(VFile(vehicleid),"Alarm",1);
            SendClientMessage(playerid, Blue, "Your vehicle has an alarm installed");
        }
        else if(vehicleid!=Car1(playerid) && vehicleid==Car2(playerid) && vehicleid!=Car3(playerid))
        {
            if(VehicleInfo[vehicleid][Alarm] == 1) return SendClientMessage(playerid, Red, "[ERROR]This vehicle already have alarm");
            VehicleInfo[vehicleid][Alarm] = 1;
            dini_IntSet(VFile(vehicleid),"Alarm",1);
            SendClientMessage(playerid, Blue, "Your vehicle has an alarm installed");
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid==Car3(playerid))
        {
            if(VehicleInfo[vehicleid][Alarm] == 1) return SendClientMessage(playerid, Red, "[ERROR]This vehicle already have alarm");
            VehicleInfo[vehicleid][Alarm] = 1;
            dini_IntSet(VFile(vehicleid),"Alarm",1);
            SendClientMessage(playerid, Blue, "Your vehicle has an alarm installed");
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            SendClientMessage(playerid, Red, "[ERROR]This is not your car");
        }
        return 1;
}
 
dcmd_alarmon(playerid, params[])
{
        #pragma unused params
        new vehicleid = GetPlayerVehicleID(playerid);
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"[ERROR]You must in vehicle to use this command");
        if(vehicleid==Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            if(VehicleInfo[vehicleid][Alarm] == 0) return SendClientMessage(playerid, Red, "[ERROR]This vehicle didnt have alarm");
            if(VehicleInfo[vehicleid][AlarmOn] == 1) return SendClientMessage(playerid, Red, "[ERROR]Alarm has been active in this vehicle");
            VehicleInfo[vehicleid][AlarmOn] = 1;
            dini_IntSet(VFile(vehicleid),"AlarmOn",1);
            SendClientMessage(playerid, Blue, "Alarm has been turned");
        }
        else if(vehicleid!=Car1(playerid) && vehicleid==Car2(playerid) && vehicleid!=Car3(playerid))
        {
            if(VehicleInfo[vehicleid][Alarm] == 0) return SendClientMessage(playerid, Red, "[ERROR]This vehicle didnt have alarm");
            if(VehicleInfo[vehicleid][AlarmOn] == 1) return SendClientMessage(playerid, Red, "[ERROR]Alarm has been active in this vehicle");
            VehicleInfo[vehicleid][AlarmOn] = 1;
            dini_IntSet(VFile(vehicleid),"AlarmOn",1);
        SendClientMessage(playerid, Blue, "Alarm has been turned");
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid==Car3(playerid))
        {
            if(VehicleInfo[vehicleid][Alarm] == 0) return SendClientMessage(playerid, Red, "[ERROR]This vehicle didnt have alarm");
            if(VehicleInfo[vehicleid][AlarmOn] == 1) return SendClientMessage(playerid, Red, "[ERROR]Alarm has been active in this vehicle");
            VehicleInfo[vehicleid][AlarmOn] = 1;
            dini_IntSet(VFile(vehicleid),"AlarmOn",1);
            SendClientMessage(playerid, Blue, "Alarm has been turned");
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            SendClientMessage(playerid, Red, "[ERROR]This is not your car");
        }
        return 1;
}
 
dcmd_alarmoff(playerid, params[])
{
        #pragma unused params
        new vehicleid = GetPlayerVehicleID(playerid);
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"[ERROR]You must in vehicle to use this command");
        if(vehicleid==Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            if(VehicleInfo[vehicleid][Alarm] == 0) return SendClientMessage(playerid, Red, "[ERROR]This vehicle didnt have alarm");
            if(VehicleInfo[vehicleid][AlarmOn] == 0) return SendClientMessage(playerid, Red, "[ERROR]Alarm in this vehicle didnt in active");
            VehicleInfo[vehicleid][AlarmOn] = 0;
            dini_IntSet(VFile(vehicleid),"AlarmOn",0);
        SendClientMessage(playerid, Blue, "Alarm has been turn off");
        }
        else if(vehicleid!=Car1(playerid) && vehicleid==Car2(playerid) && vehicleid!=Car3(playerid))
        {
            if(VehicleInfo[vehicleid][Alarm] == 0) return SendClientMessage(playerid, Red, "[ERROR]This vehicle didnt have alarm");
            if(VehicleInfo[vehicleid][AlarmOn] == 0) return SendClientMessage(playerid, Red, "[ERROR]Alarm in this vehicle didnt in active");
            VehicleInfo[vehicleid][AlarmOn] = 0;
            dini_IntSet(VFile(vehicleid),"AlarmOn",0);
            SendClientMessage(playerid, Blue, "Alarm has been turn off");
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid==Car3(playerid))
        {
            if(VehicleInfo[vehicleid][Alarm] == 0) return SendClientMessage(playerid, Red, "[ERROR]This vehicle didnt have alarm");
            if(VehicleInfo[vehicleid][AlarmOn] == 0) return SendClientMessage(playerid, Red, "[ERROR]Alarm in this vehicle didnt in active");
            VehicleInfo[vehicleid][AlarmOn] = 0;
            dini_IntSet(VFile(vehicleid),"AlarmOn",0);
            SendClientMessage(playerid, Blue, "Alarm has been turn off");
        }
        else if(vehicleid!=Car1(playerid) && vehicleid!=Car2(playerid) && vehicleid!=Car3(playerid))
        {
            SendClientMessage(playerid, Red, "[ERROR]This is not your car");
        }
        return 1;
}
/*==============================================================================
                                                                Function
==============================================================================*/
forward SetVehicleCost(vehicleid, cost);
public SetVehicleCost(vehicleid, cost)
{
        dini_IntSet(VFile(vehicleid),"Cost",cost);
        VehicleInfo[vehicleid][Cost] = cost;
}
 
forward SetVehicleOwner(vehicleid, playerid);
public SetVehicleOwner(vehicleid, playerid)
{
    dini_IntSet(VFile(vehicleid),"Owned",1);
    dini_Set(VFile(vehicleid),"Owner",Gn(playerid));
    dini_Set(VFile(vehicleid),"Plate",Gn(playerid));
}
 
forward SetVehicleNotOwned(vehicleid);
public SetVehicleNotOwned(vehicleid)
{
    dini_IntSet(VFile(vehicleid),"Owner",0);
        dini_IntSet(VFile(vehicleid),"Owned",0);
        dini_IntSet(VFile(vehicleid),"UnBuyable",0);
        SetVehicleLockStatus(vehicleid, 0);
}
 
SetUnbuyableVehicle(vehicleid, status)
{
        dini_IntSet(VFile(vehicleid),"UnBuyable",status);
        dini_IntSet(VFile(vehicleid),"Owned",0);
        dini_IntSet(VFile(vehicleid),"Owner",0);
}
 
SetVehicleLockStatus(vehicleid, status)
{
    dini_IntSet(VFile(vehicleid),"Lock",status);
    VehicleInfo[vehicleid][Locked] = status;
}
 
SetPlayerSlot1(playerid, vehicleid)
{
    dini_IntSet(PFile(playerid),"Slot1",vehicleid);
}
 
SetPlayerSlot2(playerid, vehicleid)
{
    dini_IntSet(PFile(playerid),"Slot2",vehicleid);
}
 
SetPlayerSlot3(playerid, vehicleid)
{
    dini_IntSet(PFile(playerid),"Slot3",vehicleid);
}
 
SetSlot1PlayerEmpty(playerid)
{
    dini_IntSet(PFile(playerid),"Slot1",0);
}
 
SetSlot2PlayerEmpty(playerid)
{
    dini_IntSet(PFile(playerid),"Slot2",0);
}
 
SetSlot3PlayerEmpty(playerid)
{
    dini_IntSet(PFile(playerid),"Slot3",0);
}
 
stock Car1(playerid) return dini_Int(PFile(playerid),"Slot1");
 
stock Car2(playerid) return dini_Int(PFile(playerid),"Slot2");
 
stock Car3(playerid) return dini_Int(PFile(playerid),"Slot3");
 
ParkVehicle1(vehicleid, playerid, Float:X, Float:Y, Float:Z)
{
    dini_IntSet(VFile(vehicleid),"Parked",1);
        GetVehiclePos(Car1(playerid),X,Y,Z);
        dini_FloatSet(VFile(vehicleid),"X",X);
        dini_FloatSet(VFile(vehicleid),"Y",Y);
        dini_FloatSet(VFile(vehicleid),"Z",Z);
        VehicleInfo[vehicleid][Parked] = 1;
}
 
ParkVehicle2(vehicleid, playerid, Float:X, Float:Y, Float:Z)
{
    dini_IntSet(VFile(vehicleid),"Parked",1);
        GetVehiclePos(Car2(playerid),X,Y,Z);
        dini_FloatSet(VFile(vehicleid),"X",X);
        dini_FloatSet(VFile(vehicleid),"Y",Y);
        dini_FloatSet(VFile(vehicleid),"Z",Z);
        VehicleInfo[vehicleid][Parked] = 1;
}
 
ParkVehicle3(vehicleid, playerid, Float:X, Float:Y, Float:Z)
{
    dini_IntSet(VFile(vehicleid),"Parked",1);
        GetVehiclePos(Car3(playerid),X,Y,Z);
        dini_FloatSet(VFile(vehicleid),"X",X);
        dini_FloatSet(VFile(vehicleid),"Y",Y);
        dini_FloatSet(VFile(vehicleid),"Z",Z);
        VehicleInfo[vehicleid][Parked] = 1;
}
 
ParkVehicle(vehicleid)
{
        new Float:A, Float:B, Float:C;
    dini_IntSet(VFile(vehicleid),"Parked",1);
        GetVehiclePos(vehicleid,A,B,C);
        dini_FloatSet(VFile(vehicleid),"X",A);
        dini_FloatSet(VFile(vehicleid),"Y",B);
        dini_FloatSet(VFile(vehicleid),"Z",C);
        VehicleInfo[vehicleid][Parked] = 1;
}
 
forward Timer1(playerid);
public Timer1(playerid)
{
        new veh1 = Car1(playerid);
        new string[128];
        CallVehicle1(playerid);
        format(string, sizeof(string), "Your %s has been teleported to you. Enjoy with you car", VehNames[GetVehicleModel(veh1)-400]);
        SendClientMessage(playerid, Green, string);
}
 
forward Timer2(playerid);
public Timer2(playerid)
{
        new veh2 = Car2(playerid);
        new string[128];
        CallVehicle2(playerid);
        format(string, sizeof(string), "Your %s has been teleported to you. Enjoy with you car", VehNames[GetVehicleModel(veh2)-400]);
        SendClientMessage(playerid, Green, string);
}
 
forward Timer3(playerid);
public Timer3(playerid)
{
        new veh3 = Car3(playerid);
        new string[128];
        CallVehicle3(playerid);
        format(string, sizeof(string), "Your %s has been teleported to you. Enjoy with you car", VehNames[GetVehicleModel(veh3)-400]);
        SendClientMessage(playerid, Green, string);
}
 
CallVehicle1(playerid)
{
        new Float:p[4];
        GetPlayerPos(playerid,p[0],p[1],p[2]);
        GetPlayerFacingAngle(playerid,p[3]);
        SetVehiclePos(Car1(playerid),p[0]+3,p[1],p[2]);
        SetVehicleZAngle(Car1(playerid),p[3]);
}
 
CallVehicle2(playerid)
{
        new Float:p[4];
        GetPlayerPos(playerid,p[0],p[1],p[2]);
        GetPlayerFacingAngle(playerid,p[3]);
        SetVehiclePos(Car2(playerid),p[0]+3,p[1],p[2]);
        SetVehicleZAngle(Car2(playerid),p[3]);
}
 
CallVehicle3(playerid)
{
        new Float:p[4];
        GetPlayerPos(playerid,p[0],p[1],p[2]);
        GetPlayerFacingAngle(playerid,p[3]);
        SetVehiclePos(Car3(playerid),p[0]+3,p[1],p[2]);
        SetVehicleZAngle(Car3(playerid),p[3]);
}
 
forward DisableAlarm(vehicleid);
public DisableAlarm(vehicleid)
{
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
        SetVehicleParamsEx(vehicleid, engine, lights, 0, doors, bonnet, boot, objective);
        return 1;
}
 
stock CreateUlricVehicle(VehicleModel, Float:X, Float:Y, Float:Z, Float:angle, Colour1, Colour2, cost)
{
        new ulric = AddStaticVehicle(VehicleModel, X, Y, Z, angle, Colour1, Colour2);
        dini_Create(VFile(ulric));
        VehicleInfo[ulric][ToSell] = 1;
        SetVehicleCost(ulric, cost);
        return 1;
}
 
PlayerVehicle(playerid)
{
        new string[128]; new veh3=Car3(playerid);
        new veh1=Car1(playerid); new veh2=Car2(playerid);
        SendClientMessage(playerid, Blue, "");
        SendClientMessage(playerid, Blue, "");
        format(string, sizeof(string), "===========%s Vehicle=========", Gn(playerid));
        SendClientMessage(playerid, Blue, string);
        if(Car1(playerid) > 0)
        {
            format(string, sizeof(string), "Slot 1 - %s", VehNames[GetVehicleModel(veh1)-400]);
            SendClientMessage(playerid, Green, string);
        }
        else if(Car1(playerid) == 0)
        {
                format(string, sizeof(string), "Slot 1 - NONE");
            SendClientMessage(playerid, Green, string);
        }
        if(Car2(playerid) > 0)
        {
                format(string, sizeof(string), "Slot 2 - %s", VehNames[GetVehicleModel(veh2)-400]);
            SendClientMessage(playerid, Green, string);
        }
        else if(Car2(playerid) == 0)
        {
                format(string, sizeof(string), "Slot 2 - NONE");
            SendClientMessage(playerid, Green, string);
        }
        if(Car3(playerid) > 0)
        {
                format(string, sizeof(string), "Slot 3 - %s", VehNames[GetVehicleModel(veh3)-400]);
            SendClientMessage(playerid, Green, string);
        }
        else if(Car3(playerid) == 0)
        {
                format(string, sizeof(string), "Slot 3 - NONE");
            SendClientMessage(playerid, Green, string);
        }
        SendClientMessage(playerid, Blue, "=================================");
}
 
stock Gn(playerid)
{
        new pname[24];
        GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
        return pname;
}
 
stock PFile(playerid)
{
        format(file,64,"Cars/Users/%s.ini",Gn(playerid));
        return file;
}
 
stock VFile(vehicleid)
{
        new Car[64];
        format(Car,64,"Cars/%d.ini",vehicleid);
        return Car;
}
Reply


Messages In This Thread
Problem Occuirng In Ulric Vehicle System - by TheRaGeLord - 14.06.2014, 06:05
Re: Problem Occuirng In Ulric Vehicle System - by TheRaGeLord - 14.06.2014, 07:15
Re: Problem Occuirng In Ulric Vehicle System - by tandytanz - 14.06.2014, 10:19

Forum Jump:


Users browsing this thread: 1 Guest(s)