Warum sind die Autos vom Autoshaus nicht weiss sondern bunt?

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
  • Frage steht oben


    Enum:
    enum autohauscarEnum{
    model,
    Float:c_x,
    Float:c_y,
    Float:c_z,
    Float:c_r,
    c_preis,
    ah_id,
    id_x,
    Color_1,
    Color_2
    }


    new ahCars[][autohauscarEnum] = {
    {412,2103.8450,1409.5842,10.6566,0.1924,15000,0,COLOR_WHITE}, //Autohaus 1, Gebauchtwagen
    {534,2110.3457,1408.9539,10.5460,0.2380,15000,0,COLOR_WHITE},
    {518,2116.8232,1408.8162,10.4937,358.3378,13000,0,COLOR_WHITE},
    {536,2123.1187,1409.0094,10.5498,1.4423,12500,0,COLOR_WHITE},
    {533,2129.6584,1408.5408,10.5294,359.8628,11000,0,COLOR_WHITE},
    {466,2135.9221,1408.9258,10.5622,0.8526,8000,12000,0,COLOR_WHITE},
    {492,2142.3069,1409.0468,10.5993,359.9930,17000,0,COLOR_WHITE},
    {480,2148.8027,1408.4364,10.5927,359.4524,18500,0,COLOR_WHITE},
    {603,2145.5586,1398.1621,10.6420,180.4652,16000,0,COLOR_WHITE},
    {535,2139.1475,1398.2649,10.5756,178.6059,17500,0,COLOR_WHITE},
    {562,2132.8357,1398.6896,10.4816,181.1042,15000,0,COLOR_WHITE},
    {558,2126.2896,1398.4696,10.4393,179.9395,14500,0,COLOR_WHITE},
    {507,2119.9333,1397.8513,10.6391,179.5709,6500,0,COLOR_WHITE},
    {600,2113.4722,1398.0952,10.5329,179.9730,8500,0,COLOR_WHITE},
    {496,2107.1082,1398.6458,10.5840,179.4070,5500,0,COLOR_WHITE},
    {565,2100.7520,1398.6073,10.4454,179.1954,4500,0,COLOR_WHITE},
    {481,2461.9063,1337.8259,10.3210,151.2824,1500,1,COLOR_WHITE}, //Autohaus2, Motorrad
    {462,2458.8877,1338.1765,10.4177,150.8521,3000,1,COLOR_WHITE},
    {586,2455.7124,1337.8788,10.3400,146.2616,13000,1,COLOR_WHITE},
    {581,2452.1418,1337.6221,10.4153,156.3525,18000,1,COLOR_WHITE},
    {521,2440.2124,1339.9473,10.3957,239.9504,24000,1,COLOR_WHITE},
    {461,2440.2087,1342.6840,10.4038,243.7388,28000,1,COLOR_WHITE},
    {463,2440.2087,1345.8983,10.3606,242.9644,35000,1,COLOR_WHITE},
    {522,2440.1445,1348.8660,10.3921,239.4331,70000,1,COLOR_WHITE},
    {468,683.3861,1825.2622,4.9573,328.4282,17000,2,COLOR_WHITE}, //Autohaus3, Offroad
    {500,679.3278,1825.4117,5.3770,349.6652,25000,2,COLOR_WHITE},
    {554,674.8481,1827.3662,5.3320,348.9143,23000,2,COLOR_WHITE},
    {505,668.3312,1829.7117,5.3198,302.6436,30000,2,COLOR_WHITE},
    {579,668.1749,1836.6044,5.0598,263.1929,24000,2,COLOR_WHITE},
    {400,668.4810,1841.7926,5.2596,263.3816,16500,2,COLOR_WHITE},
    {471,668.0714,1845.3855,4.6346,260.6001,8000,2,COLOR_WHITE},
    {409,2434.8821,1651.3101,10.6213,88.7507,150000,3,COLOR_WHITE}, //Autohaus4, LuxusCars
    {541,2426.1550,1653.9694,10.4452,219.8360,170000,3,COLOR_WHITE},
    {559,2422.8804,1662.0508,10.4766,332.8268,135000,3,COLOR_WHITE},
    {506,2425.0513,1672.2029,10.5168,332.1645,120000,3,COLOR_WHITE},
    {402,2430.7961,1674.0610,10.6508,330.7833,110000,3,COLOR_WHITE},
    {429,2435.2512,1673.7396,10.5004,1.3049,125000,3,COLOR_WHITE},
    {560,2439.7590,1673.7755,10.5256,26.5780,160000,3,COLOR_WHITE},
    {451,2446.1355,1672.6711,10.5247,27.7232,230000,3,COLOR_WHITE},
    {415,2447.3645,1662.3269,10.5932,203.3294,180000,3,COLOR_WHITE},
    {411,2445.2241,1653.8003,10.5467,137.6222,250000,3,COLOR_WHITE},
    {519,1624.9279,1526.3020,11.7122,44.5704,400000,4,COLOR_WHITE}, //Autohaus5, Flugzeuge
    {469,1638.3878,1536.8196,10.8022,46.2593,320000,4,COLOR_WHITE},
    {487,1648.4219,1542.1687,10.9241,42.4183,380000,4,COLOR_WHITE},
    {593,1657.7698,1549.4210,11.2489,41.6538,200000,4,COLOR_WHITE},
    {452,1616.3683,593.6839,-0.2332,164.5531,140000,5,COLOR_WHITE}, //Autohaus6, Boote
    {446,1617.1893,577.0570,-0.5587,166.4310,190000,5,COLOR_WHITE},
    {472,1625.5609,569.7281,0.1912,178.7585,75000,5,COLOR_WHITE},
    {473,1631.4811,572.1327,0.0651,185.6611,50000,5,COLOR_WHITE},
    {493,1638.4229,576.5723,-0.1675,192.7350,200000,5,COLOR_WHITE},
    {454,1639.6404,590.9737,0.2862,189.4858,250000,5,COLOR_WHITE}
    };

  • Du musst die "Farb-IDs" angeben, also ändere alle "COLOR_WHITE" zu "1,1":

    Spoiler anzeigen
    new ahCars[][autohauscarEnum] = {
    {412,2103.8450,1409.5842,10.6566,0.1924,15000,0,1,1}, //Autohaus 1, Gebauchtwagen
    {534,2110.3457,1408.9539,10.5460,0.2380,15000,0,1,1},
    {518,2116.8232,1408.8162,10.4937,358.3378,13000,0,1,1},
    {536,2123.1187,1409.0094,10.5498,1.4423,12500,0,1,1},
    {533,2129.6584,1408.5408,10.5294,359.8628,11000,0,1,1},
    {466,2135.9221,1408.9258,10.5622,0.8526,8000,12000,0,1,1},
    {492,2142.3069,1409.0468,10.5993,359.9930,17000,0,1,1},
    {480,2148.8027,1408.4364,10.5927,359.4524,18500,0,1,1},
    {603,2145.5586,1398.1621,10.6420,180.4652,16000,0,1,1},
    {535,2139.1475,1398.2649,10.5756,178.6059,17500,0,1,1},
    {562,2132.8357,1398.6896,10.4816,181.1042,15000,0,1,1},
    {558,2126.2896,1398.4696,10.4393,179.9395,14500,0,1,1},
    {507,2119.9333,1397.8513,10.6391,179.5709,6500,0,1,1},
    {600,2113.4722,1398.0952,10.5329,179.9730,8500,0,1,1},
    {496,2107.1082,1398.6458,10.5840,179.4070,5500,0,1,1},
    {565,2100.7520,1398.6073,10.4454,179.1954,4500,0,1,1},
    {481,2461.9063,1337.8259,10.3210,151.2824,1500,1,1,1}, //Autohaus2, Motorrad
    {462,2458.8877,1338.1765,10.4177,150.8521,3000,1,1,1},
    {586,2455.7124,1337.8788,10.3400,146.2616,13000,1,1,1},
    {581,2452.1418,1337.6221,10.4153,156.3525,18000,1,1,1},
    {521,2440.2124,1339.9473,10.3957,239.9504,24000,1,1,1},
    {461,2440.2087,1342.6840,10.4038,243.7388,28000,1,1,1},
    {463,2440.2087,1345.8983,10.3606,242.9644,35000,1,1,1},
    {522,2440.1445,1348.8660,10.3921,239.4331,70000,1,1,1},
    {468,683.3861,1825.2622,4.9573,328.4282,17000,2,1,1}, //Autohaus3, Offroad
    {500,679.3278,1825.4117,5.3770,349.6652,25000,2,1,1},
    {554,674.8481,1827.3662,5.3320,348.9143,23000,2,1,1},
    {505,668.3312,1829.7117,5.3198,302.6436,30000,2,1,1},
    {579,668.1749,1836.6044,5.0598,263.1929,24000,2,1,1},
    {400,668.4810,1841.7926,5.2596,263.3816,16500,2,1,1},
    {471,668.0714,1845.3855,4.6346,260.6001,8000,2,1,1},
    {409,2434.8821,1651.3101,10.6213,88.7507,150000,3,1,1}, //Autohaus4, LuxusCars
    {541,2426.1550,1653.9694,10.4452,219.8360,170000,3,1,1},
    {559,2422.8804,1662.0508,10.4766,332.8268,135000,3,1,1},
    {506,2425.0513,1672.2029,10.5168,332.1645,120000,3,1,1},
    {402,2430.7961,1674.0610,10.6508,330.7833,110000,3,1,1},
    {429,2435.2512,1673.7396,10.5004,1.3049,125000,3,1,1},
    {560,2439.7590,1673.7755,10.5256,26.5780,160000,3,1,1},
    {451,2446.1355,1672.6711,10.5247,27.7232,230000,3,1,1},
    {415,2447.3645,1662.3269,10.5932,203.3294,180000,3,1,1},
    {411,2445.2241,1653.8003,10.5467,137.6222,250000,3,1,1},
    {519,1624.9279,1526.3020,11.7122,44.5704,400000,4,1,1}, //Autohaus5, Flugzeuge
    {469,1638.3878,1536.8196,10.8022,46.2593,320000,4,1,1},
    {487,1648.4219,1542.1687,10.9241,42.4183,380000,4,1,1},
    {593,1657.7698,1549.4210,11.2489,41.6538,200000,4,1,1},
    {452,1616.3683,593.6839,-0.2332,164.5531,140000,5,1,1}, //Autohaus6, Boote
    {446,1617.1893,577.0570,-0.5587,166.4310,190000,5,1,1},
    {472,1625.5609,569.7281,0.1912,178.7585,75000,5,1,1},
    {473,1631.4811,572.1327,0.0651,185.6611,50000,5,1,1},
    {493,1638.4229,576.5723,-0.1675,192.7350,200000,5,1,1},
    {454,1639.6404,590.9737,0.2862,189.4858,250000,5,1,1}
    };

  • Jeffry:


    if(dialogid==DIALOG_AUTOHAUS)
    {
    if(response)
    {
    //Autoverkauf
    new id=GetPVarInt(playerid,"buyCarID");
    if(GetPlayerMoney(playerid)<ahCars[id][c_preis])
    {
    SendClientMessage(playerid,COLOR_RED,"Du hast nicht genügend Geld.");
    RemovePlayerFromVehicle(playerid);
    return 1;
    }
    GivePlayerMoney(playerid,-ahCars[id][c_preis]);
    createPlayerCar(playerid,ahCars[id][model],ahInfo[ahCars[id][ah_id]][s_x],ahInfo[ahCars[id][ah_id]][s_y],ahInfo[ahCars[id][ah_id]][s_z],ahInfo[ahCars[id][ah_id]][s_r]);
    SendClientMessage(playerid,COLOR_GREEN,"Du hast das Auto erfolgreich gekauft");
    RemovePlayerFromVehicle(playerid);
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,COLOR_RED,"Du hast den Kauf abgebrochen");
    }
    return 1;
    }

  • //Autos besitzen
    createPlayerCar(playerid,modelid,Float:x,Float:y,Float:z,Float:r)
    {
    for(new i=0; i<sizeof(cInfo); i++)
    {
    if(cInfo[i][id_x]!=0)continue;
    cInfo[i][besitzer]=sInfo[playerid][db_id];
    cInfo[i][c_x]=x;
    cInfo[i][c_y]=y;
    cInfo[i][c_z]=z;
    cInfo[i][c_r]=r;
    cInfo[i][model]=modelid;
    cInfo[i][id_x] = CreateVehicle(modelid,x,y,z,r,-1,-1,-1);
    new string[128];
    format(string,sizeof(string),"Das Auto cInfo[%i] wurde erstellt.",i);
    SendClientMessageToAll(COLOR_RED,string);
    saveCarToDB(playerid,i);
    return 1;
    }
    return 1;
    }


    PS: die sollen ja schon weiss sein wenn die da stehen

  • Jeffry:


    Fehler meldung:


    C:\Users\Spiele\Desktop\Server Ordner\Server Projekt\gamemodes\ServerProjekt.pwn(1370) : warning 213: tag mismatch
    C:\Users\Spiele\Desktop\Server Ordner\Server Projekt\gamemodes\ServerProjekt.pwn(1370) : error 032: array index out of bounds (variable "cInfo")

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • Jeffry:


    createPlayerCar(playerid,modelid,Float:x,Float:y,Float:z,Float:r)
    {
    for(new i=0; i<sizeof(cInfo); i++)
    {
    if(cInfo[i][id_x]!=0)continue;
    cInfo[i][besitzer]=sInfo[playerid][db_id];
    cInfo[i][c_x]=x;
    cInfo[i][c_y]=y;
    cInfo[i][c_z]=z;
    cInfo[i][c_r]=r;
    cInfo[i][model]=modelid;
    cInfo[i][id_x] = CreateVehicle(modelid,x,y,z,r,cInfo[i][Color_1],cInfo[i][Color_2],-1);
    new string[128];
    format(string,sizeof(string),"Das Auto cInfo[%i] wurde erstellt.",i);
    SendClientMessageToAll(COLOR_RED,string);
    saveCarToDB(playerid,i);
    return 1;
    }
    return 1;
    }

  • //Cars
    enum carEnum{
    id_x,
    model,
    besitzer,
    Float:c_x,
    Float:c_y,
    Float:c_z,
    Float:c_r,
    db_id
    }


    //Autohaus spawn
    enum autohausEnum{
    Float:s_x,
    Float:s_y,
    Float:s_z,
    Float:s_r
    }


    //Autohaus Cars
    enum autohauscarEnum{
    model,
    Float:c_x,
    Float:c_y,
    Float:c_z,
    Float:c_r,
    c_preis,
    ah_id,
    id_x,
    Color_1,
    Color_2
    }