[SAMMELTHREAD] Kleine Scripting Fragen

Dein Problem konnte durch einen User gelöst werden? Bedank dich bei ihm indem du seinen Beitrag als Hilfreich markierst sowie einen Daumen oben dalässt
Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link

  • Nunja, wenn man als Leader ins Auto steigt, erscheint ein Dialog mit Ja oder Nein.
    Wenn man Ja drückt, wird ja eigentlich geguckt ob in der Fkasse genug Geld drin ist. Gehen wir davon aus das LSPD 500$ in der Fkasse hat und das Auto 250.000$ kostet. Wenn der Leader nun JA drückt müsste eigentlich stehen das nicht genung in der Fkasse drin ist, jedoch kann er das Auto kaufen.
    Auch wenn er Genung Geld drin hat, wird nichts der Fkasse abgezogen.


    Debugge den Code mal:


    if(FraktionsKasse[fraktion] >= FactionBuylist[fbl][fbPrice]){


    zu:
    printf("fraktion: %d | Kasse: %d | Price: %d", fraktion, FraktionsKasse[fraktion], FactionBuylist[fbl][fbPrice]);
    if(FraktionsKasse[fraktion] >= FactionBuylist[fbl][fbPrice]){


    Dann wirst du das Problem wohl sehen.


    Falls nicht, bitte ich dich, mach einen extra Thread auf, da das dann keine "kleine Frage" mehr ist. Danke.


  • Es gibt auch sonnige Wetter ID's, die das Leuchten zulassen.


    //E: UsePlayerPedAnims() ist aber die korrekte Funktion. Wo hast Du diese eingebaut? Unter OnGameModeInit()?



    public OnGameModeInit()
    {
    SetWeather(22);


    UsePlayerPedAnims();


    Da hab ich es


    //edit:


    Wie bekomm ich arsu, ob ein Textfeld leer abgeschickt wurde? (Google spuckt nix aus)

    Einmal editiert, zuletzt von datgame ()

  • Hmm, eigentlich sollte das den RP Laufstil aktivieren (also den "nicht CJ laufstil").
    Warum das nicht funktioniert, keine Ahnung.

    Wie bekomm ich arsu, ob ein Textfeld leer abgeschickt wurde? (Google spuckt nix aus)


    Meinst Du das von einem Dialog?


    Folgendermaßen:
    if(strlen(inputtext) != 0){
    //nicht leer
    }else{
    //leer
    }


    Die Funktion strlen() returnt die Anzahl der Zeichen einer Zeichenkette (String).

  • Create3DTextLabel(" {0x009800FF}/Bar\n{0xFFFFFFFF}Getränke kaufen", 0xFFFFFFFF, 1309.1085,-1458.9995,15.4254, 15.0 ,0); //


    Möchte gerne unterschiedliche Farben im TextLabel nutzen, aber die Codes
    werde dann selber InGame angezeigt. Mit einem # davor klappt es auch nicht.

  • Warum wird immer angezeigt das mein Motor aus ist ?



    new vid = GetPlayerVehicleID(r);
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
    if(engine == VEHICLE_PARAMS_OFF)
    {
    format(str5,sizeof(str5),"Motor: ~r~ Aus");
    TextDrawSetString(Motordrw[i], str5);
    }
    else
    {
    format(str5,sizeof(str5),"Motor: ~g~ An");
    TextDrawSetString(Motordrw[i], str5);
    }


    Mfg Saphire


  • Mach den mal komplett am Anfang des OnGameModeInit() Callbacks.


    Spoiler anzeigen


    public OnGameModeInit()
    {
    UsePlayerPedAnims();

    Spoiler anzeigen
    SetWeather(47);

    Spoiler anzeigen
    ManualVehicleEngineAndLights();// Auto geht nicht automatisch an
    DisableInteriorEnterExits(); // Eigene Ein / Ausgänge
    // Don't use these lines if it's a filterscript
    SetGameModeText("CrashGamesDE Server");

    for (new i=0; i< MAX_VEHICLES; i++)
    {
    GetVehicleParamsEx(i,engine,lights,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(i,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    Motor[i] = false;
    }

    // Objekte

    CreateObject(968, 1544.8, -1630.9, 13.3, 0, 0, 272); // Schrankee
    lspdtor = CreateObject(975, 1588.5, -1638, 14.1, 0, 0, 180); // Tor
    CreateObject(12839, 1599.9, -1637.3, 16.4, 0, 0, 270); // Treppe
    CreateObject(12839, 1578.4, -1666.6, 22.6, 0, 0, 178); // Treppe
    umkleideraum = CreateObject(2634, 248.10001, 75.9, 1003.8, 0, 0, 90); // Umkleiden
    CreateObject(14883, 266.39999, 84.6, 1002, 0, 0, 0); // Knast
    CreateObject(2634, 266.29999, 83.3, 1001.2, 0, 0, 270); // Knast
    CreateObject(2634, 266.29999, 87.4, 1001.2, 0, 0, 270); // Knast
    buero = CreateObject(2634, 244.7, 75.9, 1004.1, 0, 0, 270); // Büro Tür

    CreateObject(2948, 228.2, 150.2, 1002, 0, 0, 180);
    CreateObject(2948, 228.2, 152.2, 1002, 0, 0, 0);
    CreateObject(2948, 228.2, 160.2, 1002, 0, 0, 179.995);
    CreateObject(2948, 228.2, 162.2, 1002, 0, 0, 0);
    CreateObject(2195, 234, 162.3, 1003.6, 0, 0, 0);
    CreateObject(2195, 234.10001, 163.8, 1003.6, 0, 0, 0);
    CreateObject(2948, 230.5, 169.89999, 1002, 0, 0, 89.995);
    CreateObject(2948, 232.5, 169.89999, 1002, 0, 0, 270);
    CreateObject(2948, 276.60001, 189.39999, 1006.2, 0, 0, 270);
    CreateObject(2948, 297.60001, 189.39999, 1006.2, 0, 0, 270);
    CreateObject(2948, 274.60001, 189.39999, 1006.2, 0, 0, 89.995);
    CreateObject(2948, 295.70001, 189.39999, 1006.2, 0, 0, 89.995);
    CreateObject(974, 238.89999, 183.32001, 1004.8, 0, 0, 358.5);

    lvpd_haupteingang = CreateObject(969, 2237.5, 2457.8, 9.7, 0, 0, 270);
    lvpd_garage_1 = CreateObject(971, 2293.8, 2497.7, 6.5, 0, 0, 270);
    lvpd_garage_2 = CreateObject(971, 2334.6001, 2443.7, 8.3, 0, 0, 60);

    //Pickups

    Spoiler anzeigen
    // ### LSPD ###

    Spoiler anzeigen
    LSPD_Rein = CreatePickup(1318, 2, 1555.4827,-1675.5950,16.1953, -1);
    LSPD_Raus = CreatePickup(1318, 2, 246.8005,62.5802,1003.6406, -1);
    LSPD_Uniform = CreatePickup(1242, 1,255.3841,77.1049,1003.6406, -1);
    LSPD_Munni = CreatePickup(1247, 1, 227.4215,81.3636,1005.0391, -1);

    //// #### LVPD ####

    LVPD_Dach_Rauf = CreatePickup(1318, 2, 2297.1084,2451.5430,10.8203, -1);
    LVPD_Dach_Runter = CreatePickup(1318, 2, 2258.7717,2442.4595,38.6837, -1);
    LVPD_Garage_Hoch = CreatePickup(1318, 2, 2267.9065,2449.2878,3.5313, -1);
    LVPD_Garage_Runter = CreatePickup(1318, 2, 201.3219,162.1742,1003.0234, -1);
    LVPD_Uniform = CreatePickup(1242, 1, 212.2694,182.6608,1003.0313, -1);
    LVPD_Munni = CreatePickup(1247, 1, 198.3351,167.6602,1003.0234, -1);

    Spoiler anzeigen


    //Bots



    // 3D Texte

    LSPD_Uniform_Text = Create3DTextLabel("Uniform\nauswählen\n{ffffff}/uniform", GRAU, 255.3841, 77.1049, 1003.6406, 40.0, 0, 1);
    LSPD_Munni_Text = Create3DTextLabel("Waffen\nauswählen\n{ffffff}/waffen", GRAU, 227.4215,81.3636,1005.0391, 40, 0, 1);

    LVPD_Munni_Text = Create3DTextLabel("Waffen\nauswählen\n{ffffff}/waffen", GRAU, 198.3351,167.6602,1003.0234, 40, 0, 1);
    LVPD_Uniform_Text = Create3DTextLabel("Uniform\nauswählen\n{ffffff}/uniform", GRAU, 212.2694,182.6608,1003.0313, 40, 0, 1);

    LimitGlobalChatRadius(0);
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////7777777777

    // Autos

    // ### LSPD ###

    AddStaticVehicle(462,1012.3747,-1116.2277,23.4990,206.4340,1,2); // Spawn Mofa 1
    AddStaticVehicle(462,1010.3589,-1116.5540,23.4994,209.6006,1,3); // Spawn Mofa 2
    AddStaticVehicle(462,1008.4908,-1116.5521,23.4989,209.2167,1,2); // Spawn Mofa 3
    AddStaticVehicle(462,1006.4607,-1116.4871,23.4993,204.7344,1,3); // Spawn Mofa 4
    lspdcars[0] = AddStaticVehicle(596,1602.2756,-1683.8683,5.6109,89.5004,0,1); // LSPD Car 1
    SetVehicleNumberPlate(lspdcars[0],">> ADMIN <<");
    lspdcars[1] = AddStaticVehicle(596,1601.6694,-1687.9027,5.6128,89.6279,0,1); // LSPD Car 2
    lspdcars[2] = AddStaticVehicle(596,1602.1924,-1691.9919,5.6120,90.5504,0,1); // LSPD Car 3
    lspdcars[3] = AddStaticVehicle(596,1602.1058,-1696.1147,5.6125,93.2973,0,1); // LSPD Car 4
    lspdcars[4] = AddStaticVehicle(596,1602.1277,-1700.0557,5.6119,89.8685,0,1); // LSPD Car 5
    lspdcars[5] = AddStaticVehicle(596,1602.4858,-1704.0632,5.6127,89.0587,0,1); // LSPD Car 6
    lspdcars[6] = AddStaticVehicle(596,1595.5222,-1711.2043,5.6109,359.7416,0,1); // LSPD Car 7
    lspdcars[7] = AddStaticVehicle(596,1591.5250,-1711.5265,5.6120,0.3486,0,1); // LSPD Car 8
    lspdcars[8] = AddStaticVehicle(596,1587.4171,-1710.9983,5.6118,359.1991,0,1); // LSPD Car 9
    lspdcars[9] = AddStaticVehicle(596,1583.4586,-1710.9270,5.6123,358.6964,0,1); // LSPD Car 10
    lspdcars[10] = AddStaticVehicle(541,1546.4777,-1684.4218,5.5156,89.4721,0,0); // LSPD UC Car 1
    lspdcars[11] = AddStaticVehicle(451,1546.0315,-1680.3389,5.5977,89.2009,0,0); // LSPD UC Car 2
    lspdcars[12] = AddStaticVehicle(415,1546.4047,-1676.3129,5.6622,89.7762,0,0); // LSPD UC Car 3
    lspdcars[13] = AddStaticVehicle(411,1546.4122,-1672.1812,5.6177,88.9865,0,0); // LSPD UC Car 4
    lspdcars[14] = AddStaticVehicle(560,1546.5494,-1667.7411,5.5957,89.4947,0,0); // LSPD UC Car 5
    lspdcars[15] = AddStaticVehicle(601,1526.7428,-1644.0216,5.6494,179.2126,1,1); // LSPD WaWe
    lspdcars[16] = AddStaticVehicle(427,1530.4794,-1644.7791,6.0228,180.1678,0,1); // LSPD Enforcer 1
    lspdcars[17] = AddStaticVehicle(427,1534.4702,-1644.6163,6.0225,178.3650,0,1); // LSPD Enforcer 2
    lspdcars[18] = AddStaticVehicle(523,1583.5271,-1666.5341,5.4641,266.7739,0,0); // LSPD HPV 1
    lspdcars[19] = AddStaticVehicle(523,1583.4637,-1667.6984,5.4651,269.2312,0,0); // LSPD HPV 2
    lspdcars[20] = AddStaticVehicle(523,1583.5245,-1669.0985,5.4605,269.1323,0,0); // LSPD HPV 3
    lspdcars[21] = AddStaticVehicle(523,1583.7172,-1670.4918,5.4643,270.0390,0,0); // LSPD HPV 4
    lspdcars[22] = AddStaticVehicle(523,1583.6940,-1671.6549,5.4624,271.2120,0,0); // LSPD HPV 5
    lspdcars[23] = AddStaticVehicle(523,1583.5591,-1673.0099,5.4656,268.6125,0,0); // LSPD HPV 6
    lspdcars[24] = AddStaticVehicle(497,1552.9476,-1609.5504,13.5605,88.8495,0,1); // LSPD Heli
    lspdcars[25] = AddStaticVehicle(447,1577.4738,-1611.7527,13.3962,88.5860,75,2); // LSPD Seasparrow

    // ### SFPD ###

    sfpdcars[0] = AddStaticVehicle(497,-1679.0691,701.2458,30.7786,89.9370,0,1); // SFPD Heli 1
    sfpdcars[1] = AddStaticVehicle(497,-1676.3234,710.2209,30.7772,88.9910,0,1); // SFPD Heli 2
    sfpdcars[2] = AddStaticVehicle(597,-1572.6504,730.7513,-5.4738,90.1907,0,1); // SFPD Car 1
    sfpdcars[3] = AddStaticVehicle(597,-1572.7418,734.8873,-5.4731,91.0521,0,1); // SFPD Car 2
    sfpdcars[4] = AddStaticVehicle(597,-1572.8153,738.6423,-5.4735,89.1472,0,1); // SFPD Car 3
    sfpdcars[5] = AddStaticVehicle(597,-1572.7417,742.7391,-5.4731,90.3047,0,1); // SFPD Car 4
    sfpdcars[6] = AddStaticVehicle(597,-1579.9391,749.5265,-5.4727,181.8255,0,1); // SFPD Car 5
    sfpdcars[7] = AddStaticVehicle(597,-1583.9630,749.4735,-5.4744,180.0860,0,1); // SFPD Car 6
    sfpdcars[8] = AddStaticVehicle(597,-1587.9653,749.5159,-5.4740,180.1999,0,1); // SFPD Car 7
    sfpdcars[9] = AddStaticVehicle(597,-1592.2996,749.5643,-5.4732,179.8793,0,1); // SFPD Car 8
    sfpdcars[10] = AddStaticVehicle(597,-1596.2345,749.5557,-5.4737,180.0162,0,1); // SFPD Car 9
    sfpdcars[11] = AddStaticVehicle(597,-1600.3632,749.5182,-5.4733,178.7411,0,1); // SFPD Car 10
    sfpdcars[12] = AddStaticVehicle(597,-1604.5746,749.5794,-5.4735,180.6884,0,1); // SFPD Car 11
    sfpdcars[13] = AddStaticVehicle(597,-1608.6488,749.5759,-5.4742,180.4678,0,1); // SFPD Car 12
    sfpdcars[14] = AddStaticVehicle(597,-1612.5012,749.5903,-5.4732,179.8267,0,1); // SFPD Car 13
    sfpdcars[15] = AddStaticVehicle(597,-1616.6794,749.6233,-5.4731,178.6638,0,1); // SFPD Car 14
    sfpdcars[16] = AddStaticVehicle(523,-1617.7898,730.3739,-5.6707,359.2870,0,0); // SFPD HPV 1
    sfpdcars[17] = AddStaticVehicle(523,-1616.1416,730.3624,-5.6717,359.0703,0,0); // SFPD HPV 2
    sfpdcars[18] = AddStaticVehicle(523,-1613.4961,730.3749,-5.6715,359.5328,0,0); // SFPD HPV 3
    sfpdcars[19] = AddStaticVehicle(523,-1611.6820,730.4355,-5.6728,359.3197,0,0); // SFPD HPV 4
    sfpdcars[20] = AddStaticVehicle(470,-1600.2916,694.2013,-5.2491,179.8159,0,0); // SFPD UC 1
    sfpdcars[21] = AddStaticVehicle(429,-1604.3639,694.4284,-5.5625,181.7343,0,0); // SFPD UC 2
    sfpdcars[22] = AddStaticVehicle(415,-1608.3342,694.3867,-5.4706,179.0418,0,0); // SFPD UC 3
    sfpdcars[23] = AddStaticVehicle(411,-1612.3837,694.4066,-5.5151,180.0304,0,0); // SFPD UC 4
    sfpdcars[24] = AddStaticVehicle(402,-1616.7813,693.9189,-5.4106,179.2425,0,0); // SFPD UC 5
    sfpdcars[25] = AddStaticVehicle(601,-1622.4005,649.7158,-5.4840,89.5626,1,1); // SFPD WaWe
    sfpdcars[26] = AddStaticVehicle(427,-1639.2013,649.6100,-5.1100,268.9421,0,1); // SFPD Enforcer 1
    sfpdcars[27] = AddStaticVehicle(427,-1639.4443,653.6503,-5.1091,270.7590,0,1); // SFPD Enforcer 2

    // ### GSF ####

    gsfcars[0] = AddStaticVehicle(600,2473.3345,-1692.6395,13.2293,1.0729,128,128); // GSF Car 1
    gsfcars[1] = AddStaticVehicle(576,2517.5283,-1664.5031,13.6539,92.4742,128,128); // GSF Car 2
    gsfcars[2] = AddStaticVehicle(576,2517.0662,-1668.1808,13.6425,94.5033,128,128); // GSF Car 3
    gsfcars[3] = AddStaticVehicle(567,2516.5168,-1682.0516,13.3067,44.5736,128,128); // GSF Car 4
    gsfcars[4] = AddStaticVehicle(567,2480.3967,-1653.4512,13.2631,92.2791,128,128); // GSF Car 5
    gsfcars[5] = AddStaticVehicle(560,2506.8208,-1695.0044,13.2599,359.3451,128,128); // GSF Car 6
    gsfcars[6] = AddStaticVehicle(560,2482.2256,-1692.5165,13.2248,353.1717,128,128); // GSF Car 7
    gsfcars[7] = AddStaticVehicle(536,2505.1475,-1680.2245,13.1984,315.1429,128,128); // GSF Car 8
    gsfcars[8] = AddStaticVehicle(468,2493.6328,-1687.7274,13.1851,1.3609,128,128); // GSF Car 9
    gsfcars[9] = AddStaticVehicle(468,2491.1895,-1688.0950,13.1860,359.4692,128,128); // GSF Car 10

    // ### LVPD ####

    lvpdcars[0] = AddStaticVehicle(598,2251.8330,2442.2844,10.5669,359.7865,0,1); // LVPD Car 1
    lvpdcars[1] = AddStaticVehicle(598,2256.2124,2442.2402,10.5662,359.4998,0,1); // LVPD Car 2
    lvpdcars[2] = AddStaticVehicle(598,2260.4927,2442.1470,10.5655,358.9461,0,1); // LVPD Car 3
    lvpdcars[3] = AddStaticVehicle(598,2269.1580,2442.0066,10.5671,359.3091,0,1); // LVPD Car 4
    lvpdcars[4] = AddStaticVehicle(598,2273.6589,2441.6162,10.5641,359.7486,0,1); // LVPD Car 5
    lvpdcars[5] = AddStaticVehicle(598,2277.9353,2441.5637,10.5648,359.7273,0,1); // LVPD Car 6
    lvpdcars[6] = AddStaticVehicle(598,2282.2268,2441.5435,10.5652,0.1194,0,1); // LVPD Car 7
    lvpdcars[7] = AddStaticVehicle(598,2251.8662,2478.7700,10.5645,181.7468,0,1); // LVPD Car 8
    lvpdcars[8] = AddStaticVehicle(598,2256.0435,2478.6763,10.5695,180.5374,0,1); // LVPD Car 9
    lvpdcars[9] = AddStaticVehicle(598,2260.5229,2478.7485,10.5643,179.6844,0,1); // LVPD Car 10
    lvpdcars[10] = AddStaticVehicle(598,2268.9783,2478.0317,10.5650,180.3522,0,1); // LVPD Car 11
    lvpdcars[11] = AddStaticVehicle(598,2273.4512,2478.5891,10.5682,180.3985,0,1); // LVPD Car 12
    lvpdcars[12] = AddStaticVehicle(598,2278.0837,2478.7112,10.5632,178.8650,0,1); // LVPD Car 13
    lvpdcars[13] = AddStaticVehicle(598,2282.3738,2478.7454,10.5671,179.3634,0,1); // LVPD Car 14
    lvpdcars[14] = AddStaticVehicle(523,2282.2478,2460.1243,10.3918,182.6845,0,0); // LVPD HPV 1
    lvpdcars[15] = AddStaticVehicle(523,2278.0107,2460.1504,10.3916,178.2257,0,0); // LVPD HPV 2
    lvpdcars[16] = AddStaticVehicle(523,2273.6536,2460.0452,10.3917,180.3598,0,0); // LVPD HPV 3
    lvpdcars[17] = AddStaticVehicle(523,2268.9221,2460.1045,10.3899,180.0112,0,0); // LVPD HPV 4
    lvpdcars[18] = AddStaticVehicle(523,2260.5288,2460.1094,10.3909,180.0569,0,0); // LVPD HPV 5
    lvpdcars[19] = AddStaticVehicle(523,2256.5098,2460.2119,10.3898,179.0694,0,0); // LVPD HPV 6
    lvpdcars[20] = AddStaticVehicle(523,2252.0544,2460.2742,10.3911,181.3237,0,0); // LVPD HPV 7
    lvpdcars[21] = AddStaticVehicle(411,2285.5735,2472.7246,3.0005,358.9577,0,0); // LVPD Infernus 1
    lvpdcars[22] = AddStaticVehicle(411,2281.5237,2472.8655,3.0005,1.0902,0,0); // LVPD Infernus 2
    lvpdcars[23] = AddStaticVehicle(411,2276.8191,2472.7961,3.0005,358.2734,0,0); // LVPD Infernus 3
    lvpdcars[24] = AddStaticVehicle(411,2272.4866,2472.9231,3.0005,359.7260,0,0); // LVPD Infernus 4
    lvpdcars[25] = AddStaticVehicle(411,2267.9727,2472.7004,3.0007,358.8069,0,0); // LVPD Infernus 5
    lvpdcars[26] = AddStaticVehicle(411,2263.7744,2472.9917,3.0005,359.8727,0,0); // LVPD Infernus 6
    lvpdcars[27] = AddStaticVehicle(415,2238.7615,2437.3538,3.0452,271.0197,0,0); // LVPD Cheetah 1
    lvpdcars[28] = AddStaticVehicle(415,2238.8198,2442.1284,3.0445,269.6147,0,0); // LVPD Cheetah 2
    lvpdcars[29] = AddStaticVehicle(415,2238.5229,2447.0662,3.0440,268.4031,0,0); // LVPD Cheetah 3
    lvpdcars[30] = AddStaticVehicle(415,2238.8330,2451.7603,3.0449,269.8962,0,0); // LVPD Cheetah 4
    lvpdcars[31] = AddStaticVehicle(415,2238.9536,2456.7815,3.0445,268.3377,0,0); // LVPD Cheetah 5
    lvpdcars[32] = AddStaticVehicle(415,2238.7173,2461.4580,3.0441,269.4460,0,0); // LVPD Cheetah 6
    lvpdcars[33] = AddStaticVehicle(415,2239.0168,2466.1628,3.0451,269.2847,0,0); // LVPD Cheetah 7
    lvpdcars[34] = AddStaticVehicle(415,2238.8088,2470.9700,3.0452,269.3702,0,0); // LVPD Cheetah 8
    lvpdcars[35] = AddStaticVehicle(415,2238.5886,2475.8401,3.0438,269.1823,0,0); // LVPD Cheetah 9
    lvpdcars[36] = AddStaticVehicle(451,2296.3899,2464.2849,2.9800,271.0831,0,0); // LVPD Turismo 1
    lvpdcars[37] = AddStaticVehicle(451,2296.3513,2460.0796,2.9805,269.1188,0,0); // LVPD Turismo 2
    lvpdcars[38] = AddStaticVehicle(451,2296.3137,2455.8257,2.9797,271.9124,0,0); // LVPD Turismo 3
    lvpdcars[39] = AddStaticVehicle(451,2296.4063,2451.5376,2.9797,269.4931,0,0); // LVPD Turismo 4
    lvpdcars[40] = AddStaticVehicle(490,2307.6912,2429.3237,3.4015,357.3235,0,0); // LVPD FBI Rancher 1
    lvpdcars[41] = AddStaticVehicle(490,2303.7070,2429.3298,3.4016,359.0206,0,0); // LVPD FBi Rancher 2
    lvpdcars[42] = AddStaticVehicle(490,2298.8289,2429.3274,3.4013,358.9577,0,0); // LVPD FBi Rancher 3
    lvpdcars[43] = AddStaticVehicle(490,2290.3457,2429.2351,3.4019,358.1822,0,0); // LVPD FBi Rancher 4
    lvpdcars[44] = AddStaticVehicle(490,2286.0437,2429.1753,3.4009,0.6863,0,0); // LVPD FBi Rancher 5
    lvpdcars[45] = AddStaticVehicle(521,2276.9807,2431.2544,2.8454,1.4145,0,0); // LVPD BF-400 1
    lvpdcars[46] = AddStaticVehicle(521,2272.5205,2431.2600,2.8378,357.4972,0,0); // LVPD BF-400 2
    lvpdcars[47] = AddStaticVehicle(521,2268.5271,2431.3723,2.8439,353.8526,0,0); // LVPD BF-400 3
    lvpdcars[48] = AddStaticVehicle(521,2264.0146,2431.2410,2.8429,356.2775,0,0); // LVPD BF-400 4
    lvpdcars[49] = AddStaticVehicle(521,2259.3225,2430.9561,2.8439,355.2354,0,0); // LVPD BF-400 5
    lvpdcars[50] = AddStaticVehicle(521,2255.2153,2430.9988,2.8433,359.9341,0,0); // LVPD BF-400 6
    lvpdcars[51] = AddStaticVehicle(521,2250.5093,2430.7830,2.8454,1.7494,0,0); // LVPD BF-400 7
    lvpdcars[52] = AddStaticVehicle(521,2246.2861,2430.7195,2.8441,357.4387,0,0); // LVPD BF-400 8
    lvpdcars[53] = AddStaticVehicle(560,2314.6313,2500.4917,2.9780,88.7702,0,0); // LVPD Sultan 1
    lvpdcars[54] = AddStaticVehicle(560,2314.7095,2495.3069,2.9784,88.6313,0,0); // LVPD Sultan 2
    lvpdcars[55] = AddStaticVehicle(560,2314.6787,2490.1816,2.9788,88.8724,0,0); // LVPD Sultan 3
    lvpdcars[56] = AddStaticVehicle(560,2314.5999,2485.1248,2.9787,89.7541,0,0); // LVPD Sultan 4
    lvpdcars[57] = AddStaticVehicle(560,2314.6255,2480.1902,2.9784,88.3289,0,0); // LVPD Sultan 5
    lvpdcars[58] = AddStaticVehicle(560,2314.4236,2475.0874,2.9787,88.8199,0,0); // LVPD Sultan 6
    lvpdcars[59] = AddStaticVehicle(560,2314.4065,2470.1379,2.9784,90.5023,0,0); // LVPD Sultan 7
    lvpdcars[60] = AddStaticVehicle(560,2314.3860,2465.4263,2.9785,89.4986,0,0); // LVPD Sultan 8
    lvpdcars[61] = AddStaticVehicle(560,2314.2637,2460.2964,2.9784,91.3650,0,0); // LVPD Sultan 9
    lvpdcars[62] = AddStaticVehicle(560,2314.1409,2455.2937,2.9785,88.9470,0,0); // LVPD Sultan 10
    lvpdcars[63] = AddStaticVehicle(497,2343.9502,2478.8474,38.8604,357.9343,0,1); // LVPD Heli 1
    lvpdcars[64] = AddStaticVehicle(497,2271.1587,2472.5259,38.8610,355.2183,0,1); // LVPD Heli 2
    lvpdcars[65] = AddStaticVehicle(447,2295.7290,2478.8560,38.6994,356.4973,0,0); // LVPD SeaSparrow

    Spoiler anzeigen
    // ### Dillimore ###

    lspdcars[26] = AddStaticVehicle(599,613.8032,-601.6367,17.4171,271.0291,128,1); // Dillimore Rancher 1
    lspdcars[27] = AddStaticVehicle(599,612.7357,-597.1964,17.4190,271.1074,128,1); // Dillimore Rancher 2
    lspdcars[28] = AddStaticVehicle(596,623.1211,-609.1287,16.8034,295.0281,128,1); // Dillimore Car 1
    lspdcars[29] = AddStaticVehicle(596,621.8602,-605.1498,16.8736,296.0243,128,1); // Dillimore Car 2

    Spoiler anzeigen
    return 1;
    }


    So hab ich das jetzt

  • @|Prototype|: Habe es jetzt mit MapAndreas versucht..


    Habe es jetzt so:

    new keys, ud, lr;
    GetPlayerKeys(playerid, keys, ud, lr);


    if(IsPlayerInAnyVehicle(playerid))
    {
    new vehicle = GetPlayerVehicleID(playerid);
    new Float:x,Float:y,Float:z; GetVehiclePos(vehicle,x,y,z);
    new Float:_z = GetPointZPos(x,y), Float:difference = _z - z,Float:half_speed = (VehSpeed[GetVehicleModel(vehicle)] / 2);
    if(keys & KEY_UP){
    if(GetVehicleSpeed(vehicle) > float(VehSpeed[GetVehicleModel(vehicle)]))return SetVehicleSpeed(vehicle,float(VehSpeed[GetVehicleModel(vehicle)]));
    printf("difference: %f",difference); // durchgehen bei -0.7xxxxxx
    if(difference <= -0.8){
    printf("aufgerufen!");
    if(GetVehicleSpeed(vehicle) >= half_speed && GetVehicleSpeed(vehicle) < VehSpeed[GetVehicleModel(vehicle)])SetVehicleSpeed(vehicle,float(GetVehicleSpeed(vehicle) +10));
    }
    }
    }


    Jedoch wird der Text "difference: xxxxxx" nur ziemlich selten aufgerufen, obwohl ich durchgehen fahre, und auch durchgehend die Beschleunigungstaste für paar Sekunden drücke, um es zu testen..
    Und wenn es aufgerufen wird mit dem Text "diferrence", dann stoppt es bei der Abfrage "difference <= -0.8", obwohl die z-Koord durchgehend bei -0.7xxxx liegt..


    Die Funktion Vehspeed ist eine Funktion, bei der die maximalen Fahrzeuggeschwindigkeiten sind, und das klappt auch wunderbar, "half_speed" liegt bei 130, und das ist auch richtig.. Der Infernus fährt trotzdem nur 209, anstatt 260..


    Woran kann das liegen?



    2.
    Wie kann ich eine "Where"-Funktion machen, ohne MySQL?
    Habe schonmal bisl was versucht, jedoch ist nur Müll rausgekommen ;)
    Habs gerade so..
    stock Where(func[]){
    new dir:dHandle = dir_open("./scriptfiles/Accounts/");
    new item[40], type,datei[20];


    while(dir_list(dHandle, item, type))
    {
    if(type == FM_FILE)
    {
    format(datei,20,"/Accounts/%s",item);

    }
    }
    return dir_close(dHandle);
    }


    Kann mir da jemand weiterhelfen?
    Die Funktion ist dafür da, bei allen Spielern eine bestimmte Information aus deren Spielerdatei herauszufinden, ohne MySQL..



    Danke im Voraus!


    //Edit: Und wo soll ich die Objekte ertfernen lassen? ( damit das Game nicht crasht oder aufhängt )

    Mit freundlichen Grüßen
    ErikSon



    Scripte kleine Systeme auf Anfrage umsonst!
    Per PN könnt ihr mir gerne Scriptingfragen stellen.

    Einmal editiert, zuletzt von ErikSon ()

  • Warum wird immer angezeigt das mein Motor aus ist ?



    new vid = GetPlayerVehicleID(r);
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
    if(engine == VEHICLE_PARAMS_OFF)
    {
    format(str5,sizeof(str5),"Motor: ~r~ Aus");
    TextDrawSetString(Motordrw[i], str5);
    }
    else
    {
    format(str5,sizeof(str5),"Motor: ~g~ An");
    TextDrawSetString(Motordrw[i], str5);
    }


    Mfg Saphire

  • Moinsen, bei mir möchte das Script den Führerschein nicht Speichern,

    if(strcmp(cmdtext,"/lizenzen",true) == 0)
    {
    if(IsPlayerInRangeOfPoint(playerid, 2.0, 2031.2941,1330.9714,10.8203))
    {
    SendClientMessage(playerid,0xAA3333AA,"Willkommen am Lizenzhändler!");
    //ShowPlayerDialog(playerid,DIALOG_SCHEINE,DIALOG_STYLE_LIST,"Scheine","Autoschein (500€)","Kaufen","Abbrechen");
    SendClientMessage(playerid,0xAA3333AA,"Du hast erfolgreich den Autoschein erhalten");
    GivePlayerMoney(playerid,-500);
    SetPVarInt(playerid,"Schein",1);


    Bei SetPVarInt(playerid,"Schein",1); passiert nichts nach dem Ausloggen bleibt es trotzdem auf 0 in der Spieler datei.