25.03.2013, 18:20
Its my first time to work in a gamemode like this because here the cars for faction like fbi pd and other its loaded from cars.cfg and in gm i only find some few things there no models id for that car is fbi or pd so when i try to add an carr in gamemode and make it to work only for that faction its not possible i tryed too many times i know i have some wrong somewhere, thats why i need your help.
Let say this is faction FBI (isafbicar) - default in GM.
So i add cars in other way not in the file cars.cfg i add them in gamemode.
And the cars:
So i change the car restriction like if you fbi you can drive if not you cant.
Default in GM:
I change to:
There is a system for vehicle engine and i add there the (IsAnFBiCar)
So the problem is there cars in the gamemode but everyone can drive them i try and other way in (newstate == PLAYER_STATE_DRIVER) i put this:
But now the commands like /lockfcar not work because the car is not loaded like the basic other cars its loaded in other way also this cars FBI when i try to start /engine on they not work they need toolkit to broke the lock and to can start engine but for Elegant cars they dont need engine they allredy started ? Here down is basic from the cars.cfg but i dont know how they are loaded and how i can add static cars for organization like pd fbi and if i want to add elegant or sultan maybe will says something other not like what i want.
Let say this is faction FBI (isafbicar) - default in GM.
pawn Код:
IsAFBICar(carid)
{
for(new i = 0; i < sizeof(CarInfo); i++)
{
if(CarInfo[i][cID] == carid)
{
if (CarInfo[i][cFaction] == CAR_FACTION_FBI)
{
return true;
}
}
}
return false;
}
pawn Код:
stock IsAnFbiCar(carid)
{
if(carid == FBI1 || carid == FBI2 || carid == FBI3 || carid == FBI4)
{
return 1;
}
return 0;
}
pawn Код:
FBI1 = AddStaticVehicleEx(507,252.3000000,-1631.5000000,33.1000000,52.0000000,70,89,15); //Elegant
FBI2 = AddStaticVehicleEx(490,284.7000100,-1632.0000000,33.6000000,82.0000000,-1,-1,15); //FBI Rancher
FBI3 = AddStaticVehicleEx(490,298.7000100,-1633.6999500,33.6000000,83.9960000,-1,-1,15); //FBI Rancher
FBI4 = AddStaticVehicleEx(507,247.0000000,-1610.4000200,33.0000000,30.0000000,70,89,15); //Elegant
Default in GM:
Код:
if (CarInfo[i][cFaction] == CAR_FACTION_FBI) { if(PlayerInfo[playerid][pMember] != 2 && PlayerInfo[playerid][pLeader] != 2) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_RED,"Niste clan FBI organizacije."); } }
Код:
if (CarInfo[i][cFaction] == CAR_FACTION_FBI && model != IsAnFbiCar(model)) { if(PlayerInfo[playerid][pMember] != 2 && PlayerInfo[playerid][pLeader] != 2) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_RED,"Niste clan FBI organizacije."); } }
pawn Код:
IsAVehicleForEngine(vehicle)
{
for(new i = 0; i < sizeof(CarInfo); i++)
{
if(CarInfo[i][cID] == vehicle)
{
if( IsATruck(vehicle) ||
IsANormal(vehicle) ||
IsAEvent(vehicle) ||
IsACopCar(vehicle) ||
IsAFBICar(vehicle) ||
IsANewsCar(vehicle) ||
IsADoctorCar(vehicle) ||
IsAFishBoat(vehicle) ||
IsAKarting(vehicle) ||
IsAPizzaBoy(vehicle) ||
IsAIceCreamTruck2(vehicle) ||
IsAMayorVeh(vehicle) ||
IsALicenseVeh(vehicle) ||
IsASRCar(vehicle) ||
IsAGradjevinarCar(vehicle) ||
IsASweeper2(vehicle) ||
IsAFactionHarvest(vehicle) ||
IsAKamion2(vehicle) ||
IsABus2(vehicle) ||
IsATestCar(vehicle) ||
IsATaxi2(vehicle) ||
IsATestBoat(vehicle) ||
IsATow2(vehicle) ||
IsAnFbiCar(vehicle))
{
return true;
}
}
}
return false;
}
pawn Код:
if(IsAnFbiCar(newcar))
{
if(PlayerInfo[playerid][pLeader] == 2||PlayerInfo[playerid][pMember] == 2) { }
else {
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");}
}
pawn Код:
420,0,2,0,1778.677368,-1933.161010,13.253190,359.263488,-1,-1,300,0,26,0,0,0,349
438,0,2,0,1777.065673,-1895.066284,13.165300,268.102996,-1,-1,300,0,26,0,0,0,350
438,0,2,0,1777.049926,-1898.426269,13.168100,269.598114,-1,-1,300,0,26,0,0,0,351
438,0,2,0,1777.249755,-1902.347900,13.165800,271.104309,-1,-1,300,0,26,0,0,0,352
438,0,2,0,1777.308837,-1906.208740,13.166296,269.123901,-1,-1,300,0,26,0,0,0,353
438,0,2,0,1777.443481,-1909.882690,13.167098,271.085388,-1,-1,300,0,26,0,0,0,354
525,0,2,0,1604.2959,-1836.9579,13.3856,270.2015,1,2,120,16,7,0,0,0,355
525,0,2,0,1603.8812,-1824.9948,13.3497,269.3648,1,2,120,16,7,0,0,0,356
525,0,2,0,1599.3904,-1814.6191,13.3069,268.1912,1,3,120,16,7,0,0,0,357
525,0,2,0,1599.5531,-1791.1028,13.2348,268.9581,1,3,120,16,7,0,0,0,358
551,0,1,0,1197.764526,-1830.885498,13.061200,270.231994,-1,-1,600,11,0,1,0,0,359
551,0,1,0,1250.628540,-1804.741943,13.167490,127.289100,-1,-1,600,11,0,1,0,0,360