Checkpoints mit ENTER betreten und andere Checkpoints

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
  • Guten Abend Breadfish,
    und zwar habe ich hier ein Problem mit diesen Roten Checkpoints...
    Ich hätt das gerne so das diese Rote Checkpoints in einen weißen Pfeil umgewandelt werden.
    Ausserdem muss man in diesen Roten Checkpoints 5 Sekunden warten bis man das Interior betritt wie geht das das man dies mit ENTER betritt?
    Grüße.


    new MultipleEnter[MAX_PLAYERS];
    new CheckPointing[MAX_PLAYERS];
    new CheckPointShown[MAX_PLAYERS];
    new Float:CPs[][CPInfo] = {
    {2397.8496,-1898.0288,13.5469,0.0,0,"Los Santos",365.3238,-11.3925,1001.8516,350.3676,9,CLUCKIN_BELL_TEXT,5},
    {2244.4800,-1664.0601,15.4766,0.0,0,"Los Santos",207.7380,-109.0200,1005.1328,0.0,15,"Binco",0},
    //{2018.7988,1017.7705,996.8750,0.0,10,"San Fierro",-2721.0762,-320.6828,7.8438,0.0,0,"Casino",0},
    {919.0751,-1252.1527,16.2109,0.0,0,"Los Santos",322.197998,302.497985,999.148437,0.0,5,"O-Amt",0},
    //{2166.2642,-1671.6808,15.0740,0.0,0,"Los Santos",318.6689,1114.9237,1083.8828,0.0,5,"Crackhoehle",0},
    {2105.0862,-1806.3392,13.5547,0.0,0,"Los Santos",372.5499,-132.7637,1001.4922,12.1297,5,PIZZA_TEXT,5},
    //{2420.1899,-1509.8551,24.0000,0.0,0,"Los Santos",365.3238,-11.3925,1001.8516,350.3676,9,CLUCKIN_BELL_TEXT,5},
    //{1439.1178,-1665.7932,14.4905,0.0,0,"Los Santos",-25.9967,-187.6925,1003.5469,0.0,17,"24/7",0},//24/7 beim LSPD
    //{1480.9576,-1770.6440,18.7958,5.7813,0,"Los Santos",389.0762,173.7839,1008.3828,90.1640,3,"Stadthalle",1},
    //{1554.7671,-1674.8540,16.1953,84.0319,0,"Los Santos",239.2247,138.9361,1003.0234,359.2649,3,"3",0},
    {1456.9403,-1138.0343,23.9763,0.0,0,"Los Santos",161.4873,-96.6564,1001.8047,0.0,18,"ZIP",0},
    {1352.5164,-1758.8462,13.5078,0.0,0,"Los Santos",-26.5209,-57.5670,1003.5469,0.0,6,"24/7",0},
    {479.5239,-1538.5399,19.3803,0.0,0,"Los Santos",207.0899,-139.3603,1003.5078,0.0,3,"Pro Labs",0},
    //{811.6321,-1616.2617,13.5469,0.0,0,"Los Santos",363.3161,-74.7201,1001.5078,294.5566,10,BURGER_SHOT_TEXT,5},
    //{928.3706,-1352.8804,13.3438,0.0,0,"Los Santos",365.3238,-11.3925,1001.8516,350.3676,9,CLUCKIN_BELL_TEXT,5},
    {999.9166,-919.8427,42.3281,0.0,0,"Los Santos",-27.1335,-30.9769,1003.5573,0.0,4,"24/7",0},
    {1199.4064,-919.3890,43.1128,185.9694,0,"Los Santos",363.3161,-74.7201,1001.5078,294.5566,10,BURGER_SHOT_TEXT,5},
    {1315.3405,-898.1992,39.5781,0.0,0,"Los Santos",-30.7473,-91.1202,1003.5469,0.0,18,"24/7",0},
    {203.2688,-202.9428,1.5781,0.0,0,"Los Santos",372.5499,-132.7637,1001.4922,12.1297,5,PIZZA_TEXT,5},
    {1366.9592,248.6927,19.5669,0.0,0,"Los Santos",372.5499,-132.7637,1001.4922,12.1297,5,PIZZA_TEXT,5},
    {2332.8704,74.9582,26.6210,0.0,0,"Los Santos",372.5499,-132.7637,1001.4922,12.1297,5,PIZZA_TEXT,5},
    {2228.9443,-1722.0851,13.5625,0.0,0,"Los Santos",772.3428,-4.1084,1000.7292,0.0,5,"Fitness Studio",0},
    //{2020.4797,1007.0064,10.8203,0.0,0,"Las Venturas",2017.7937,1017.2736,996.8750,0.0,10,"Four Dragons Casino",0},
    //{2195.9150,1676.6544,12.3672,0.0,0,"Las Venturas",2233.8779,1713.0963,1012.0313,0.0,1,"Caligolas Casino",0},
    {2237.8357,1285.1769,10.8203,0.0,0,"Las Venturas",2217.0081,-1076.1227,1050.4844,0.0,1,"Pyramide",0},
    {1966.1448,1622.2742,12.8680,0.0,0,"Las Venturas",2237.6992,-1080.0991,1049.0234,0.0,2,"Piratenschiff",0},
    {2086.7605,2074.1689,11.0425,0.0,0,"Las Venturas",-100.2317,-24.1395,1000.7188,0.0,3,"Sex Shop",0},
    //{2103.3669,2228.6326,11.0234,0.0,0,"Las Venturas",365.3238,-11.3925,1001.8516,350.3676,9,CLUCKIN_BELL_TEXT,5},
    {2083.3455,2223.9021,11.0234,0.0,0,"Las Venturas",372.5499,-132.7637,1001.4922,12.1297,5,PIZZA_TEXT,5},
    {2247.8586,2397.4263,10.8203,0.0,0,"Las Venturas",-26.6043,-56.9045,1003.5469,0.0,6,"24/7",0},
    {2471.7610,2034.2963,11.0625,0.0,0,"Las Venturas",363.3161,-74.7201,1001.5078,294.5566,10,BURGER_SHOT_TEXT,5},
    {2366.0754,2071.2556,10.8203,0.0,0,"Las Venturas",363.3161,-74.7201,1001.5078,294.5566,10,BURGER_SHOT_TEXT,5},
    {2452.2141,2064.1470,10.8203,0.0,0,"Las Venturas",-26.5812,-57.0460,1003.5469,0.0,6,"24/7",0},
    {2373.9309,2167.3337,10.8248,0.0,0,"Las Venturas",2237.7859,-1079.9840,1049.0234,0.0,2,"Casino",0},
    {2351.8687,2532.3311,10.8203,0.0,0,"Las Venturas",372.5499,-132.7637,1001.4922,12.1297,5,PIZZA_TEXT,5},
    {2170.4055,2795.6697,10.8203,0.0,0,"Las Venturas",363.3161,-74.7201,1001.5078,294.5566,10,BURGER_SHOT_TEXT,5},
    {1872.5800,2071.7961,11.0625,0.0,0,"Las Venturas",363.3161,-74.7201,1001.5078,294.5566,10,BURGER_SHOT_TEXT,5},
    //{1462.2954,-1011.2205,26.8438,252.4664,0,"Los Santos",246.5083,107.8778,1003.2188,2.5901,10,"Los Santos Bank",1},//LS Bank
    //{2195.5840,1677.3838,12.3672,87.7661,0,"Las Venturas",2233.8860,1712.6942,1011.9067,179.4858,1,"Caligulas Casino",1},
    {2196.2441,1676.9348,12.3672,282.9798,0,"Las Venturas",2233.5127,1714.1404,1012.3544,191.3406,1,"Caligulas Casino",1},
    {2187.7959,1696.3616,20.3906,94.6388,0,"Las Venturas",2156.7397,1598.2126,999.9716,102.9798,1,"Caligulas Casino",1},
    {423.8142,2536.5027,16.1484,0.0,0,"Todesflughafen",420.4850,2535.5901,10.0000,0.0,10,"Todesflughafen",0},
    {693.5278,1966.8389,5.5391,0.0,0,"Wueste",1212.0168,-26.5722,1000.9531,0.0,3,"Bordell",0},
    {-1213.3425,1830.5543,41.9297,0.0,0,"Wueste",365.3238,-11.3925,1001.8516,350.3676,9,CLUCKIN_BELL_TEXT,5},
    //{172.7686,1176.8818,14.7578,0.0,0,"San Fierro",365.3238,-11.3925,1001.8516,350.3676,9,CLUCKIN_BELL_TEXT,5},
    {-2356.3796,1008.1703,50.8984,0.0,0,"San Fierro",363.3161,-74.7201,1001.5078,294.5566,10,BURGER_SHOT_TEXT,5},
    {-1912.0579,828.1326,35.2021,0.0,0,"San Fierro",363.3161,-74.7201,1001.5078,294.5566,10,BURGER_SHOT_TEXT,5},
    {-2336.4768,-166.8129,35.5547,0.0,0,"San Fierro",363.3161,-74.7201,1001.5078,294.5566,10,BURGER_SHOT_TEXT,5},
    //{-1815.9301,617.8619,35.1719,0.0,0,"San Fierro",365.3238,-11.3925,1001.8516,350.3676,9,CLUCKIN_BELL_TEXT,5},
    {-1721.3677,1359.0906,7.1853,0.0,0,"San Fierro",372.5499,-132.7637,1001.4922,12.1297,5,PIZZA_TEXT,5},
    {-1721.3677,1359.0906,7.1853,0.0,0,"San Fierro",372.5959,-132.1461,1001.4922,0.0,5,"Otto's Autohaus",0},
    {-1808.2806,945.4167,24.8906,51.5222,0,"San Fierro",372.4701,-132.8026,1001.4922,179.2293,5," ",0},
    {-1911.6249,828.5123,35.1719,137.0100,0,"San Fierro",363.2781,-74.7534,1001.5078,141.5494,10," ",0},
    {-2356.5381,1008.1564,50.8984,270.3487,0,"San Fierro",363.3535,-74.5933,1001.5078,110.7977,10," ",0},
    //{-1817.5028,618.2291,35.1719,358.6120,0,"San Fierro",364.9646,-10.9578,1001.8516,177.9759,9," ",0},
    {1572.0428,-1336.5353,16.4844,304.8029,0,"Los Santos",1548.5587,-1364.8901,326.2109,85.4907,0,"Star Tower",0},
    {1104.1304,-1449.0028,15.7969,180.2625,0,"Los Santos",-2240.468505,137.060440,1035.414062,0.2625,6,"Handyladen",0},
    {1699.9642,-1170.1368,23.8281,358.9950,0,"Los Santos",833.7824,7.3484,1004.1797,0.2625,3,"Uhrenladen",0}


    };
    //enterX,Y,Z,int,exittext,exitx,y,z,exitint,entertext,enterprice


    forward EnableCheckpointingAgain(playerid);
    forward Float:GetDistanceToInsideCheckpoint(playerid,checkpointid);
    forward Float:GetDistanceToOutsideCheckpoint(playerid,checkpointid);
    forward Float:GetDistanceToClosestInside(playerid);
    forward Float:GetDistanceToClosestOutside(playerid);



    if(GetDistanceToClosestInside(playerid) < 1.0) // Man geht wo raus
    {
    if(MultipleEnter[playerid] != -1)
    {
    cpid = MultipleEnter[playerid];
    }
    else
    {
    cpid = GetClosestInsideID(playerid);
    }
    SetPlayerPos(playerid,CPs[cpid][EnterX],CPs[cpid][EnterY],CPs[cpid][EnterZ]);
    if(CPs[cpid][EnterA] != 0.0) SetPlayerFacingAngle(playerid,CPs[cpid][EnterA]);
    SetPlayerInterior(playerid,CPs[cpid][EnterInt]);
    GameTextForPlayer(playerid,CPs[cpid][ExitingText],5000,3);


    PlayerInfo[playerid][pInt] = CPs[cpid][EnterInt];
    MultipleEnter[playerid] = -1;
    CheckPointing[playerid] = 0;
    SetTimerEx("EnableCheckpointingAgain",5000,0,"i",playerid);
    }
    else if(GetDistanceToClosestOutside(playerid) < 1.0) // Man geht wo rein
    {
    cpid = GetClosestOutsideID(playerid);
    SetPlayerPos(playerid,CPs[cpid][ExitX],CPs[cpid][ExitY],CPs[cpid][ExitZ]);
    if(CPs[cpid][ExitA] != 0.0) SetPlayerFacingAngle(playerid,CPs[cpid][ExitA]);
    SetPlayerInterior(playerid,CPs[cpid][ExitInt]);
    PlayerInfo[playerid][pInt] = CPs[cpid][ExitInt];
    GameTextForPlayer(playerid,CPs[cpid][EnteringText],5000,3);
    GivePlayerMoney(playerid,-CPs[cpid][EnteringPrice]);


    if( !strcmp(CPs[cpid][EnteringText],CLUCKIN_BELL_TEXT) ||
    !strcmp(CPs[cpid][EnteringText],PIZZA_TEXT) ||
    !strcmp(CPs[cpid][EnteringText],BURGER_SHOT_TEXT) ||
    !strcmp(CPs[cpid][EnteringText],"24/7"))
    {
    MultipleEnter[playerid] = cpid;
    }
    CheckPointing[playerid] = 0;
    SetTimerEx("EnableCheckpointingAgain",5000,0,"i",playerid);
    }


    return 1;
    }


    {
    for(new i; i<GetMaxPlayers(); i++)
    {
    if(IsPlayerConnected(i))
    {
    if(CheckPointShown[i] == 1)
    {
    DisablePlayerCheckpoint(i);
    CheckPointShown[i] = 0;
    }
    if(DisplayForPlayer(i))
    {
    if(GetDistanceToClosestInside(i) < GetDistanceToClosestOutside(i) && GetDistanceToClosestInside(i) < 15.0)
    {
    new cpid = GetClosestInsideID(i);
    SetPlayerCheckpoint(i,CPs[cpid][ExitX],CPs[cpid][ExitY],CPs[cpid][ExitZ],1.5);
    //CreatePickup(1318,23,CPs[cpid][ExitX],CPs[cpid][ExitY],CPs[cpid][ExitZ],-1);
    CheckPointShown[i] = 1;
    }
    if(GetDistanceToClosestOutside(i) < GetDistanceToClosestInside(i) && GetDistanceToClosestOutside(i) < 15.0)
    {
    new cpid = GetClosestOutsideID(i);
    SetPlayerCheckpoint(i,CPs[cpid][EnterX],CPs[cpid][EnterY],CPs[cpid][EnterZ],1.5);
    //CreatePickup(1318,23,CPs[cpid][EnterX],CPs[cpid][EnterY],CPs[cpid][EnterZ],-1);
    CheckPointShown[i] = 1;
    }
    }
    }
    }

    Mit freundlichen Grüßen,
    rndy

  • 1. bei "OnPlayerKeyStateChange" fragst du nach der Enter Taste ab.
    2. machst eine for-Schleife und fragst nach den Einzelnden Positionen ab.
    3. machst nur noch SetPlayerPos etc. schon haste es fertig

    Mit Freundlichen Grüßen
    Whitetiiger aka. Kaito-sensei
    P.s. Alle mit #IRONIE bestätigten Sätze von mir, sind als Ironie anzusehen.