Szerző Téma: Autóker  (Megtekintve 1035 alkalommal)

Autóker
« Dátum: 2013. július 12. - 00:11:04 »
0 Show voters
A segítségeteknek hála csináltam egy autókereskedést de valamiért nem mûködik teljesen hibátlanul.
Ha beszállok újra a megvett kocsiba ismét kijön a dialog hogy megvehetem a kocsit és le is vonja megint az összeget, aztán nem írja át az iniben  amit kell, plusz azt szeretném megoldani valahogyan, hogy ami kocsit megveszek azt létrehozza újra ugyan oda. Mutatom hogyan néz ki nálam sorban a kód:
 

new eladokocsi[24];
public OnGameModeInit()
{
//Autó kereskedés autói//
eladokocsi[0] = AddStaticVehicleEx(603,2472.8000488,1357.9000244,10.8000002,180.0000000,-1,-1,0); //Phoenix
eladokocsi[1] = AddStaticVehicleEx(602,2468.6000977,1357.9000244,10.6999998,180.0000000,-1,-1,0); //Alpha
eladokocsi[2] = AddStaticVehicleEx(587,2451.8999023,1337.0999756,10.6000004,180.0000000,-1,-1,0); //Euros
eladokocsi[3] = AddStaticVehicleEx(565,2464.6999512,1358.0000000,10.5000000,180.0000000,-1,-1,0); //Flash
eladokocsi[4] = AddStaticVehicleEx(562,2460.8999023,1358.4000244,10.6000004,180.0000000,-1,-1,0); //Elegy
eladokocsi[5] = AddStaticVehicleEx(560,2457.3000488,1358.5000000,10.6000004,180.0000000,-1,-1,0); //Sultan
eladokocsi[6] = AddStaticVehicleEx(559,2453.5000000,1358.5999756,10.6000004,180.0000000,-1,-1,0); //Jester
eladokocsi[7] = AddStaticVehicleEx(558,2449.6000977,1358.4000244,10.5000000,180.0000000,-1,-1,0); //Uranus
eladokocsi[8] = AddStaticVehicleEx(555,2467.3999023,1345.1999512,10.6000004,0.0000000,-1,-1,0); //Windsor
eladokocsi[9] = AddStaticVehicleEx(541,2463.3999023,1345.1999512,10.5000000,0.0000000,-1,-1,0); //Bullet
eladokocsi[10] = AddStaticVehicleEx(506,2459.3999023,1345.4000244,10.6000004,0.0000000,-1,-1,0); //Super GT
eladokocsi[11] = AddStaticVehicleEx(480,2454.8000488,1345.5000000,10.6999998,0.0000000,-1,-1,0); //Comet
eladokocsi[12] = AddStaticVehicleEx(477,2450.3999023,1345.5999756,10.6999998,0.0000000,-1,-1,0); //ZR-350
eladokocsi[13] = AddStaticVehicleEx(451,2441.3000488,1354.8000488,10.6000004,270.0000000,-1,-1,0); //Turismo
eladokocsi[14] = AddStaticVehicleEx(429,2441.1000977,1350.4000244,10.6000004,270.0000000,-1,-1,0); //Banshee
eladokocsi[15] = AddStaticVehicleEx(415,2441.0000000,1346.3000488,10.6999998,270.0000000,-1,-1,0); //Cheetah
eladokocsi[16] = AddStaticVehicleEx(411,2441.0000000,1342.0999756,10.6000004,270.0000000,-1,-1,0); //Infernus
eladokocsi[17] = AddStaticVehicleEx(402,2441.1000977,1359.0999756,10.8000002,270.0000000,-1,-1,0); //Buffalo
eladokocsi[18] = AddStaticVehicleEx(549,2464.8999023,1336.8000488,10.6999998,180.0000000,-1,-1,0); //Tampa
eladokocsi[19] = AddStaticVehicleEx(545,2461.1000977,1336.5999756,10.8000002,180.0000000,-1,-1,0); //Hustler
eladokocsi[20] = AddStaticVehicleEx(533,2456.8000488,1336.8000488,10.6000004,178.0000000,-1,-1,0); //Feltzer
eladokocsi[21] = AddStaticVehicleEx(431,2445.0000000,1327.0999756,11.1000004,270.0000000,-1,-1,0); //Bus
eladokocsi[22] = AddStaticVehicleEx(571,2440.5000000,1338.3000488,10.1999998,270.0000000,-1,-1,0); //Kart
eladokocsi[23] = AddStaticVehicleEx(478,2441.3999023,1334.6999512,10.8000002,270.0000000,-1,-1,0); //Walton
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
for(new i;i<sizeof(eladokocsi);i++)
{
if(vehicleid == eladokocsi){ ShowPlayerDialog(playerid, DIALOG_ELADOKOCSI, DIALOG_STYLE_MSGBOX, \"{7800FF}Vásárlás\",\"{00FFFF}Ez az autó 500.000$-ba kerül. Szeretnéd megvenni?\", \"Igen\", \"Nem\");
break;
}
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_ELADOKOCSI)
{
if(!response)return RemovePlayerFromVehicle(playerid);
{
   new file[100];
   if(GetPlayerMoney(playerid) < 500000) return SendClientMessage(playerid,PIROS,\"Nem tudod megvenni, mert nincs elég pénzed!\");
   GivePlayerMoney(playerid, -500000);
   SendClientMessage(playerid,ZOLD,\"Megvetted a jármûvet használati útmutató a /help-ben\");
   GetPlayerName(playerid,nev,sizeof(nev));
            format(file,sizeof(file),\"/Motor tulajdonosok/%s.ini\",nev);
            if(!dini_Exists(file))
              {
                dini_Create(file);
                dini_IntSet(file, \"Motor\", 1);
              }
}
return 1;
}
return 1;
}

 
Nos megint Valaki ügyes segítségét szeretném kérni ebben a problémámban. Elõre is köszönöm!

Nem elérhető BoOy

  • 3209
  • 2013-as év szkriptere
    • Profil megtekintése
Autóker
« Válasz #1 Dátum: 2013. július 12. - 01:07:13 »
0 Show voters
A hibádat javítottam!
 
#define MAX_ELADO_KOCSI 24
new eladokocsi[MAX_ELADO_KOCSI];
new JelenlegElado[MAX_ELADO_KOCSI] = 1;
new KocsiID[MAX_PLAYERS];
public OnGameModeInit()
{
eladokocsi[0] = AddStaticVehicleEx(603,2472.8000488,1357.9000244,10.8000002,180.0000000,-1,-1,0); //Phoenix
eladokocsi[1] = AddStaticVehicleEx(602,2468.6000977,1357.9000244,10.6999998,180.0000000,-1,-1,0); //Alpha
eladokocsi[2] = AddStaticVehicleEx(587,2451.8999023,1337.0999756,10.6000004,180.0000000,-1,-1,0); //Euros
eladokocsi[3] = AddStaticVehicleEx(565,2464.6999512,1358.0000000,10.5000000,180.0000000,-1,-1,0); //Flash
eladokocsi[4] = AddStaticVehicleEx(562,2460.8999023,1358.4000244,10.6000004,180.0000000,-1,-1,0); //Elegy
eladokocsi[5] = AddStaticVehicleEx(560,2457.3000488,1358.5000000,10.6000004,180.0000000,-1,-1,0); //Sultan
eladokocsi[6] = AddStaticVehicleEx(559,2453.5000000,1358.5999756,10.6000004,180.0000000,-1,-1,0); //Jester
eladokocsi[7] = AddStaticVehicleEx(558,2449.6000977,1358.4000244,10.5000000,180.0000000,-1,-1,0); //Uranus
eladokocsi[8] = AddStaticVehicleEx(555,2467.3999023,1345.1999512,10.6000004,0.0000000,-1,-1,0); //Windsor
eladokocsi[9] = AddStaticVehicleEx(541,2463.3999023,1345.1999512,10.5000000,0.0000000,-1,-1,0); //Bullet
eladokocsi[10] = AddStaticVehicleEx(506,2459.3999023,1345.4000244,10.6000004,0.0000000,-1,-1,0); //Super GT
eladokocsi[11] = AddStaticVehicleEx(480,2454.8000488,1345.5000000,10.6999998,0.0000000,-1,-1,0); //Comet
eladokocsi[12] = AddStaticVehicleEx(477,2450.3999023,1345.5999756,10.6999998,0.0000000,-1,-1,0); //ZR-350
eladokocsi[13] = AddStaticVehicleEx(451,2441.3000488,1354.8000488,10.6000004,270.0000000,-1,-1,0); //Turismo
eladokocsi[14] = AddStaticVehicleEx(429,2441.1000977,1350.4000244,10.6000004,270.0000000,-1,-1,0); //Banshee
eladokocsi[15] = AddStaticVehicleEx(415,2441.0000000,1346.3000488,10.6999998,270.0000000,-1,-1,0); //Cheetah
eladokocsi[16] = AddStaticVehicleEx(411,2441.0000000,1342.0999756,10.6000004,270.0000000,-1,-1,0); //Infernus
eladokocsi[17] = AddStaticVehicleEx(402,2441.1000977,1359.0999756,10.8000002,270.0000000,-1,-1,0); //Buffalo
eladokocsi[18] = AddStaticVehicleEx(549,2464.8999023,1336.8000488,10.6999998,180.0000000,-1,-1,0); //Tampa
eladokocsi[19] = AddStaticVehicleEx(545,2461.1000977,1336.5999756,10.8000002,180.0000000,-1,-1,0); //Hustler
eladokocsi[20] = AddStaticVehicleEx(533,2456.8000488,1336.8000488,10.6000004,178.0000000,-1,-1,0); //Feltzer
eladokocsi[21] = AddStaticVehicleEx(431,2445.0000000,1327.0999756,11.1000004,270.0000000,-1,-1,0); //Bus
eladokocsi[22] = AddStaticVehicleEx(571,2440.5000000,1338.3000488,10.1999998,270.0000000,-1,-1,0); //Kart
eladokocsi[23] = AddStaticVehicleEx(478,2441.3999023,1334.6999512,10.8000002,270.0000000,-1,-1,0); //Walton
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
for(new i;i<MAX_ELADO_KOCSI;i++)
{
    if(vehicleid == eladokocsi)
{
   if(JelenlegElado == 1)
          {
       vehicleid = KocsiID[playerid];
      ShowPlayerDialog(playerid, DIALOG_ELADOKOCSI, DIALOG_STYLE_MSGBOX, \"{7800FF}Vásárlás\",\"{00FFFF}Ez az autó 500.000$-ba kerül. Szeretnéd megvenni?\", \"Igen\", \"Nem\");
   }
   else
   {
       SendClientMessage(playerid,-1,\"Ezt a kocsit már nem lehet megvenni!\");
   }
}
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_ELADOKOCSI)
{
if(!response)return RemovePlayerFromVehicle(playerid);
{
   new file[100];
   if(GetPlayerMoney(playerid) < 500000) return SendClientMessage(playerid,PIROS,\"Nem tudod megvenni, mert nincs elég pénzed!\");
   else
   {
      GivePlayerMoney(playerid, -500000);
      SendClientMessage(playerid,ZOLD,\"Megvetted a jármûvet használati útmutató a /help-ben\");
      new name[MAX_PLAYER_NAME+1];
             GetPlayerName(playerid, name, sizeof(name));
      JelenlegElado[KocsiID[playerid]] = 0;
      format(file,sizeof(file),\"/Motor tulajdonosok/%s.ini\",name);
      SetTimerEx(\"ReCreateVeh\",10000,0,\"i\",playerid);
      if(!dini_Exists(file))
      {
         dini_Create(file);
         dini_IntSet(file, \"Motor\", 1);
      }
   }
}
return 1;
}
return 1;
}
forward ReCreateVeh(playerid);
public ReCreateVeh(playerid)
{
if(KocsiID[playerid] == eladokocsi[0])AddStaticVehicleEx(603,2472.8000488,1357.9000244,10.8000002,180.0000000,-1,-1,0); //Phoenix
    if(KocsiID[playerid] == eladokocsi[1])AddStaticVehicleEx(602,2468.6000977,1357.9000244,10.6999998,180.0000000,-1,-1,0); //Alpha
    if(KocsiID[playerid] == eladokocsi[2])AddStaticVehicleEx(587,2451.8999023,1337.0999756,10.6000004,180.0000000,-1,-1,0); //Euros
    if(KocsiID[playerid] == eladokocsi[3])AddStaticVehicleEx(565,2464.6999512,1358.0000000,10.5000000,180.0000000,-1,-1,0); //Flash
    if(KocsiID[playerid] == eladokocsi[4])AddStaticVehicleEx(562,2460.8999023,1358.4000244,10.6000004,180.0000000,-1,-1,0); //Elegy
    if(KocsiID[playerid] == eladokocsi[5])AddStaticVehicleEx(560,2457.3000488,1358.5000000,10.6000004,180.0000000,-1,-1,0); //Sultan
    if(KocsiID[playerid] == eladokocsi[6])AddStaticVehicleEx(559,2453.5000000,1358.5999756,10.6000004,180.0000000,-1,-1,0); //Jester
if(KocsiID[playerid] == eladokocsi[7])AddStaticVehicleEx(558,2449.6000977,1358.4000244,10.5000000,180.0000000,-1,-1,0); //Uranus
    if(KocsiID[playerid] == eladokocsi[8])AddStaticVehicleEx(555,2467.3999023,1345.1999512,10.6000004,0.0000000,-1,-1,0); //Windsor
    if(KocsiID[playerid] == eladokocsi[9])AddStaticVehicleEx(541,2463.3999023,1345.1999512,10.5000000,0.0000000,-1,-1,0); //Bullet
    if(KocsiID[playerid] == eladokocsi[10])AddStaticVehicleEx(506,2459.3999023,1345.4000244,10.6000004,0.0000000,-1,-1,0); //Super GT
    if(KocsiID[playerid] == eladokocsi[11])AddStaticVehicleEx(480,2454.8000488,1345.5000000,10.6999998,0.0000000,-1,-1,0); //Comet
if(KocsiID[playerid] == eladokocsi[12])AddStaticVehicleEx(477,2450.3999023,1345.5999756,10.6999998,0.0000000,-1,-1,0); //ZR-350
    if(KocsiID[playerid] == eladokocsi[13])AddStaticVehicleEx(451,2441.3000488,1354.8000488,10.6000004,270.0000000,-1,-1,0); //Turismo
    if(KocsiID[playerid] == eladokocsi[14])AddStaticVehicleEx(429,2441.1000977,1350.4000244,10.6000004,270.0000000,-1,-1,0); //Banshee
    if(KocsiID[playerid] == eladokocsi[15])AddStaticVehicleEx(415,2441.0000000,1346.3000488,10.6999998,270.0000000,-1,-1,0); //Cheetah
if(KocsiID[playerid] == eladokocsi[16])AddStaticVehicleEx(411,2441.0000000,1342.0999756,10.6000004,270.0000000,-1,-1,0); //Infernus
if(KocsiID[playerid] == eladokocsi[17])AddStaticVehicleEx(402,2441.1000977,1359.0999756,10.8000002,270.0000000,-1,-1,0); //Buffalo
if(KocsiID[playerid] == eladokocsi[18])AddStaticVehicleEx(549,2464.8999023,1336.8000488,10.6999998,180.0000000,-1,-1,0); //Tampa
if(KocsiID[playerid] == eladokocsi[19])AddStaticVehicleEx(545,2461.1000977,1336.5999756,10.8000002,180.0000000,-1,-1,0); //Hustler
if(KocsiID[playerid] == eladokocsi[20])AddStaticVehicleEx(533,2456.8000488,1336.8000488,10.6000004,178.0000000,-1,-1,0); //Feltzer
if(KocsiID[playerid] == eladokocsi[22])AddStaticVehicleEx(431,2445.0000000,1327.0999756,11.1000004,270.0000000,-1,-1,0); //Bus
if(KocsiID[playerid] == eladokocsi[23])AddStaticVehicleEx(571,2440.5000000,1338.3000488,10.1999998,270.0000000,-1,-1,0); //Kart
if(KocsiID[playerid] == eladokocsi[24])AddStaticVehicleEx(478,2441.3999023,1334.6999512,10.8000002,270.0000000,-1,-1,0); //Walton
return 1;
}
« Utoljára szerkesztve: 2013. július 12. - 01:23:29 írta BoOy »

Autóker
« Válasz #2 Dátum: 2013. július 12. - 17:02:36 »
0 Show voters
Szia! Sajnos még mindig nem jó. Ha beszállok egy jármûbe akkor azt írja ki hogy ezt a kocsit nem lehet már megvenni.
Plusz nem hozza létre 10mp után az autót.
« Utoljára szerkesztve: 2013. július 12. - 17:08:04 írta justrics »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal