Nitro geben im Pickup

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
  • Jetz hab ich das Problem meine Pickups spawn nicht hier Code


    new rep;
    new nitro;


    public OnGameModeInit()
    {

    SetGameModeText("Map");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddStaticVehicle(405,1783.19995117,-8985.40039062,2.50000000,0.00000000,98,68); //Sentinel
    CreateObject(8838,1795.69995117,-8982.70019531,0.00000000,0.00000000,0.00000000,0.00000000); //object(vgehshade01_lvs) (1)
    CreateObject(3458,1793.59997559,-8987.09960938,0.00000000,0.00000000,0.00000000,0.00000000); //object(vgncarshade1) (1)
    CreateObject(3458,1768.90002441,-8987.09960938,0.00000000,0.00000000,0.00000000,0.00000000); //object(vgncarshade1) (2)
    CreateObject(3458,1831.90002441,-8987.09960938,0.00000000,0.00000000,0.00000000,0.00000000); //object(vgncarshade1) (3)
    CreateObject(1407,1851.90002441,-8987.09960938,2.29999995,0.00000000,0.00000000,270.00000000); //object(dyn_f_r_wood_1) (1)
    CreateObject(1407,1849.40002441,-8989.50000000,2.29999995,0.00000000,0.00000000,0.00000000); //object(dyn_f_r_wood_1) (2)
    CreateObject(1407,1849.59997559,-8984.59960938,2.29999995,0.00000000,0.00000000,0.00000000); //object(dyn_f_r_wood_1) (3)
    CreateObject(1407,1751.00000000,-8989.59960938,2.29999995,0.00000000,0.00000000,0.00000000); //object(dyn_f_r_wood_1) (4)
    CreateObject(1407,1751.00000000,-8984.59960938,2.29999995,0.00000000,0.00000000,0.00000000); //object(dyn_f_r_wood_1) (5)
    CreateObject(1407,1748.80004883,-8987.00000000,2.29999995,0.00000000,0.00000000,270.00000000); //object(dyn_f_r_wood_1) (6)
    CreateObject(3458,1801.00000000,-8999.50000000,0.00000000,0.00000000,0.00000000,318.00000000); //object(vgncarshade1) (4)
    CreateObject(3458,1796.30004883,-8997.50000000,0.00000000,0.00000000,0.00000000,34.00000000); //object(vgncarshade1) (5)
    CreateObject(3458,1796.59997559,-9013.09960938,0.00000000,0.00000000,0.00000000,354.00000000); //object(vgncarshade1) (6)
    CreateObject(3458,1760.40002441,-9008.70019531,0.00000000,0.00000000,0.00000000,0.00000000); //object(vgncarshade1) (7)
    CreateObject(3458,1752.80004883,-9026.79980469,0.00000000,0.00000000,0.00000000,300.00000000); //object(vgncarshade1) (8)
    CreateObject(3458,1780.50000000,-9044.40039062,0.00000000,0.00000000,0.00000000,0.00000000); //object(vgncarshade1) (9)
    CreateObject(3458,1819.69995117,-9044.50000000,0.00000000,0.00000000,0.00000000,0.00000000); //object(vgncarshade1) (10)
    CreateObject(8838,1804.00000000,-9047.79980469,0.00000000,0.00000000,0.00000000,0.00000000); //object(vgehshade01_lvs) (2)
    CreateObject(3458,1840.19995117,-9044.50000000,0.00000000,0.00000000,328.00000000,0.00000000); //object(vgncarshade1) (11)
    CreateObject(1407,1841.00000000,-9041.79980469,2.90000010,0.00000000,322.00000000,0.00000000); //object(dyn_f_r_wood_1) (7)
    CreateObject(1407,1844.59997559,-9042.00000000,5.09999990,0.00000000,324.00000000,0.00000000); //object(dyn_f_r_wood_1) (8)
    CreateObject(1407,1848.19995117,-9042.09960938,7.59999990,0.00000000,324.00000000,358.00000000); //object(dyn_f_r_wood_1) (9)
    CreateObject(1407,1841.40002441,-9047.00000000,3.40000010,0.00000000,328.00000000,0.00000000); //object(dyn_f_r_wood_1) (10)
    CreateObject(1407,1845.30004883,-9047.00000000,5.80000019,0.00000000,328.00000000,2.00000000); //object(dyn_f_r_wood_1) (11)
    CreateObject(1407,1848.30004883,-9047.00000000,7.59999990,0.00000000,334.00000000,6.00000000); //object(dyn_f_r_wood_1) (12)
    CreateObject(8838,1775.69995117,-9047.79980469,0.00000000,0.00000000,0.00000000,0.00000000); //object(vgehshade01_lvs) (3)
    CreateObject(8838,1858.80004883,-9035.50000000,10.60000038,0.00000000,2.00000000,270.00000000); //object(vgehshade01_lvs) (4)
    CreateObject(3458,1842.69995117,-9021.59960938,0.00000000,0.00000000,328.00000000,358.00000000); //object(vgncarshade1) (12)
    CreateObject(3458,1827.40002441,-9017.20019531,0.00000000,0.00000000,0.00000000,344.00000000); //object(vgncarshade1) (13)
    rep = CreatePickup(1239,1,1858.8531,-9021.0557,13.6359,1);
    nitro=CreatePickup(1239,1,1859.0742,-9049.2002,12.6531,1);
    Create3DTextLabel("{#00FF1E}[{#000000}Repair{#00FF1E}]", 0x008080FF, 1858.8531,-9021.0557,13.6359,1,0);
    return 1;
    }


    OnPlayerPickup


    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    if(pickupid == rep)
    {
    RepairVehicle(GetPlayerVehicleID(playerid));
    return 1;
    }

    if(pickupid==nitro)
    {
    AddVehicleComponent(1010);
    return 1;
    }
    return 1;
    }

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • InternetInk aka Benjamin


    Da gibt es ein Problem, wenn man mit einem Auto durch ein Pickup fährt, wird die Funktion OnPlayerPickUpPickup nicht aufgerufen ;)


    Aus diesem Grund hatte ich auch damals in dieser Include eine Funktion gebaut die GetPickupPos heißt, muss man halt noch mit einer Schleife arbeiten, aber anders funktioniert das meiner Erfahrung nach nicht ;)


    mfg. :thumbup:

    ast2ufdyxkb1.png


    Leute, lernt scripten und versucht mal lieber etwas selber zu schreiben, als es aus einem GF zu kopieren. :S

  • Das ist nicht wahr, wenn du als Pickup Type beim erstellen 14 angibst (Pickupable, but only when in a vehicle.) funktioniert das ohne Probleme.
    Da braucht man keine extra Schleife oder sowas.


    8| Ich hätte mir mal die types durchlesen sollen xD


    Danke wieder was gelernt :love:


    mfg. :thumbup:

    ast2ufdyxkb1.png


    Leute, lernt scripten und versucht mal lieber etwas selber zu schreiben, als es aus einem GF zu kopieren. :S

  • if(IsPlayerInRangeOfPoint(playerid, 5,x,y,z))
    {
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFF0000AA,"Du bist in keinem Fahrzeug!");

    if(GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),GetVehicleComponentType(1010)) != 1010)


    {




    AddVehicleComponent(GetPlayerVehicleID(playerid),1010);




    PlayerPlaySound(playerid,1133,0.0,0.0,0.0);


    }
    }