Szerző Téma: Car Ownership by Mr.Gagi  (Megtekintve 1451 alkalommal)

Nem elérhető JBauer

  • 1407
    • Profil megtekintése
Car Ownership by Mr.Gagi
« Dátum: 2012. május 05. - 21:40:59 »
+2 Show voters
Sziasztok. Most találtam a www.sa-mp.com -on ezt a filterscriptet, mely igazából egy autó rendszer. Letöltöttem majd lemagyarosítottam. Remélem tetszeni fog!
Eredeti link: http://forum.sa-mp.com/showthread.php?p=1767935#post1767935
Magyar pwn fájl: http://data.hu/get/5079207/CoS.pwn
Magyar amx fájl: http://data.hu/get/5079206/CoS.amx
Scriptfiles: http://data.hu/get/5079205/scriptfiles.7z
Pastebin: http://pastebin.com/4m7MB5R3
Parancsok:
/buycar - Ide majd be kell írnod a te koordinátáidat (fs eleje) - autóvétel
/stopbuying - autóvétel vége
/v - az autóval végezhetõ dolgok (pl.: szín váltás)
/gpsoff - kikapcsolja a keresést
/cwithdraw - pénzt raksz be az autóba
/cdeposit - pénz veszel ki az autóból
/cputgun - fegyvert raksz be az autóba
/ctakegun - fegyvert veszel ki az autóból
/sellto - eladod az autót egy játékosnak
/acceptsell - megveszed az autót egy másik játékostól
/refusesell - nem veszed meg az autót egy másik játékostól
Várható még egy IG \"event\" készítõ és egy házrendszer, szintén Gagitól.
Remélem tetszeni fog!
JBauer
 
