Function gibt keinen/oder falschen wert wieder

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
  • hey
    ich habe stadtteilfunktionen das sagt mir wo playerid ist,dennoch habe ich ein problem, da da immer Parken und LParken raus kommt obwohl es das nicht gibt
    hier die news
    enum zoneinfo
    {
    zone_name[27],
    Float:zone_minx,
    Float:zone_miny,
    Float:zone_minz,
    Float:zone_maxx,
    Float:zone_maxy,
    Float:zone_maxz
    }
    new zones[355][zoneinfo] =
    {
    { "'The Big Ear'", -410.00, 1403.30, -3.00, -137.90, 1681.20, 200.00},
    { "Aldea Malvada", -1372.10, 2498.50, 0.00, -1277.50, 2615.30, 200.00},
    { "Angel Pine", -2324.90, -2584.20, -6.10, -1964.20, -2212.10, 200.00},
    { "Arco del Oeste", -901.10, 2221.80, 0.00, -592.00, 2571.90, 200.00},
    { "Avispa Country Club", -2646.40, -355.40, 0.00, -2270.00, -222.50, 200.00},
    { "Avispa Country Club", -2831.80, -430.20, -6.10, -2646.40, -222.50, 200.00},
    { "Avispa Country Club", -2361.50, -417.10, 0.00, -2270.00, -355.40, 200.00},
    { "Avispa Country Club", -2667.80, -302.10, -28.80, -2646.40, -262.30, 71.10},
    { "Avispa Country Club", -2470.00, -355.40, 0.00, -2270.00, -318.40, 46.10},
    { "Avispa Country Club", -2550.00, -355.40, 0.00, -2470.00, -318.40, 39.70},
    { "Back o Beyond", -1166.90, -2641.10, 0.00, -321.70, -1856.00, 200.00},
    { "Battery Point", -2741.00, 1268.40, -4.50, -2533.00, 1490.40, 200.00},
    { "Bayside", -2741.00, 2175.10, 0.00, -2353.10, 2722.70, 200.00},
    { "Bayside Marina", -2353.10, 2275.70, 0.00, -2153.10, 2475.70, 200.00},
    { "Beacon Hill", -399.60, -1075.50, -1.40, -319.00, -977.50, 198.50},
    { "Blackfield", 964.30, 1203.20, -89.00, 1197.30, 1403.20, 110.90},
    { "Blackfield", 964.30, 1403.20, -89.00, 1197.30, 1726.20, 110.90},
    { "Blackfield Chapel", 1375.60, 596.30, -89.00, 1558.00, 823.20, 110.90},
    { "Blackfield Chapel", 1325.60, 596.30, -89.00, 1375.60, 795.00, 110.90},
    { "Blackfield Intersection", 1197.30, 1044.60, -89.00, 1277.00, 1163.30, 110.90},
    { "Blackfield Intersection", 1166.50, 795.00, -89.00, 1375.60, 1044.60, 110.90},
    { "Blackfield Intersection", 1277.00, 1044.60, -89.00, 1315.30, 1087.60, 110.90},
    { "Blackfield Intersection", 1375.60, 823.20, -89.00, 1457.30, 919.40, 110.90},
    { "Blueberry", 104.50, -220.10, 2.30, 349.60, 152.20, 200.00},
    { "Blueberry", 19.60, -404.10, 3.80, 349.60, -220.10, 200.00},
    { "Blueberry Acres", -319.60, -220.10, 0.00, 104.50, 293.30, 200.00},
    { "Caligula's Palace", 2087.30, 1543.20, -89.00, 2437.30, 1703.20, 110.90},
    { "Caligula's Palace", 2137.40, 1703.20, -89.00, 2437.30, 1783.20, 110.90},
    { "Calton Heights", -2274.10, 744.10, -6.10, -1982.30, 1358.90, 200.00},
    { "Chinatown", -2274.10, 578.30, -7.60, -2078.60, 744.10, 200.00},
    { "City Hall", -2867.80, 277.40, -9.10, -2593.40, 458.40, 200.00},
    { "Come-A-Lot", 2087.30, 943.20, -89.00, 2623.10, 1203.20, 110.90},
    { "Commerce", 1323.90, -1842.20, -89.00, 1701.90, -1722.20, 110.90},
    { "Commerce", 1323.90, -1722.20, -89.00, 1440.90, -1577.50, 110.90},
    { "Commerce", 1370.80, -1577.50, -89.00, 1463.90, -1384.90, 110.90},
    { "Commerce", 1463.90, -1577.50, -89.00, 1667.90, -1430.80, 110.90},
    { "Commerce", 1583.50, -1722.20, -89.00, 1758.90, -1577.50, 110.90},
    { "Commerce", 1667.90, -1577.50, -89.00, 1812.60, -1430.80, 110.90},
    { "Conference Center", 1046.10, -1804.20, -89.00, 1323.90, -1722.20, 110.90},
    { "Conference Center", 1073.20, -1842.20, -89.00, 1323.90, -1804.20, 110.90},
    { "Cranberry Station", -2007.80, 56.30, 0.00, -1922.00, 224.70, 100.00},
    { "Creek", 2749.90, 1937.20, -89.00, 2921.60, 2669.70, 110.90},
    { "Dillimore", 580.70, -674.80, -9.50, 861.00, -404.70, 200.00},
    { "Doherty", -2270.00, -324.10, -0.00, -1794.90, -222.50, 200.00},
    { "Doherty", -2173.00, -222.50, -0.00, -1794.90, 265.20, 200.00},
    { "Downtown", -1982.30, 744.10, -6.10, -1871.70, 1274.20, 200.00},
    { "Downtown", -1871.70, 1176.40, -4.50, -1620.30, 1274.20, 200.00},
    { "Downtown", -1700.00, 744.20, -6.10, -1580.00, 1176.50, 200.00},
    { "Downtown", -1580.00, 744.20, -6.10, -1499.80, 1025.90, 200.00},
    { "Downtown", -2078.60, 578.30, -7.60, -1499.80, 744.20, 200.00},
    { "Downtown", -1993.20, 265.20, -9.10, -1794.90, 578.30, 200.00},
    { "Downtown Los Santos", 1463.90, -1430.80, -89.00, 1724.70, -1290.80, 110.90},
    { "Downtown Los Santos", 1724.70, -1430.80, -89.00, 1812.60, -1250.90, 110.90},
    { "Downtown Los Santos", 1463.90, -1290.80, -89.00, 1724.70, -1150.80, 110.90},
    { "Downtown Los Santos", 1370.80, -1384.90, -89.00, 1463.90, -1170.80, 110.90},
    { "Downtown Los Santos", 1724.70, -1250.90, -89.00, 1812.60, -1150.80, 110.90},
    { "Downtown Los Santos", 1370.80, -1170.80, -89.00, 1463.90, -1130.80, 110.90},
    { "Downtown Los Santos", 1378.30, -1130.80, -89.00, 1463.90, -1026.30, 110.90},
    { "Downtown Los Santos", 1391.00, -1026.30, -89.00, 1463.90, -926.90, 110.90},
    { "Downtown Los Santos", 1507.50, -1385.20, 110.90, 1582.50, -1325.30, 335.90},
    { "East Beach", 2632.80, -1852.80, -89.00, 2959.30, -1668.10, 110.90},
    { "East Beach", 2632.80, -1668.10, -89.00, 2747.70, -1393.40, 110.90},
    { "East Beach", 2747.70, -1668.10, -89.00, 2959.30, -1498.60, 110.90},
    { "East Beach", 2747.70, -1498.60, -89.00, 2959.30, -1120.00, 110.90},
    { "East Los Santos", 2421.00, -1628.50, -89.00, 2632.80, -1454.30, 110.90},
    { "East Los Santos", 2222.50, -1628.50, -89.00, 2421.00, -1494.00, 110.90},
    { "East Los Santos", 2266.20, -1494.00, -89.00, 2381.60, -1372.00, 110.90},
    //gekürzt weil es zu lang war
    { "Yellow Bell Station", 1377.40, 2600.40, -21.90, 1492.40, 2687.30, 78.00}
    };
    enum zoneinfoo
    {
    zone_name[27],
    Float:zone_minx,
    Float:zone_miny,
    Float:zone_minz,
    Float:zone_maxx,
    Float:zone_maxy,
    Float:zone_maxz
    }
    new zoness[9][zoneinfoo] =
    {
    // Main Zones
    { "Los Santos", 44.60, -2892.90, -242.90, 2997.00, -768.00, 900.00},
    { "Las Venturas", 869.40, 596.30, -242.90, 2997.00, 2993.80, 900.00},
    { "Bone County", -480.50, 596.30, -242.90, 869.40, 2993.80, 900.00},
    { "Tierra Robada", -2997.40, 1659.60, -242.90, -480.50, 2993.80, 900.00},
    { "Tierra Robada", -1213.90, 596.30, -242.90, -480.50, 1659.60, 900.00},
    { "San Fierro", -2997.40, -1115.50, -242.90, -1213.90, 1659.60, 900.00},
    { "Red County", -1213.90, -768.00, -242.90, 2997.00, 596.30, 900.00},
    { "Flint County", -1213.90, -2892.90, -242.90, 44.60, -768.00, 900.00},
    { "Whetstone", -2997.40, -2892.90, -242.90, -1213.90, -1115.50, 900.00}
    };
    so hier die stocks
    stock Stadtteil(playerid)//Parken
    {
    new Float:X, Float:Y, Float:Z; //We use this to store player position
    GetPlayerPos(playerid, X, Y, Z); //Here we are storing the player position on the variables X, Y, and Z defined previously
    new zoneid = 0;
    for(; zoneid < sizeof(zones); zoneid++)
    {
    if (X <= zones[zoneid][zone_maxx] && X >= zones[zoneid][zone_minx] && Y <= zones[zoneid][zone_maxy] && Y >= zones[zoneid][zone_miny])
    {
    return zones[zoneid][zone_name];
    }
    }
    return 0;
    }
    stock stadtteil(playerid)//LParken
    {
    new Float:X, Float:Y, Float:Z; //We use this to store player position
    GetPlayerPos(playerid, X, Y, Z); //Here we are storing the player position on the variables X, Y, and Z defined previously
    new zoneid = 0;
    for(; zoneid < sizeof(zoness); zoneid++)
    {
    if (X <= zoness[zoneid][zone_maxx] && X >= zoness[zoneid][zone_minx] && Y <= zoness[zoneid][zone_maxy] && Y >= zoness[zoneid][zone_miny])
    {
    return zoness[zoneid][zone_name];
    }
    }
    return 0;
    }
    Kasnn mir wer helfen

  • Kann es sein das du vergisst das du den Stadtteil auch Updaten musst per Timer ?

  • ne es wird einfach geöffnet in einem format und als string gesendet

  • also wenn der dir das per Textdraw anzeigen soll oder sonstiges machs mit Timer ohne format ;)
    Der muss ja irgendwann nochmal checken wo du bist das geht nur mit timer :D

  • hier
    new teil = Stadtteil(playerid);
    new stadt = stadtteil(playerid);
    format(string, sizeof(string), "HQ: Begeben sie sich sofort in den Stadtteil: %s in:%s!",teil,stadt);
    es geht ja nur darum wo er jetzt in dem moment ist

  • Ehm

    format(string, sizeof(string), "HQ: Begeben sie sich sofort in den Stadtteil: %s!",zonename);

    ka habs ma so gemacht :D

  • ehm lol
    das kann nicht gehen^^
    da er ja playerid braucht um den jenigen ab zufragen und die function returned uonename als string^^