Enter/Exit

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 mal was gescriptet aber es will nicht funktionieren
    in manchen Interiors geht es manchmal auch net z.b Oamt geht und Gangs nicht ?


    enum InteriorEnum
    {
    F_ID,
    F_ID2,
    Float:enterX,
    Float:enterY,
    Float:enterZ,
    Worldid,
    Float:exitX,
    Float:exitY,
    Float:exitZ,
    Float:exitR,
    InteriorID,
    InteriorVirtualWorld
    }


    new Intenum[][InteriorEnum] =
    {
    {-1,-1,1209.1383,-1752.1898,13.5935,0,387.8430,173.8047,1008.3828,91.6419,3,4},//Stadthalle rein
    {-1,-1,390.3139,173.7579,1008.3828,4,1207.6248,-1750.0918,13.5932,38.1484,0,0},//Stadthalle raus
    {-1,-1,1368.4120,-1279.7968,13.5469,0,286.3157,-39.8753,1001.5156,304.2614,1,6},//Ammuls rein
    {-1,-1,285.3690,-41.5567,1001.5156,6,1366.2113,-1279.6046,13.5469,90.1989,0,0},//Ammuls raus
    {-1,-1,1554.7555,-1675.6046,16.1953,0,246.7961,64.2037,1003.6406,358.5329,6,1},//LSPD rein
    {-1,-1,246.7832,62.7584,1003.6406,1,1552.4957,-1675.3972,16.1953,89.6651,0,0},//LSPD raus
    {1,2,242.2522,66.3329,1003.6406,1,1555.8984,-1675.5177,28.3955,90.8591,0,0},//LSPD Dach rauf
    {1,2,1557.7338,-1675.5936,28.3955,0,243.7930,66.2696,1003.6406,269.1373,6,1},//LSPD Dach raus
    {-1,-1,1524.6013,-1677.8462,6.2188,0,246.3997,86.4646,1003.6406,179.1384,6,1},//LSPD Garage enter
    {1,2,246.4084,88.0089,1003.6406,1,1526.3655,-1677.6136,5.8906,272.5833,0,0},//LSPD Garage exit
    {-1,-1,461.0550,-1500.9313,31.0585,0,225.0117,-8.1936,1002.210,89.6216,5,7},//Victim Enter
    {-1,-1,227.4967,-8.1671,1002.2109,7,458.8222,-1501.3805,31.0379,100.4981,0,0},//Victim Exit
    {3,3,-2655.1060,639.4778,14.4531,0,365.3935,162.2574,1019.9844,91.0286,3,2},//Medic enter
    {3,3,367.0864,162.2996,1019.9844,2,-2654.9861,637.0780,14.4531,180.3984,0,0},//Medic exit
    {3,3,350.0323,178.0524,1019.9844,2,-2628.4248,639.7186,66.0938,1.5924,0,0},//Medic Dach enter
    {3,3,-2628.4531,636.9377,66.0938,0,350.1810,176.4289,1019.9844,171.3776,3,2},//Medic Dach exit
    {4,4,-1088.0608,-602.1430,32.0078,0,366.1374,162.2436,1025.7891,89.2698,3,5},//Oamt enter
    {4,4,367.9101,162.2453,1025.7891,5,-1088.0706,-603.5984,32.0078,178.2361,0,0},//Oamt exit
    {12,12,2481.4614,1525.4645,11.7625,0,-2170.3298,637.1323,1052.3750,176.5777,1,8},//LCN enter
    {12,12,-2170.3142,639.3703,1052.3750,8,2482.8760,1527.2314,11.3001,320.3426,0,0},//LCN exit
    {13,13,1455.4449,750.9749,11.023,0,2807.5840,-1172.6940,1025.5703,2.3869,8,9},//Yakuza enter
    {13,13,2807.6399,-1174.4387,1025.5703,9,1453.4940,750.7717,11.0234,90.9039,0,0},//Yakuza exit
    {15,15,-688.1736,944.3516,13.6328,0,-688.0081,941.2239,13.6328,181.6686,0,10},//Hitman enter
    {15,15,-688.0631,942.7572,13.6328,10,-688.1256,945.7512,13.0313,358.2399,0,0},//Hitman exit
    {5,5,-1754.2233,963.4894,24.8828,0,366.1374,162.2436,1025.7891,89.2698,3,11},//News enter
    {5,5,367.9101,162.2453,1025.7891,11,-1754.1199,961.5027,24.8828,179.0732,0,0},//News exit
    {-1,-1,-2026.5018,-101.8712,35.1641,0,-2027.8820,-105.1434,1035.1719,128.9044,3,12},//Fahrschule hinten Enter
    {-1,-1,-2026.9750,-103.7320,1035.1719,12,-2026.6042,-100.4634,35.1641,359.4869,0,0},//Fahrschule hinten exit
    {-1,-1,-2029.8097,-120.5256,35.1693,0,-2029.7268,-117.9971,1035.1719,0.3418,3,12},//Fahrschule enter
    {-1,-1,-2029.6772,-119.4856,1035.1719,12,-2029.8020,-121.9702,35.1862,177.7431,0,0},//Fahrschule exit
    {7,7,2495.2678,-1691.1385,14.7656,0,2807.5840,-1172.6940,1025.5703,2.3869,8,14},//Grove enter
    {7,7,2807.6399,-1174.4387,1025.5703,14,2495.2627,-1689.3993,14.4068,0.0050,0,0},//Groove exit
    {8,8,2334.7551,-1234.5438,27.9766,0,2807.5840,-1172.6940,1025.5703,2.3869,8,15},//Ballas enter
    {8,8,2807.6399,-1174.4387,1025.5703,15,2334.5422,-1233.1584,27.9766,359.7436,0,0},//Ballas exit
    {9,9,2787.0747,-1926.0601,13.5469,0,2807.5840,-1172.6940,1025.5703,2.3869,8,16},//Vagos enter
    {9,9,2807.6399,-1174.4387,1025.5703,16,2785.1306,-1926.1780,13.5469,92.7006,0,0},//Vagos exit
    {10,10,1684.7639,-2098.2534,13.8343,0,2807.5840,-1172.6940,1025.5703,2.3869,8,17},//Atzen enter
    {10,10,2807.6399,-1174.4387,1025.5703,17,1684.8600,-2099.8435,13.8343,181.6020,0,0},//Atzen exit
    {11,11,-2719.4253,-319.1740,7.8438,0,2807.5840,-1172.6940,1025.5703,2.3869,8,18},//S.F Rifa enter
    {11,11,2807.6399,-1174.4387,1025.5703,18,-2720.5828,-318.0673,7.8438,43.9687,0,0},//S.F Rifa exit
    {14,14,-553.4443,2593.7375,53.9348,0,2807.5840,-1172.6940,1025.5703,2.3869,8,19},//Russen enter
    {14,14,2807.6399,-1174.4387,1025.5703,19,-551.5718,2593.8630,53.9348,267.9214,0,0},//Russen exit
    {1,2,327.8879,-1512.2167,36.0325,0,354.3948,198.4012,1008.3828,359.2174,3,20},//FBI enter
    {1,2,354.5194,197.0079,1008.3828,20,329.0241,-1512.9985,36.0391,227.9780,0,0},//FBI exit
    {1,2,358.1564,217.1917,1008.3828,20,314.7209,-1513.0677,24.9219,57.2079,0,0},//FBI Garage enter
    {1,2,316.0956,-1513.8643,24.9219,0,358.2133,215.8641,1008.3828,176.2094,3,20},//FBI Garage exit
    {1,2,368.3695,209.4724,1008.3828,20,314.0398,-1512.2876,76.5362,237.3738,0,0},//FBI Dach enter
    {1,2,312.5084,-1511.2485,76.5362,0,366.1075,209.2095,1008.3828,92.2244,3,20},//FBI Dach exit
    {-1,-1,-2177.7827,-42.3733,35.3125,0,285.6972,-84.9504,1001.5156,359.8216,4,21},//Ammu Sf enter
    {-1,-1,285.8797,-86.4171,1001.5229,21,-2175.8015,-42.3320,35.3125,270.7113,0,0},//Ammu Sf exit
    {-1,-1,1462.3312,-1010.5780,26.8438,0,2574.8757,-1300.4349,1060.9844,90.0065,2,22},//Bank enter
    {-1,-1,2576.5615,-1300.4127,1060.9844,22,1462.4005,-1012.4014,26.8438,178.2988,0,0},//Bank exit
    {-1,-1,2551.1729,-1289.6523,1060.9844,22,2147.8127,1602.4391,1006.1677,179.2839,1,23},//Tresor enter
    {-1,-1,2147.7986,1603.8915,1006.1677,23,2551.0854,-1287.7383,1060.9844,2.3529,2,22},//Tresor exit
    {-1,-1,605.5132,710.5988,13.8672,0,246.2650,109.3832,1003.2188,358.9041,10,24},//SFPD enter
    {-1,-1,246.4247,107.5022,1003.2188,24,-1605.6782,712.0378,13.8672,3.7109,0,0},//SFPD exit
    {1,2,215.6287,126.1962,1003.2188,24,-1606.4789,674.3116,-5.2422,1.4138,0,0},//SFPD Garage enter
    {1,2,-1606.2856,672.4736,-5.2422,0,215.5596,123.3313,1003.2188,180.8289,10,24},//SFPD Garage exit
    {-1,-1,593.5630,-1250.7711,18.2465,0,2306.9214,-16.0438,26.7496,269.7687,0,25},//Arbeitsamt enter
    {-1,-1,2304.9641,-16.2280,26.7422,25,592.7808,-1249.0540,18.1760,21.5243,0,0},//Arbeitsamt exit
    {-1,-1,2017.3516,1912.9615,12.3301,0,-795.0436,491.6425,1376.1953,359.0258,1,26},//Vip enter
    {-1,-1,-794.9525,489.4478,1376.1953,26,2019.2498,1913.0087,12.3113,271.0164,0,0},//Vip exit
    {-1,-1,-787.2675,488.8861,1376.1953,26,2010.6877,1849.8282,27.4609,291.6132,0,0},//Vip Dach enter
    {-1,-1,2008.2711,1848.5980,27.4609,0,-783.8599,489.0430,1376.1953,273.7036,1,26}//Vip Dach exit
    };


    for(new i=0; i<sizeof(Intenum); i++)
    {
    CreatePickup(1559,1,Intenum[i][enterX],Intenum[i][enterY],Intenum[i][enterZ],Intenum[i][Worldid]);
    }


    for(new i=0; i<sizeof(Intenum); i++)
    {
    if(IsPlayerInRangeOfPoint(playerid,2,Intenum[i][enterX],Intenum[i][enterY],Intenum[i][enterZ]))
    {
    if(sInfo[playerid][fraktion] == Intenum[i][F_ID] || Intenum[i][F_ID] == -1)
    {
    if(GetPlayerVirtualWorld(playerid) == Intenum[i][Worldid])
    {
    SetPlayerPos(playerid,Intenum[i][exitX],Intenum[i][exitY],Intenum[i][exitZ]);
    SetPlayerFacingAngle(playerid,Intenum[i][exitR]);
    SetPlayerInterior(playerid,Intenum[i][InteriorID]);
    SetPlayerVirtualWorld(playerid,Intenum[i][InteriorVirtualWorld]);
    SetCameraBehindPlayer(playerid);
    }
    }
    else if(sInfo[playerid][fraktion] == Intenum[i][F_ID2] || Intenum[i][F_ID2] == -1)
    {
    if(GetPlayerVirtualWorld(playerid) == Intenum[i][Worldid])
    {
    SetPlayerPos(playerid,Intenum[i][exitX],Intenum[i][exitY],Intenum[i][exitZ]);
    SetPlayerFacingAngle(playerid,Intenum[i][exitR]);
    SetPlayerInterior(playerid,Intenum[i][InteriorID]);
    SetPlayerVirtualWorld(playerid,Intenum[i][InteriorVirtualWorld]);
    SetCameraBehindPlayer(playerid);
    }
    }
    else
    {
    printf("%i Playerd,)",sInfo[playerid][fraktion]);
    printf("%i Inter,)",Intenum[i][F_ID]);
    SendClientMessage(playerid,ROT,"Du hast hier Kein eintritt!");
    return 1;
    }
    }
    }

  • Dann debugge es bitte so und poste dann was im Server Log steht, wenn du dort versuchst rein zu gehen.
    for(new i=0; i<sizeof(Intenum); i++)
    {
    printf("i: %d", i);
    if(IsPlayerInRangeOfPoint(playerid,2,Intenum[i][enterX],Intenum[i][enterY],Intenum[i][enterZ]))
    {
    printf("In Range. Fraktion: %d / F_ID: %d", sInfo[playerid][fraktion], Intenum[i][F_ID]);
    if(sInfo[playerid][fraktion] == Intenum[i][F_ID] || Intenum[i][F_ID] == -1)
    {
    printf("pWorld: %d / iWorld: %d", GetPlayerVirtualWorld(playerid), Intenum[i][Worldid]);
    if(GetPlayerVirtualWorld(playerid) == Intenum[i][Worldid])
    {
    printf("Setze Position");
    SetPlayerPos(playerid,Intenum[i][exitX],Intenum[i][exitY],Intenum[i][exitZ]);
    SetPlayerFacingAngle(playerid,Intenum[i][exitR]);
    SetPlayerInterior(playerid,Intenum[i][InteriorID]);
    SetPlayerVirtualWorld(playerid,Intenum[i][InteriorVirtualWorld]);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    }
    else if(sInfo[playerid][fraktion] == Intenum[i][F_ID2] || Intenum[i][F_ID2] == -1)
    {
    printf("pWorld: %d / iWorld: %d", GetPlayerVirtualWorld(playerid), Intenum[i][Worldid]);
    if(GetPlayerVirtualWorld(playerid) == Intenum[i][Worldid])
    {
    printf("Setze Position");
    SetPlayerPos(playerid,Intenum[i][exitX],Intenum[i][exitY],Intenum[i][exitZ]);
    SetPlayerFacingAngle(playerid,Intenum[i][exitR]);
    SetPlayerInterior(playerid,Intenum[i][InteriorID]);
    SetPlayerVirtualWorld(playerid,Intenum[i][InteriorVirtualWorld]);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    }
    else
    {
    printf("Kein Eintritt.");
    SendClientMessage(playerid,ROT,"Du hast hier Kein eintritt!");
    return 1;
    }
    }
    }

  • [22/05/2015 15:03:54] i: 0
    [22/05/2015 15:03:54] i: 1
    [22/05/2015 15:03:54] i: 2
    [22/05/2015 15:03:54] i: 3
    [22/05/2015 15:03:54] i: 4
    [22/05/2015 15:03:54] i: 5
    [22/05/2015 15:03:54] i: 6
    [22/05/2015 15:03:54] i: 7
    [22/05/2015 15:03:54] i: 8
    [22/05/2015 15:03:54] i: 9
    [22/05/2015 15:03:54] i: 10
    [22/05/2015 15:03:54] i: 11
    [22/05/2015 15:03:54] i: 12
    [22/05/2015 15:03:54] i: 13
    [22/05/2015 15:03:54] i: 14
    [22/05/2015 15:03:54] i: 15
    [22/05/2015 15:03:54] i: 16
    [22/05/2015 15:03:54] i: 17
    [22/05/2015 15:03:54] i: 18
    [22/05/2015 15:03:54] i: 19
    [22/05/2015 15:03:54] i: 20
    [22/05/2015 15:03:54] i: 21
    [22/05/2015 15:03:54] In Range. Fraktion: 7 / F_ID: 13 // Bin Im GS Interrior und GS Leader FID = 13 == Yakuza
    [22/05/2015 15:03:54] Kein Eintritt.
    [22/05/2015 15:04:11] i: 0
    [22/05/2015 15:04:11] i: 1
    [22/05/2015 15:04:11] i: 2
    [22/05/2015 15:04:11] i: 3
    [22/05/2015 15:04:11] i: 4
    [22/05/2015 15:04:11] i: 5
    [22/05/2015 15:04:11] i: 6
    [22/05/2015 15:04:11] i: 7
    [22/05/2015 15:04:11] i: 8
    [22/05/2015 15:04:11] i: 9
    [22/05/2015 15:04:11] i: 10
    [22/05/2015 15:04:11] i: 11
    [22/05/2015 15:04:11] i: 12
    [22/05/2015 15:04:11] i: 13
    [22/05/2015 15:04:11] i: 14
    [22/05/2015 15:04:11] i: 15
    [22/05/2015 15:04:11] i: 16
    [22/05/2015 15:04:11] i: 17
    [22/05/2015 15:04:11] i: 18
    [22/05/2015 15:04:11] i: 19
    [22/05/2015 15:04:11] i: 20
    [22/05/2015 15:04:11] i: 21
    [22/05/2015 15:04:11] In Range. Fraktion: 13 / F_ID: 13
    [22/05/2015 15:04:11] pWorld: 14 / iWorld: 9
    [22/05/2015 15:04:11] i: 22
    [22/05/2015 15:04:11] i: 23
    [22/05/2015 15:04:11] i: 24
    [22/05/2015 15:04:11] i: 25
    [22/05/2015 15:04:11] i: 26
    [22/05/2015 15:04:11] i: 27
    [22/05/2015 15:04:11] i: 28
    [22/05/2015 15:04:11] i: 29
    [22/05/2015 15:04:11] i: 30
    [22/05/2015 15:04:11] i: 31
    [22/05/2015 15:04:11] In Range. Fraktion: 13 / F_ID: 7 Habe mich Yakuza gemacht jetze ist FID 7 ????
    [22/05/2015 15:04:11] Kein Eintritt.

  • Okey, teste es mal so:
    for(new i=0; i<sizeof(Intenum); i++)
    {
    printf("i: %d", i);
    if(IsPlayerInRangeOfPoint(playerid,2,Intenum[i][enterX],Intenum[i][enterY],Intenum[i][enterZ]))
    {
    printf("In Range. Fraktion: %d / F_ID: %d / F_ID2: %d / pWorld: %d / iWorld: %d", sInfo[playerid][fraktion], Intenum[i][F_ID], Intenum[i][F_ID2], GetPlayerVirtualWorld(playerid), Intenum[i][Worldid]);
    if(sInfo[playerid][fraktion] == Intenum[i][F_ID] || Intenum[i][F_ID] == -1)
    {
    printf("1pWorld: %d / iWorld: %d", GetPlayerVirtualWorld(playerid), Intenum[i][Worldid]);
    if(GetPlayerVirtualWorld(playerid) == Intenum[i][Worldid])
    {
    printf("Setze Position");
    SetPlayerPos(playerid,Intenum[i][exitX],Intenum[i][exitY],Intenum[i][exitZ]);
    SetPlayerFacingAngle(playerid,Intenum[i][exitR]);
    SetPlayerInterior(playerid,Intenum[i][InteriorID]);
    SetPlayerVirtualWorld(playerid,Intenum[i][InteriorVirtualWorld]);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    }
    else if(sInfo[playerid][fraktion] == Intenum[i][F_ID2] || Intenum[i][F_ID2] == -1)
    {
    printf("2pWorld: %d / iWorld: %d", GetPlayerVirtualWorld(playerid), Intenum[i][Worldid]);
    if(GetPlayerVirtualWorld(playerid) == Intenum[i][Worldid])
    {
    printf("Setze Position");
    SetPlayerPos(playerid,Intenum[i][exitX],Intenum[i][exitY],Intenum[i][exitZ]);
    SetPlayerFacingAngle(playerid,Intenum[i][exitR]);
    SetPlayerInterior(playerid,Intenum[i][InteriorID]);
    SetPlayerVirtualWorld(playerid,Intenum[i][InteriorVirtualWorld]);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    }
    else if(GetPlayerVirtualWorld(playerid) == Intenum[i][Worldid])
    {
    printf("Kein Eintritt.");
    SendClientMessage(playerid,ROT,"Du hast hier Kein eintritt!");
    return 1;
    }
    }
    }
    Wenn es nicht geht, poste was im Log steht.