//Source for max car speed: http://gta.wikia.com/Vehicle_Stats_in_GTA_San_Andreas
#define FILTERSCRIPT
#include <a_samp>
#include <sscanf2>
#include <YSI/y_ini>
#include <YSI\\y_commands>
#include <fixchars>
#pragma tabsize 0
#define COORDINATES 1539.8837,-1727.0519,13.5469//Ide írd be a koordinátákat
#define COORDINATES_FOR_BUY 1419.2805,-1727.1952,13.5391//A /autovesz koordinátája
#define SPAWN_cX 1419.2805//A megvett autó X koordinátája
#define SPAWN_cY -1727.1952//A megvett autó Y koordinátája
#define SPAWN_cZ 13.5391//A megvett autó Z koordinátája
#define SPAWN_cA 90//A megvett autó forgása
#define COLOR_RED 0xCF212D
#define SCM SendClientMessage
#define NUMBER_FOR_LOAD 2
#define MAX_CARS  1000
#define NUMBER_OF_VEHICLES 4
#define Player_File \"CoS/Player/%s.ini\"
#define CoS_File \"CoS/%d.ini\"
#define DIALOG_CARS 1390
new bool:False = false, _S_T_R_[128];
#define SendFormatMSG(%0,%1,%2,%3)\\
do{\\
   format(_S_T_R_, sizeof (_S_T_R_), (%2), %3);\\
   SendClientMessage((%0),(%1), _S_T_R_);\\
}\\
while (False)
#define COL_WHITE  \"{FFFFFF}\"
new
VehicleID,
ChoosedCar,
Text:CoSTD0[MAX_PLAYERS],
bool:PlayerSwitchVehicle[MAX_PLAYERS],
bool:PlayerChooseVehicle,
maximalcars,
GPSOn[MAX_PLAYERS],
Seller[MAX_PLAYERS],
Priceo[MAX_PLAYERS],
Text:AlarmTD0[MAX_PLAYERS],
Text:AlarmTD1[MAX_PLAYERS],
AlarmChoose[MAX_PLAYERS],
AlarmChooseID[MAX_PLAYERS];
enum cars
{
Model,
Price,
Level,
Speed
}
new CarModel[NUMBER_OF_VEHICLES][cars];
enum data
{
Veh1,
Veh2,
Veh3
}
new Player[MAX_PLAYERS][data];
enum cdata
{
Model,
Float:cX,
Float:cY,
Float:cZ,
Float:cA,
Col1,
Col2,
Lock,
Owner[32],
ID,
Money,
Gun1,Ammo1,
Gun2,Ammo2,
Alarm
}
new C_Data[MAX_CARS][cdata];
new CarNames[][] =
{
    \"Landstalker\", \"Bravura\", \"Buffalo\", \"Linerunner\", \"Perrenial\", \"Sentinel\",
        \"Dumper\", \"Firetruck\", \"Trashmaster\", \"Stretch\", \"Manana\", \"Infernus\", \"Voodoo\",
        \"Pony\", \"Mule\", \"Cheetah\", \"Ambulance\", \"Leviathan\", \"Moonbeam\", \"Esperanto\",
        \"Taxi\", \"Washington\", \"Bobcat\", \"Whoopee\", \"BF Injection\", \"Hunter\", \"Premier\",
        \"Enforcer\", \"Securicar\", \"Banshee\", \"Predator\", \"Bus\", \"Rhino\", \"Barracks\",
        \"Hotknife\", \"Trailer 1\", \"Previon\", \"Coach\", \"Cabbie\", \"Stallion\", \"Rumpo\",
        \"RC Bandit\", \"Romero\", \"Packer\", \"Monster\", \"Admiral\", \"Squalo\", \"Seasparrow\",
    \"Pizzaboy\", \"Tram\", \"Trailer 2\", \"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\", \"ZR-350\",
        \"Walton\", \"Regina\", \"Comet\", \"BMX\", \"Burrito\", \"Camper\", \"Marquis\", \"Baggage\",
        \"Dozer\", \"Maverick\", \"Chopper\", \"Rancher\", \"FBI Rancher\", \"Virgo\", \"Greenwood\",
        \"Jetmax\", \"Hotring\", \"Sandking\", \"Blista Compact\", \"Police Maverick\", \"Boxvillde\",
        \"Benson\", \"Mesa\", \"RC Goblin\", \"Hotring Racer A\", \"Hotring Racer B\", \"Bloodring Banger\",
        \"Rancher\", \"Super GT\", \"Elegant\", \"Journey\", \"Bike\", \"Mountain Bike\", \"Beagle\",
        \"Cropduster\", \"Stunt\", \"Tanker\", \"Roadtrain\", \"Nebula\", \"Majestic\", \"Buccaneer\",
        \"Shamal\", \"Hydra\", \"FCR-900\", \"NRG-500\", \"HPV1000\", \"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\",
        \"Monster\", \"Uranus\", \"Jester\", \"Sultan\", \"Stratum\", \"Elegy\", \"Raindance\", \"RC Tiger\",
        \"Flash\", \"Tahoma\", \"Savanna\", \"Bandito\", \"Freight Flat\", \"Streak Carriage\", \"Kart\",
        \"Mower\", \"Dune\", \"Sweeper\", \"Broadway\", \"Tornado\", \"AT-400\", \"DFT-30\", \"Huntley\",
        \"Stafford\", \"BF-400\", \"News Van\", \"Tug\", \"Trailer 3\", \"Emperor\", \"Wayfarer\", \"Euros\",
        \"Hotdog\", \"Club\", \"Freight Box\", \"Trailer\", \"Andromada\", \"Dodo\", \"RC Cam\", \"Launch\",
        \"LSPD Car\", \"SFPD Car\", \"LVPD Car\", \"Police Ranger\", \"Picador\", \"S.W.A.T Tank\", \"Alpha\",
        \"Phoenix\", \"Glendale\", \"Sadler\", \"Luggage Trailer 1\", \"Luggage Trailer 2\", \"Stairs Trailer\",
    \"Boxville\", \"Utility Trailer 1\", \"Utility Trailer 2\"
};
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" CoS by Mr.Gagi Magyarosítva: JBauer\");
print(\"--------------------------------------\\n\");
    AddMoreCar(404,5000,150,2);
AddMoreCar(405,9000,165,3);
AddMoreCar(415,19000,230,7);
AddMoreCar(421,10000,180,5);
VehicleID = AddStaticVehicleEx(CarModel[1][Model],COORDINATES,1,1,3600);
new gFile[35];
for(new i = NUMBER_FOR_LOAD; i <= MAX_CARS;i++)
{
format(gFile, 35, CoS_File,i);
INI_ParseFile(gFile, \"LoadCar\", .bExtra = true, .extra = i);
C_Data[iD] = CreateVehicle(C_Data[Model], C_Data[cX],C_Data[cY],C_Data[cZ],C_Data[cA], C_Data[Col1], C_Data[Col2], 30000);
}
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
 
main()
{
print(\"\\n----------------------------------\");
print(\" CoS by Mr.Gagi Magyarosítva: JBauer\");
print(\"----------------------------------\\n\");
}
public OnGameModeInit()
{
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
return 1;
}
stock GetName(playerid)
{
    new
        pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    return pName;
}
public OnPlayerConnect(playerid)
{
CoSTD0[playerid] = TextDrawCreate(270.000000, 371.000000, \"~y~Típus: ~w~Cheetah   ~y~Ár: ~g~$5~n~          ~y~Maximális sebesség: ~w~200\");
TextDrawBackgroundColor(CoSTD0[playerid], 255);
TextDrawFont(CoSTD0[playerid], 2);
TextDrawLetterSize(CoSTD0[playerid], 0.370000, 1.000000);
TextDrawColor(CoSTD0[playerid], -1);
TextDrawSetOutline(CoSTD0[playerid], 1);
TextDrawSetProportional(CoSTD0[playerid], 1);
AlarmTD0[playerid] = TextDrawCreate(40.000000, 150.000000, \"~n~\");
TextDrawBackgroundColor(AlarmTD0[playerid], 255);
TextDrawFont(AlarmTD0[playerid], 1);
TextDrawLetterSize(AlarmTD0[playerid], 0.360000, 3.300000);
TextDrawColor(AlarmTD0[playerid], -1);
TextDrawSetOutline(AlarmTD0[playerid], 0);
TextDrawSetProportional(AlarmTD0[playerid], 1);
TextDrawSetShadow(AlarmTD0[playerid], 1);
TextDrawUseBox(AlarmTD0[playerid], 1);
TextDrawBoxColor(AlarmTD0[playerid], -206);
TextDrawTextSize(AlarmTD0[playerid], 117.000000, 0.000000);
AlarmTD1[playerid] = TextDrawCreate(40.000000, 150.000000, \"~p~~h~Riasztó: ~r~BE~n~~n~~p~~h~Riasztó: ~w~KI\");
TextDrawBackgroundColor(AlarmTD1[playerid], 255);
TextDrawFont(AlarmTD1[playerid], 2);
TextDrawLetterSize(AlarmTD1[playerid], 0.290000, 0.899999);
TextDrawColor(AlarmTD1[playerid], -1);
TextDrawSetOutline(AlarmTD1[playerid], 1);
TextDrawSetProportional(AlarmTD1[playerid], 1);
new pFile[48];
format(pFile, 48, Player_File, GetName(playerid));
if(!fexist(pFile))
{
    new
    INI:UserFile = INI_Open(pFile);
    INI_WriteInt(UserFile, \"Veh1\",9999);
    INI_WriteInt(UserFile, \"Veh2\", 9999);
    INI_WriteInt(UserFile, \"Veh3\", 9999);
    INI_Close(UserFile);
}
INI_ParseFile(pFile, \"LoadPlayerData\", .bExtra = true, .extra = playerid);
Priceo[playerid] = 0;
Seller[playerid] = 999;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
TextDrawDestroy(CoSTD0[playerid]);
TextDrawDestroy(AlarmTD0[playerid]);
TextDrawDestroy(AlarmTD1[playerid]);
new
        pFile[35];
   format(pFile, 35, Player_File, GetName(playerid));
    new
    INI:UserFile = INI_Open(pFile);
    INI_WriteInt(UserFile, \"Veh1\", Player[playerid][Veh1]);
    INI_WriteInt(UserFile, \"Veh2\", Player[playerid][Veh2]);
    INI_WriteInt(UserFile, \"Veh3\", Player[playerid][Veh3]);
    INI_Close(UserFile);
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
 
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)//TU STAo
{
new Float:Pos[3],string[128]; GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
if(vehicleid == VehicleID) return SCM(playerid,-1,\"Nem tudsz beülni az autóba.\"),SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
if(C_Data[vehicleid][Lock] == 1) return GameTextForPlayer(playerid,\"~r~Az autó zárva van\",3000,0),SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
if(C_Data[vehicleid][Alarm] == 1)
{
format(string,128,\"*%s megpróbálja ellopni az autót.\",GetName(playerid));
    ProxDetector(playerid, string, 0xB91BE0, 30);
    SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
    return 1;
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_SECONDARY_ATTACK)
{
if(AlarmChoose[playerid] == 1)
{
            AlarmChoose[playerid] = 0;
            C_Data[AlarmChooseID[playerid]][Alarm] = 1;
            TextDrawHideForPlayer(playerid,AlarmTD0[playerid]);
            TextDrawHideForPlayer(playerid,AlarmTD1[playerid]);
            SCM(playerid,-1,\"A riasztó bekapcsolva\");
            CheckCar(AlarmChooseID[playerid]);
            RemovePlayerFromVehicle(playerid);
         }
if(AlarmChoose[playerid] == 2)
{
            AlarmChoose[playerid] = 0;
            C_Data[AlarmChooseID[playerid]][Alarm] = 0;
            TextDrawHideForPlayer(playerid,AlarmTD0[playerid]);
            TextDrawHideForPlayer(playerid,AlarmTD1[playerid]);
            SCM(playerid,-1,\"A riasztó kikapcsolva.\");
            CheckCar(AlarmChooseID[playerid]);
            RemovePlayerFromVehicle(playerid);
         }
     if(PlayerSwitchVehicle[playerid] == true)
{
      if(Player[playerid][Veh1] == 9999 || Player[playerid][Veh2] == 9999 || Player[playerid][Veh3] == 9999)
      {
      if(GetPlayerMoney(playerid) < CarModel[ChoosedCar][Price]) return SCM(playerid,-1,\"Nincsen elég pénzed.\");
      if(GetPlayerScore(playerid) < CarModel[ChoosedCar][Level]) return SCM(playerid,-1,\"Nincsen elég pontod.\");
      new i = GetNextFreeID();
                SetCameraBehindPlayer(playerid);
      SendFormatMSG(playerid,-1,\"Megvetted az autót %d$-ért\",CarModel[ChoosedCar][Price]);
      GivePlayerMoney(playerid,-CarModel[ChoosedCar][Price]);
      C_Data[Model] = CarModel[ChoosedCar][Model];
      C_Data[cX] = SPAWN_cX;
      C_Data[cY] = SPAWN_cY;
      C_Data[cZ] = SPAWN_cZ;
      C_Data[cA] = SPAWN_cA;
      C_Data[Col1] = 1;
      C_Data[Col2] = 1;
      C_Data[Lock] = 0;
      strmid(C_Data[Owner], GetName(playerid), 0, strlen(GetName(playerid)), 999);
                TogglePlayerControllable(playerid, 1);
                C_Data[iD] = CreateVehicle(C_Data[Model], C_Data[cX],C_Data[cY],C_Data[cZ],C_Data[cA], C_Data[Col1], C_Data[Col2], 30000);
                CreateSaveCar(i);
       PlayerSwitchVehicle[playerid] = false;
                PlayerChooseVehicle = false;
                SetCameraBehindPlayer(playerid);
      TextDrawHideForPlayer(playerid,CoSTD0[playerid]);
      if(Player[playerid][Veh1] == 9999 && Player[playerid][Veh2] == 9999 && Player[playerid][Veh3] == 9999) {Player[playerid][Veh1] = C_Data[iD];}
      else if(Player[playerid][Veh2] != 9999 && Player[playerid][Veh1] == 9999 && Player[playerid][Veh3] != 9999){Player[playerid][Veh1] = C_Data[iD];}
             else if(Player[playerid][Veh1] != 9999 && Player[playerid][Veh2] == 9999 && Player[playerid][Veh3] != 9999){Player[playerid][Veh2] = C_Data[iD];}
             else if(Player[playerid][Veh1] != 9999 && Player[playerid][Veh2] == 9999 && Player[playerid][Veh3] == 9999){Player[playerid][Veh2] = C_Data[iD];}
          else if(Player[playerid][Veh3] == 9999 && Player[playerid][Veh1] != 9999 && Player[playerid][Veh2] != 9999){Player[playerid][Veh3] = C_Data[iD];}
          UpdatePlayerInfo(playerid);
          }
          else
          {
          SCM(playerid,-1,\"Már van 3 autód (Ez a maximum)!\");
          }
       }
}
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
    new Keys, ud, lr;
    GetPlayerKeys(playerid, Keys, ud, lr);
   if(ud > 0)
      {
         if(AlarmChoose[playerid] == 1)
         {
          AlarmChoose[playerid] = 2;
          TextDrawSetString(AlarmTD1[playerid],\"~p~~h~Riasztó: ~w~BE~n~~n~~p~~h~Riasztó: ~r~KI\");
          }
         else if(AlarmChoose[playerid] == 2)
         {
          AlarmChoose[playerid] = 1;
          TextDrawSetString(AlarmTD1[playerid],\"~p~~h~Riasztó: ~r~BE~n~~n~~p~~h~Riasztó: ~w~KI\");
          }
       }
if(PlayerSwitchVehicle[playerid] == true)
{
new string[128];
    GetPlayerKeys(playerid, Keys, ud, lr);
   if(lr > 0)
      {
         ChoosedCar++;
         if(ChoosedCar > maximalcars) {ChoosedCar = 0;}
         DestroyVehicle(VehicleID);
         VehicleID = CreateVehicle(CarModel[ChoosedCar][Model], COORDINATES, 1,1, 30000);
         format(string,sizeof(string),\"~y~Név: ~w~%s   ~y~Ár: ~g~$%d~n~~y~Szint: ~w~%d~y~  Maximum sebesség: ~w~%d\",CarNames[CarModel[ChoosedCar][Model] - 400],CarModel[ChoosedCar][Price],CarModel[ChoosedCar][Level],CarModel[ChoosedCar][speed]);
         TextDrawSetString(CoSTD0[playerid],string);
      }
      else if(lr < 0)
      {
         ChoosedCar--;
         if (ChoosedCar < 0) {ChoosedCar = maximalcars;}
         DestroyVehicle(VehicleID);
         VehicleID = CreateVehicle(CarModel[ChoosedCar][Model], COORDINATES, 1,1, 30000);
         format(string,sizeof(string),\"~y~Név: ~w~%s   ~y~Ár: ~g~$%d~n~~y~Szint: ~w~%d~y~  Maximum sebesség: ~w~%d\",CarNames[CarModel[ChoosedCar][Model] - 400],CarModel[ChoosedCar][Price],CarModel[ChoosedCar][Level],CarModel[ChoosedCar][speed]);
         TextDrawSetString(CoSTD0[playerid],string);
      }
}
      return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
   case DIALOG_CARS+1:
   {
   if(!response) return SCM(playerid,-1,\"Dialog bezárva\");
    new vehicleid = GetPlayerVehicleID(playerid);
    switch(listitem)
    {
    case 0: {
            if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid,COLOR_RED,\"Az autóban kell ülnöd!\");
    ShowPlayerDialog(playerid,DIALOG_CARS,DIALOG_STYLE_INPUT,\"Szín\",\"Ára: $200\\nÍrd be a színeket (szín id-t).\\n Példa: 5 9\",\"Vált\",\"Mégse\"); }
    case 1: {
    ShowPlayerDialog(playerid,DIALOG_CARS+5,DIALOG_STYLE_LIST,\"Autókezelõ panel\",\"Elsõ autó\\nMásodik autó\\nHarmadik autó\",\"Zárás\",\"Mégse\");
      }
    case 2: {
    ShowPlayerDialog(playerid,DIALOG_CARS+2,DIALOG_STYLE_LIST,\"Autókezelõ panel\",\"Elsõ autó\\nMásodik autó\\nHarmadik autó\",\"Kinyitás\",\"Mégse\");
             }
    case 3: {
         new string[128];
           if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid,COLOR_RED,\"Autóban kell ülnöd!\");
   new price = GetVehiclePrice(GetVehicleModel(vehicleid));
   if(Player[playerid][Veh3] == 0 && Player[playerid][Veh2] == 0 && Player[playerid][Veh1] == 0) return SCM(playerid,COLOR_RED,\"Nincsen autód!\");
   GivePlayerMoney(playerid, price/2);
   SendFormatMSG(playerid,-1,\"Eladtad az autódat %d$-ért\",price/2);
   DestroyVehicle(vehicleid);
   if(Player[playerid][Veh1] == vehicleid)
   {
   format(string,sizeof(string),CoS_File,C_Data[vehicleid][iD]);
            C_Data[vehicleid][cX] = 0;
            C_Data[vehicleid][cY] = 0;
            C_Data[vehicleid][cZ] = 0;
            C_Data[vehicleid][Model] = 0;
            format(C_Data[vehicleid][Owner],128,\"Department\");
            CheckCar(Player[playerid][Veh1]);
   Player[playerid][Veh1] = 0;
   UpdatePlayerInfo(playerid);
   }
   else if(Player[playerid][Veh2] == vehicleid)
   {
   format(string,sizeof(string),CoS_File,C_Data[vehicleid][iD]);
            C_Data[vehicleid][cX] = 0;
            C_Data[vehicleid][cY] = 0;
            C_Data[vehicleid][cZ] = 0;
            C_Data[vehicleid][Model] = 0;
            format(C_Data[vehicleid][Owner],128,\"Department\");
            CheckCar(Player[playerid][Veh2]);
   Player[playerid][Veh2] = 0;
   UpdatePlayerInfo(playerid);
   }
   else if(Player[playerid][Veh3] == vehicleid)
   {
   format(string,sizeof(string),CoS_File,C_Data[vehicleid][iD]);
            C_Data[vehicleid][cX] = 0;
            C_Data[vehicleid][cY] = 0;
            C_Data[vehicleid][cZ] = 0;
            C_Data[vehicleid][Model] = 0;
            format(C_Data[vehicleid][Owner],128,\"Department\");
            CheckCar(Player[playerid][Veh3]);
   Player[playerid][Veh3] = 0;
   UpdatePlayerInfo(playerid);
   }
   }
    case 4: {
    if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid,COLOR_RED,\"Nem ülsz autóban!\");
            new Float:Pos[4]; GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]); GetVehicleZAngle(vehicleid, Pos[3]);
           C_Data[vehicleid][cX] = Pos[0];
           C_Data[vehicleid][cY] = Pos[1];
              C_Data[vehicleid][cZ] = Pos[2];
           C_Data[vehicleid][cA] = Pos[3];
   SetVehiclePos(vehicleid, C_Data[vehicleid][cX],C_Data[vehicleid][cY],C_Data[vehicleid][cZ]);
   SetVehicleZAngle(vehicleid, C_Data[vehicleid][cA]);
   SCM(playerid,-1,\"Autó leparkolva.\");
   CheckCar(C_Data[vehicleid][iD]);}
    case 5: {
    ShowPlayerDialog(playerid,DIALOG_CARS+3,DIALOG_STYLE_LIST,\"Autókezelõ panel\",\"Elsõ autó\\nMásodik autó\\nHarmadik autó\",\"Kinyit\",\"Mégse\");
             }
    case 6: {
    ShowPlayerDialog(playerid,DIALOG_CARS+4,DIALOG_STYLE_LIST,\"Autókezelõ panel\",\"Elsõ autó\\nMásodik autó\\nHarmadik autó\",\"Választ\",\"Mégse\");
             }
    }
           }
           case DIALOG_CARS+4://For alarm
           {
           if(!response) return 1;
           switch(listitem)
           {
           case 0:
           {
           new id = Player[playerid][Veh1];
           new Float:Pos[3]; GetVehiclePos(id,Pos[0],Pos[1],Pos[2]);
           if(id == 999) return SCM(playerid,-1,\"Nincsen autód ezen a sloton.\");
           if(!IsPlayerInRangeOfPoint(playerid,40.0,Pos[0],Pos[1],Pos[2])) return SCM(playerid,-1,\"Nem vagy az autód közelében.\");
    AlarmChoose[playerid] = 1;
    AlarmChooseID[playerid] = id;
    TextDrawShowForPlayer(playerid,AlarmTD0[playerid]);
    TextDrawShowForPlayer(playerid,AlarmTD1[playerid]);
    TextDrawSetString(AlarmTD1[playerid],\"~p~~h~Riasztó: ~r~BE~n~~n~~p~~h~Riasztó: ~w~KI\");
    }
           case 1:
           {
           new id = Player[playerid][Veh2];
           new Float:Pos[3]; GetVehiclePos(id,Pos[0],Pos[1],Pos[2]);
           if(id == 999) return SCM(playerid,-1,\"Nincsen autód ezen a sloton\");
           if(!IsPlayerInRangeOfPoint(playerid,40.0,Pos[0],Pos[1],Pos[2])) return SCM(playerid,-1,\"Nem vagy az autód közelében.\");
    AlarmChoose[playerid] = 1;
    AlarmChooseID[playerid] = id;
    TextDrawShowForPlayer(playerid,AlarmTD0[playerid]);
    TextDrawShowForPlayer(playerid,AlarmTD1[playerid]);
    TextDrawSetString(AlarmTD1[playerid],\"~p~~h~Riasztó: ~r~BE~n~~n~~p~~h~Riasztó: ~w~KI\");
    }
           case 2:
           {
           new id = Player[playerid][Veh3];
           new Float:Pos[3]; GetVehiclePos(id,Pos[0],Pos[1],Pos[2]);
           if(id == 999) return SCM(playerid,-1,\"Nincsen autód ezen a sloton\");
           if(!IsPlayerInRangeOfPoint(playerid,40.0,Pos[0],Pos[1],Pos[2])) return SCM(playerid,-1,\"Nem vagy az autód közelében.\");
    AlarmChoose[playerid] = 1;
    AlarmChooseID[playerid] = id;
    TextDrawShowForPlayer(playerid,AlarmTD0[playerid]);
    TextDrawShowForPlayer(playerid,AlarmTD1[playerid]);
    TextDrawSetString(AlarmTD1[playerid],\"~p~~h~Riasztó: ~r~BE~n~~n~~p~~h~Riasztó: ~w~KI\");
    }
    }
           }
           
   case DIALOG_CARS+2:
   {
   switch(listitem)
   {
      case 0: {
            if(Player[playerid][Veh1] != 9999) { C_Data[Player[playerid][Veh1]][Lock] = 0; CheckCar(Player[playerid][Veh1]); } }
      case 1: {
            if(Player[playerid][Veh2] != 9999) { C_Data[Player[playerid][Veh2]][Lock] = 0; CheckCar(Player[playerid][Veh2]); } }
      case 2: {
            if(Player[playerid][Veh3] != 9999) { C_Data[Player[playerid][Veh3]][Lock] = 0; CheckCar(Player[playerid][Veh3]); } }
            }
           }
   case DIALOG_CARS+3://Dialog for locate
   {
   switch(listitem)
   {
      case 0: {
            if(Player[playerid][Veh1] != 9999) {new Float:Postition[3]; GPSOn[playerid] = true; GetVehiclePos(Player[playerid][Veh1],Postition[0],Postition[1],Postition[2]); SetPlayerCheckpoint(playerid,Postition[0],Postition[1],Postition[2],5.0); SCM(playerid,-1,\"Vehicle is located for turn of GPS type /gpsoff\");} }
      case 1: {
            if(Player[playerid][Veh2] != 9999) {new Float:Postition[3]; GPSOn[playerid] = true; GetVehiclePos(Player[playerid][Veh2],Postition[0],Postition[1],Postition[2]); SetPlayerCheckpoint(playerid,Postition[0],Postition[1],Postition[2],5.0); SCM(playerid,-1,\"Vehicle is located for turn of GPS type /gpsoff\");} }
      case 2: {
            if(Player[playerid][Veh3] != 9999) {new Float:Postition[3]; GPSOn[playerid] = true; GetVehiclePos(Player[playerid][Veh3],Postition[0],Postition[1],Postition[2]); SetPlayerCheckpoint(playerid,Postition[0],Postition[1],Postition[2],5.0); SCM(playerid,-1,\"Vehicle is located for turn of GPS type /gpsoff\");} }
            }
           }
           case DIALOG_CARS://For color
   {
   new vehicleid = GetPlayerVehicleID(playerid),col[2];
   if(sscanf(inputtext,\"ii\",col[0],col[1])) return ShowPlayerDialog(playerid,DIALOG_CARS,DIALOG_STYLE_INPUT,\"Szín\",\"Írd be a színt (A szín id-jét).\\n Példa: 5 9\",\"Vált\",\"Mégse\");
   C_Data[vehicleid][Col1] = col[0];
   C_Data[vehicleid][Col2] = col[1];
   GivePlayerMoney(playerid,-200);
   ChangeVehicleColor(vehicleid,col[0],col[1]);
   CheckCar(vehicleid);
   }
   case DIALOG_CARS+5://For lock
   {
   switch(listitem)
   {
      case 0: {
            if(Player[playerid][Veh1] != 9999) { C_Data[Player[playerid][Veh1]][Lock] = 1; CheckCar(Player[playerid][Veh1]); } }
      case 1: {
            if(Player[playerid][Veh2] != 9999) { C_Data[Player[playerid][Veh2]][Lock] = 1; CheckCar(Player[playerid][Veh2]); } }
      case 2: {
            if(Player[playerid][Veh3] != 9999) { C_Data[Player[playerid][Veh3]][Lock] = 1; CheckCar(Player[playerid][Veh3]); } }
            }
           }
      }
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
forward LoadPlayerData(playerid, name[], value[]);
public LoadPlayerData(playerid, name[], value[])
{
    INI_Int(\"Veh1\", Player[playerid][Veh1]);
    INI_Int(\"Veh2\", Player[playerid][Veh2]);
    INI_Int(\"Veh3\", Player[playerid][Veh3]);
    return 1;
}
//Commands
YCMD:autovesz(playerid,params[],help)
{
#pragma unused params
#pragma unused help
if(PlayerChooseVehicle) return SCM(playerid,COLOR_RED,\"EROR: \"COL_WHITE\"Valaki már megvette az autót.\");
if(!IsPlayerInRangeOfPoint(playerid,20.0,COORDINATES_FOR_BUY)) return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"Nem vagy azon a helyen ahol megveheted az autót.\");
PlayerChooseVehicle = true;
PlayerSwitchVehicle[playerid] = true;
ChoosedCar = 0;
SCM(playerid,-1,\"Use arrow left and right for choose car\");
SCM(playerid,-1,\"When you choose you car press \'ENTER\'\");
SCM(playerid,-1,\"If you want to exit type /stopbuying\");
TogglePlayerControllable(playerid,false);
DestroyVehicle(VehicleID);
VehicleID = AddStaticVehicleEx(CarModel[ChoosedCar][Model],COORDINATES,1,1,3600);
TextDrawShowForPlayer(playerid,CoSTD0[playerid]);
return 1;
}
YCMD:autovetelvege(playerid,params[],help)
{
#pragma unused params
#pragma unused help
if(!PlayerSwitchVehicle[playerid]) return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"Nem veheted meg az autót.\");
PlayerChooseVehicle = false;
PlayerSwitchVehicle[playerid] = false;
TogglePlayerControllable(playerid,true);
ChoosedCar = 0;
SCM(playerid,-1,\"Befejezted az autó választást.\");
TextDrawHideForPlayer(playerid,CoSTD0[playerid]);
return 1;
}
YCMD:v(playerid, params[], help)
{
        #pragma unused help
        #pragma unused params
new vehicleid = GetPlayerVehicleID(playerid);
        if(Player[playerid][Veh3] == 9999 && Player[playerid][Veh2] == 9999 && Player[playerid][Veh1] == 9999) return SCM(playerid,COLOR_RED,\"Nincsen autód!\");
if(strcmp(C_Data[vehicleid][Owner],GetName(playerid), false ) == 0)
        {
        ShowPlayerDialog(playerid,DIALOG_CARS+1,DIALOG_STYLE_LIST,\"Autókezelõ panel\",\"Szín\\nAutó zárás\\nAutó nyitás\\nEladás\\nParkolás\\nKeresés\\nRiasztó\",\"Csináld\",\"Mégse\");
}
return 1;
}
YCMD:gpski(playerid, params[], help)
{
        #pragma unused help
        #pragma unused params
if(!GPSOn[playerid]) return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"A gps-ed ki van kapcsolva.\");
        DisablePlayerCheckpoint(playerid);
        GPSOn[playerid] = false;
return 1;
}
YCMD:cnerak(playerid, params[], help)
{
        #pragma unused help
        #pragma unused params
        new string[128],money;
        if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid,COLOR_RED,\"Autóban kell lenned!\");
        new id = GetPlayerVehicleID(playerid);
          if(Player[playerid][Veh3] == 9999 && Player[playerid][Veh2] == 9999 && Player[playerid][Veh1] == 9999) return SCM(playerid,COLOR_RED,\"Nincsen autód!\");
        if(Player[playerid][Veh3] == id || Player[playerid][Veh2] == id || Player[playerid][Veh1] == id)
        {
new Float:Pos[3]; GetVehiclePos(C_Data[id][iD],Pos[0],Pos[1],Pos[2]);
if(!IsPlayerInRangeOfPoint(playerid,10.0,Pos[0],Pos[1],Pos[2])) return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"Nem vagy az autód közelében.\");
if(sscanf(params, \"i\",money)) return SCM(playerid, COLOR_RED, \"Használat: /cberak [Összeg]\");
if(money > GetPlayerMoney(playerid)) return SCM(playerid, COLOR_RED, \"Nincsen ennyi pénzed\");
if(money < 1) return SCM(playerid, COLOR_RED, \"Az összegnek nagyobbnak kell lennie mint 1\");
        C_Data[id][Money] += money;
        GivePlayerMoney(playerid, -money);
format(string,sizeof(string),\"{E0BC1B}Beraktál %d$-t.Most van az autódban %d$\",money,C_Data[id][Money]);
        SCM(playerid,-1,string);
        CheckCar(id);
        }
return 1;
}
YCMD:ckivesz(playerid, params[], help)
{
        #pragma unused help
        #pragma unused params
        new string[128],money;
        if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid,COLOR_RED,\"Autóban kell lenned!\");
        new id = GetPlayerVehicleID(playerid);
          if(Player[playerid][Veh3] == 9999 && Player[playerid][Veh2] == 9999 && Player[playerid][Veh1] == 9999) return SCM(playerid,COLOR_RED,\"Nincsen autód!\");
        if(Player[playerid][Veh3] == id || Player[playerid][Veh2] == id || Player[playerid][Veh1] == id)
        {
new Float:Pos[3]; GetVehiclePos(C_Data[id][iD],Pos[0],Pos[1],Pos[2]);
if(sscanf(params, \"i\",money)) return SCM(playerid, COLOR_RED, \"Usage: /ckivesz [Összeg]\");
if(money > C_Data[id][Money]) return SCM(playerid, COLOR_RED, \"Nincsen ennyi pénz az autóban.\");
if(money < 1) return SCM(playerid, COLOR_RED, \"Az összegnek többnek kell lennie mint 1\");
        C_Data[id][Money] -= money;
        GivePlayerMoney(playerid, money);
format(string,sizeof(string),\"{E0BC1B}Kivettél %d$-t.Most van az autódban %d$\",money,C_Data[id][Money]);
        SCM(playerid,-1,string);
        CheckCar(id);
        }
return 1;
}
YCMD:cberakfegyver(playerid, params[], help)
{
        #pragma unused help
        new string[128];
         if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid,COLOR_RED,\"Az autódban kell lenned!\");
        new id = GetPlayerVehicleID(playerid);
          if(Player[playerid][Veh3] == 9999 && Player[playerid][Veh2] == 9999 && Player[playerid][Veh1] == 9999) return SCM(playerid,COLOR_RED,\"Nincsen autód!\");
        if(Player[playerid][Veh3] == id || Player[playerid][Veh2] == id || Player[playerid][Veh1] == id)
        {
new Float:Pos[3]; GetVehiclePos(id,Pos[0],Pos[1],Pos[2]);
        new slot,ammo;
if(sscanf(params, \"ii\",slot,ammo)) return SCM(playerid, COLOR_RED, \"Használat: /cberakfegyver [Hely: 1/2] [Töltény]\");
if(ammo > GetPlayerAmmo(playerid)) return SCM(playerid, COLOR_RED, \"Nincsen ennyi töltényed.\");
if(ammo < 1) return SCM(playerid, COLOR_RED, \"A tölténynek többnek kell lennie mint 1\");
if(slot == 1)
{
if(C_Data[id][Gun1] != 0) return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"Már van ezen a helyen fegyver.\");
        C_Data[id][Gun1] = GetPlayerWeapon(playerid);
        C_Data[id][Ammo1] = ammo;
        SetPlayerAmmo(playerid,GetPlayerWeapon(playerid),GetPlayerAmmo(playerid)-ammo);
format(string,sizeof(string),\"{E0BC1B}Fegyvert raktál be az 1-es slotra.%d tölténnyel.\",ammo);
        SCM(playerid,-1,string);
        CheckCar(id);
        }
if(slot == 2)
{
if(C_Data[id][Gun2] != 0) return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"Már van ezen a helyen fegyver.\");
        C_Data[id][Gun2] = GetPlayerWeapon(playerid);
        C_Data[id][Ammo2] = ammo;
        SetPlayerAmmo(playerid,GetPlayerWeapon(playerid),GetPlayerAmmo(playerid)-ammo);
format(string,sizeof(string),\"{E0BC1B}Fegyvert raktál be az 2-es slotra.%d tölténnyel.\",ammo);
        SCM(playerid,-1,string);
        CheckCar(id);
        }
        }
return 1;
}
YCMD:ckiveszfegyver(playerid, params[], help)
{
#pragma unused help
        new string[128];
         if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid,COLOR_RED,\"Nem vagy az autódban!\");
        new id = GetPlayerVehicleID(playerid);
          if(Player[playerid][Veh3] == 9999 && Player[playerid][Veh2] == 9999 && Player[playerid][Veh1] == 9999) return SCM(playerid,COLOR_RED,\"Nincsen autód!\");
        if(Player[playerid][Veh3] == id || Player[playerid][Veh2] == id || Player[playerid][Veh1] == id)
        {
new Float:Pos[3]; GetVehiclePos(id,Pos[0],Pos[1],Pos[2]);
        new slot,ammo;
if(sscanf(params, \"ii\",slot,ammo)) return SCM(playerid, COLOR_RED, \"Használat: /ckiveszfegyver [Hely: 1/2] [Töltény]\");
if(ammo < 1) return SCM(playerid, COLOR_RED, \"Ammo can\'t be less then 1\");
if(slot == 1)
{
if(C_Data[id][Gun1] != 0) return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"Nincsen fegyver ezen a helyen.\");
if(ammo > C_Data[id][Ammo1]) return SCM(playerid, COLOR_RED, \"Hiba:\"COL_WHITE\" Az autóban nincsen ennyi töltény.\");
GivePlayerWeapon(playerid,C_Data[id][Gun1],ammo);
C_Data[id][Ammo1] -= ammo;
if(C_Data[id][Ammo1] == 0) {C_Data[id][Gun1] = 0;}
format(string,sizeof(string),\"{E0BC1B}Kivettél fegyvert az 1-es helyrõl.%d tölténnyel\",ammo);
        SCM(playerid,-1,string);
        CheckCar(id);
        }
if(slot == 2)
{
if(C_Data[id][Gun2] != 0) return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"Nincsen fegyver ezen a helyen.\");
if(ammo > C_Data[id][Ammo2]) return SCM(playerid, COLOR_RED, \"Hiba:\"COL_WHITE\"Az autóban nincsen ennyi töltény.\");
GivePlayerWeapon(playerid,C_Data[id][Gun2],ammo);
C_Data[id][Ammo2] -= ammo;
if(C_Data[id][Ammo2] == 0) {C_Data[id][Gun2] = 0;}
format(string,sizeof(string),\"{E0BC2B}Kivettél fegyvert a 2-es helyrõl.%d tölténnyel\",ammo);
        SCM(playerid,-2,string);
        CheckCar(id);
        }
        }
return 1;
}
YCMD:eladauto(playerid, params[], help)
{
        #pragma unused help
        if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"Nem vagy az autódban\");
new pplayerid,price;
if(sscanf(params,\"ui\",pplayerid,price)) return SCM(playerid,COLOR_RED,\"Használat: \"COL_WHITE\"/eladauto [iD/Név(részlet)] [Összeg]\");
if(GetPlayerMoney(pplayerid) < price) return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"Ennek a játékosnak nincsen ennyi pénze.\");
        if(price < 1) return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"Legalább 1$-ért add el.\");
new Float:Pos[3]; GetPlayerPos(pplayerid,Pos[0],Pos[1],Pos[2]);
if(!IsPlayerInRangeOfPoint(playerid,10.0,Pos[0],Pos[1],Pos[2])) return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"Nincsen a közeledben ez a játékos\");
          if(Player[playerid][Veh3] == 9999 && Player[playerid][Veh2] == 9999 && Player[playerid][Veh1] == 9999) return SCM(playerid,COLOR_RED,\"Nincsen autód!\");
          if(Player[pplayerid][Veh3] != 9999 && Player[pplayerid][Veh2] != 9999 && Player[pplayerid][Veh1] != 9999) return SCM(playerid,COLOR_RED,\"A játékosnak már megvan a három autója!\");
        Seller[pplayerid] = playerid;
        Priceo[pplayerid] = price;
SendFormatMSG(pplayerid,-1,\" %s játékos eladná neked az autóját %d$-ért. Ha meg akarod venni írd be: /megveszem\",Priceo[playerid]);
SCM(playerid,-1,\"Várj a válaszra.\");
return 1;
}
YCMD:nemveszemmeg(playerid, params[], help)
{
        #pragma unused help
        #pragma unused params
        if(Seller[playerid] == 999)  return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"Nem ajánlották fel, hogy eladnak neked egy autót.\");
SCM(playerid,-1,\"Visszautasítottad az ajánlatot.\");
SCM(Seller[playerid],-1,\"A játékos visszautasította az ajánlatot.\");
Priceo[playerid] = 0;
Seller[playerid] = 999;
return 1;
}
YCMD:megveszem(playerid, params[], help)
{
        #pragma unused help
        #pragma unused params
        new id = GetPlayerVehicleID(playerid);
        if(Seller[playerid] == 999)  return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"Nem ajánlották fel, hogy eladnak neked egy autót.\");
        if(!IsPlayerInAnyVehicle(Seller[playerid]))  return SCM(playerid,COLOR_RED,\"Hiba: \"COL_WHITE\"A játékos nincsen az autóban.\");
        if(Player[seller[playerid]][Veh3] == id)
        {
if(Player[playerid][Veh1] == 9999 && Player[playerid][Veh2] == 9999 && Player[playerid][Veh3] == 9999) {Player[playerid][Veh1] = Player[seller[playerid]][Veh3];}
else if(Player[playerid][Veh2] != 9999 && Player[playerid][Veh1] == 9999 && Player[playerid][Veh3] != 9999){Player[playerid][Veh1] = Player[seller[playerid]][Veh3];}
else if(Player[playerid][Veh1] != 9999 && Player[playerid][Veh2] == 9999 && Player[playerid][Veh3] != 9999){Player[playerid][Veh2] = Player[seller[playerid]][Veh3];}
else if(Player[playerid][Veh1] != 9999 && Player[playerid][Veh2] == 9999 && Player[playerid][Veh3] == 9999){Player[playerid][Veh2] = Player[seller[playerid]][Veh3];}
else if(Player[playerid][Veh3] == 9999 && Player[playerid][Veh1] != 9999 && Player[playerid][Veh2] != 9999){Player[playerid][Veh3] = Player[seller[playerid]][Veh3];}
strmid(C_Data[id][Owner], GetName(playerid), 0, strlen(GetName(playerid)), 999);
GivePlayerMoney(Seller[playerid],Priceo[playerid]);
GivePlayerMoney(playerid,-Priceo[playerid]);
SendFormatMSG(playerid,-1,\"Megvetted az autót %d$-ért\",Priceo[playerid]);
SendFormatMSG(Seller[playerid],-1,\"Eladtad az autót %d$-ért\",Priceo[playerid]);
CheckCar(id);
RemovePlayerFromVehicle(Seller[playerid]);
Priceo[playerid] = 0;
Seller[playerid] = 999;
}
        if(Player[seller[playerid]][Veh2] == id)
        {
if(Player[playerid][Veh1] == 9999 && Player[playerid][Veh2] == 9999 && Player[playerid][Veh3] == 9999) {Player[playerid][Veh1] = Player[seller[playerid]][Veh2];}
else if(Player[playerid][Veh2] != 9999 && Player[playerid][Veh1] == 9999 && Player[playerid][Veh3] != 9999){Player[playerid][Veh1] = Player[seller[playerid]][Veh2];}
else if(Player[playerid][Veh1] != 9999 && Player[playerid][Veh2] == 9999 && Player[playerid][Veh3] != 9999){Player[playerid][Veh2] = Player[seller[playerid]][Veh2];}
else if(Player[playerid][Veh1] != 9999 && Player[playerid][Veh2] == 9999 && Player[playerid][Veh3] == 9999){Player[playerid][Veh2] = Player[seller[playerid]][Veh2];}
else if(Player[playerid][Veh3] == 9999 && Player[playerid][Veh1] != 9999 && Player[playerid][Veh2] != 9999){Player[playerid][Veh3] = Player[seller[playerid]][Veh2];}
strmid(C_Data[id][Owner], GetName(playerid), 0, strlen(GetName(playerid)), 999);
GivePlayerMoney(Seller[playerid],Priceo[playerid]);
GivePlayerMoney(playerid,-Priceo[playerid]);
SendFormatMSG(playerid,-1,\"Megvetted az autót %d$-ért\",Priceo[playerid]);
SendFormatMSG(playerid,-1,\"Eladtad az autót %d$-ért\",Priceo[playerid]);
CheckCar(id);
RemovePlayerFromVehicle(Seller[playerid]);
Priceo[playerid] = 0;
Seller[playerid] = 999;
}
        if(Player[seller[playerid]][Veh1] == id)
        {
if(Player[playerid][Veh1] == 9999 && Player[playerid][Veh2] == 9999 && Player[playerid][Veh3] == 9999) {Player[playerid][Veh1] = Player[seller[playerid]][Veh1];}
else if(Player[playerid][Veh2] != 9999 && Player[playerid][Veh1] == 9999 && Player[playerid][Veh3] != 9999){Player[playerid][Veh1] = Player[seller[playerid]][Veh1];}
else if(Player[playerid][Veh1] != 9999 && Player[playerid][Veh2] == 9999 && Player[playerid][Veh3] != 9999){Player[playerid][Veh2] = Player[seller[playerid]][Veh1];}
else if(Player[playerid][Veh1] != 9999 && Player[playerid][Veh2] == 9999 && Player[playerid][Veh3] == 9999){Player[playerid][Veh2] = Player[seller[playerid]][Veh1];}
else if(Player[playerid][Veh3] == 9999 && Player[playerid][Veh1] != 9999 && Player[playerid][Veh2] != 9999){Player[playerid][Veh3] = Player[seller[playerid]][Veh1];}
strmid(C_Data[id][Owner], GetName(playerid), 0, strlen(GetName(playerid)), 999);
GivePlayerMoney(Seller[playerid],Priceo[playerid]);
GivePlayerMoney(playerid,-Priceo[playerid]);
SendFormatMSG(playerid,-1,\"Megvetted az autót %d$-ért\",Priceo[playerid]);
SendFormatMSG(playerid,-1,\"Eladtad az autót %d$-ért\",Priceo[playerid]);
CheckCar(id);
RemovePlayerFromVehicle(Seller[playerid]);
Priceo[playerid] = 0;
Seller[playerid] = 999;
}
return 1;
}
//Stock
stock AddMoreCar(model,price,speed,level)
{
CarModel[maximalcars][Model] = model;
CarModel[maximalcars][Price] = price;
CarModel[maximalcars][speed] = speed;
CarModel[maximalcars][Level] = level;
maximalcars++;
}
stock CreateSaveCar(id)
{
new dFile[32];
format(dFile, 35, CoS_File, id);
  new
   INI:File = INI_Open(dFile);
          INI_WriteFloat(File, \"X\", C_Data[id][cX]);
          INI_WriteFloat(File, \"Y\", C_Data[id][cY]);
          INI_WriteFloat(File, \"Z\", C_Data[id][cZ]);
          INI_WriteFloat(File, \"A\", C_Data[id][cA]);
          INI_WriteInt(File, \"Model\", C_Data[id][Model]);
          INI_WriteInt(File, \"Lock\", C_Data[id][Lock]);
          INI_WriteString(File, \"Owner\", C_Data[id][Owner]);
          INI_WriteInt(File, \"Col1\", C_Data[id][Col1]);
          INI_WriteInt(File, \"Col2\", C_Data[id][Col2]);
          INI_WriteInt(File, \"Money\", C_Data[id][Col2]);
          INI_WriteInt(File, \"Gun1\", C_Data[id][Gun1]);
          INI_WriteInt(File, \"Ammo1\", C_Data[id][Ammo1]);
          INI_WriteInt(File, \"Gun2\", C_Data[id][Gun2]);
          INI_WriteInt(File, \"Ammo2\", C_Data[id][Ammo2]);
          INI_WriteInt(File, \"Alarm\", C_Data[id][Alarm]);
          INI_Close(File);
}
stock CheckCar(id)
{
new dFile[32];
format(dFile, 35, CoS_File, id);
  new
   INI:File = INI_Open(dFile);
          INI_WriteFloat(File, \"X\", C_Data[id][cX]);
          INI_WriteFloat(File, \"Y\", C_Data[id][cY]);
          INI_WriteFloat(File, \"Z\", C_Data[id][cZ]);
          INI_WriteFloat(File, \"A\", C_Data[id][cA]);
          INI_WriteInt(File, \"Model\", C_Data[id][Model]);
          INI_WriteInt(File, \"Lock\", C_Data[id][Lock]);
          INI_WriteString(File, \"Owner\", C_Data[id][Owner]);
          INI_WriteInt(File, \"Col1\", C_Data[id][Col1]);
          INI_WriteInt(File, \"Col2\", C_Data[id][Col2]);
          INI_WriteInt(File, \"Money\", C_Data[id][Col2]);
          INI_WriteInt(File, \"Gun1\", C_Data[id][Gun1]);
          INI_WriteInt(File, \"Ammo1\", C_Data[id][Ammo1]);
          INI_WriteInt(File, \"Gun2\", C_Data[id][Gun2]);
          INI_WriteInt(File, \"Ammo2\", C_Data[id][Ammo2]);
          INI_WriteInt(File, \"Alarm\", C_Data[id][Alarm]);
          INI_Close(File);
}
stock GetNextFreeID()
{
new string[32];
for(new i = NUMBER_FOR_LOAD; i <= MAX_CARS;i++)
{
format(string,32,CoS_File,i);
if(!fexist(string)) return i;
}
return 1;
}
stock GetVehiclePrice(model)
{
for(new id = 0; id <= maximalcars;id++)
{
if(CarModel[id][Model] == model) return CarModel[id][Price];
}
return 1;
}
stock UpdatePlayerInfo(playerid)
{
new
        pFile[35];
   format(pFile, 35, Player_File, GetName(playerid));
    new
    INI:UserFile = INI_Open(pFile);
    INI_WriteInt(UserFile, \"Veh1\", Player[playerid][Veh1]);
    INI_WriteInt(UserFile, \"Veh2\", Player[playerid][Veh2]);
    INI_WriteInt(UserFile, \"Veh3\", Player[playerid][Veh3]);
    INI_Close(UserFile);
}
stock ProxDetector(playerid, const msg [], color, maxdistance = 50)
{
    new
        Float: x1,
        Float: y1,
        Float: z1,
        distance,
        string [128];
    if (GetPlayerName (playerid, string, sizeof string))
    {
        format (string, sizeof string, \"%s\", msg);
        GetPlayerPos (playerid, x1, y1, z1);
        for (new i = 0; i < MAX_PLAYERS; ++i)
        {
            if (IsPlayerConnected (i) && !IsPlayerNPC (i))
            {
                if (i == playerid)
                    SCM (i, color, string);
                else
                {
                    distance = floatround (GetPlayerDistanceFromPoint (i, x1, y1, z1));
                    if (distance <= maxdistance)
                        SCM (i, ColorFade (color, distance, maxdistance), string);
                }
            }
        }
        return 1;
    }
    return 0;
}
stock ColorFade (color, value, maxvalue)
{
    if (0 <= value <= maxvalue)
    {
        new
            Float: ratio = float (value) / float (maxvalue);
        new
            r = max (0, min (255, floatround (float ((color >> 24) & 0xFF) * ratio))),
            g = max (0, min (255, floatround (float ((color >> 16) & 0xFF) * ratio))),
            b = max (0, min (255, floatround (float ((color >> 8) & 0xFF) * ratio)));
        return (r << 24) | (g << 16) | (b << 8) | (value & 0xFF);
    }
    return 0;
}
//public function
forward LoadCar(id, name[], value[]);
public LoadCar(id, name[], value[])
{
    INI_Float(\"X\", C_Data[id][cX]);
    INI_Float(\"Y\", C_Data[id][cY]);
    INI_Float(\"Z\", C_Data[id][cZ]);
    INI_Float(\"A\", C_Data[id][cA]);
    INI_Int(\"Model\", C_Data[id][Model]);
    INI_Int(\"Lock\", C_Data[id][Lock]);
    INI_String(\"Owner\", C_Data[id][Owner],32);
    INI_Int(\"Col1\", C_Data[id][Col1]);
    INI_Int(\"Col2\", C_Data[id][Col2]);
    INI_Int(\"Money\", C_Data[id][Money]);
INI_Int(\"Gun1\", C_Data[id][Gun1]);
INI_Int(\"Ammo1\", C_Data[id][Ammo1]);
INI_Int(\"Gun2\", C_Data[id][Gun2]);
INI_Int(\"Ammo2\", C_Data[id][Ammo2]);
INI_Int(\"Alarm\", C_Data[id][Alarm]);
    return 1;
}
« Utoljára szerkesztve: 2012. május 06. - 02:25:46 írta ChuckNorris »

Car Ownership by Mr.Gagi
« Válasz #1 Dátum: 2012. május 06. - 11:40:02 »
0 Show voters
Nem rossz!
Felhasználom.... csak átalakítom :D

Nem elérhető JBauer

  • 1407
    • Profil megtekintése
Car Ownership by Mr.Gagi
« Válasz #2 Dátum: 2012. augusztus 20. - 13:45:17 »
0 Show voters
Sajnos nekem sincs már meg, de az eredeti linken letölthetõ a scriptfiles mappa is.

Car Ownership by Mr.Gagi
« Válasz #3 Dátum: 2012. augusztus 21. - 13:37:23 »
0 Show voters
Jóhogy áthoztad , nekem is szükségem van rá :D

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal