Beiträge von Marschl

    Ich möchte, dass wenn der Spieler in irgendeiner Art und weiße das Auto Verlässt, die Textdraws gelöscht werden.


    Wo liegt hier der Fehler?

    Funktioniert immer noch nicht :(


    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    if(newstate == PLAYER_STATE_DRIVER)
    {
    SendClientMessage(playerid, COLOR_GELB, "Info: "HTML_WEIS"Du kannst das Fahrzeug "HTML_GELB"mit der Taste 2 oder mit /motor "HTML_WEIS"starten!");


    new tcn[24];
    new mID = GetVehicleModel(GetPlayerVehicleID(playerid));
    format(tcn, sizeof(tcn), "%s", VehicleNames[mID]);
    PlayerTextDrawSetString(playerid, Tacho8[playerid], tcn);


    PlayerTextDrawShow(playerid, Tacho1[playerid]);
    PlayerTextDrawShow(playerid, Tacho2[playerid]);
    PlayerTextDrawShow(playerid, Tacho3[playerid]);
    PlayerTextDrawShow(playerid, Tacho4[playerid]);
    PlayerTextDrawShow(playerid, Tacho5[playerid]);
    PlayerTextDrawShow(playerid, Tacho6[playerid]);
    PlayerTextDrawShow(playerid, Tacho7[playerid]);
    PlayerTextDrawShow(playerid, Tacho8[playerid]);
    PlayerTextDrawShow(playerid, Tacho9[playerid]);
    PlayerTextDrawShow(playerid, Tacho10[playerid]);
    PlayerTextDrawShow(playerid, Tacho11[playerid]);
    PlayerTextDrawShow(playerid, Tacho12[playerid]);
    }
    return 1;
    }

    Funktioniert immernoch nicht :(


    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
    SendClientMessage(playerid, COLOR_GELB, "Info: "HTML_WEIS"Du kannst das Fahrzeug "HTML_GELB"mit der Taste 2 oder mit /motor "HTML_WEIS"starten!");


    new tachocarname[24];
    new vehicleid = GetPlayerVehicleID(playerid);
    format(tachocarname, sizeof(tachocarname), "%s", vehName[vehicleid]);
    PlayerTextDrawSetString(playerid, Tacho8[playerid], tachocarname);


    PlayerTextDrawShow(playerid, Tacho1[playerid]);
    PlayerTextDrawShow(playerid, Tacho2[playerid]);
    PlayerTextDrawShow(playerid, Tacho3[playerid]);
    PlayerTextDrawShow(playerid, Tacho4[playerid]);
    PlayerTextDrawShow(playerid, Tacho5[playerid]);
    PlayerTextDrawShow(playerid, Tacho6[playerid]);
    PlayerTextDrawShow(playerid, Tacho7[playerid]);
    PlayerTextDrawShow(playerid, Tacho8[playerid]);
    PlayerTextDrawShow(playerid, Tacho9[playerid]);
    PlayerTextDrawShow(playerid, Tacho10[playerid]);
    PlayerTextDrawShow(playerid, Tacho11[playerid]);
    PlayerTextDrawShow(playerid, Tacho12[playerid]);
    }
    return 1;
    }

    Oki danke :)


    Noch eine Frage warum werden die Textdraws nicht beim einsteigen erstellt?


    public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
    {
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
    SendClientMessage(playerid, COLOR_GELB, "Info: "HTML_WEIS"Du kannst das Fahrzeug "HTML_GELB"mit der Taste 2 oder mit /motor "HTML_WEIS"starten!");
    PlayerTextDrawShow(playerid, Tacho1[playerid]);
    PlayerTextDrawShow(playerid, Tacho2[playerid]);
    PlayerTextDrawShow(playerid, Tacho3[playerid]);
    PlayerTextDrawShow(playerid, Tacho4[playerid]);
    PlayerTextDrawShow(playerid, Tacho5[playerid]);
    PlayerTextDrawShow(playerid, Tacho6[playerid]);
    PlayerTextDrawShow(playerid, Tacho7[playerid]);
    PlayerTextDrawShow(playerid, Tacho8[playerid]);
    PlayerTextDrawShow(playerid, Tacho9[playerid]);
    PlayerTextDrawShow(playerid, Tacho10[playerid]);
    PlayerTextDrawShow(playerid, Tacho11[playerid]);
    PlayerTextDrawShow(playerid, Tacho12[playerid]);
    }
    return 1;
    }

    Danke @Canna


    wie kann ich bei der Uhrzeit noch Sekunden ranhängen?


    forward UpdateUhrzeit(playerid);
    public UpdateUhrzeit(playerid)
    {
    new Hour,Minute,Sec,String[256];
    gettime(Hour,Minute,Sec);
    if(Hour<9 && Minute<9){format(String,sizeof(String),"0%d:0%d",Hour,Minute);}
    else if(Hour>9 && Minute<9){format(String,sizeof(String),"%d:0%d",Hour,Minute);}
    else if(Hour<9 && Minute>9){format(String,sizeof(String),"0%d:%d",Hour,Minute);}
    else{format(String,sizeof(String),"%d:%d",Hour,Minute);}
    PlayerTextDrawSetString(playerid, TimeDraw[playerid],String);
    SetWorldTime(Hour);
    return 1;
    }

    Hallo,
    wie kann ich in mein Textdraw dass aktuelle Datum eintragen?


    Textdraw0[playerid] = CreatePlayerTextDraw(playerid, 559.000000, 6.000000, " ");
    PlayerTextDrawBackgroundColor(playerid, Textdraw0[playerid], 255);
    PlayerTextDrawFont(playerid, Textdraw0[playerid], 2);
    PlayerTextDrawLetterSize(playerid, Textdraw0[playerid], 0.270000, 1.200000);
    PlayerTextDrawColor(playerid, Textdraw0[playerid], -16776961);
    PlayerTextDrawSetOutline(playerid, Textdraw0[playerid], 1);
    PlayerTextDrawSetProportional(playerid, Textdraw0[playerid], 1);
    PlayerTextDrawSetSelectable(playerid, Textdraw0[playerid], 0);

    Hallöchen, wenn ich auf Supcar löschen gehe, spawnt ein Maverick. Ich finde mein Fehler irgendwie nicht :(


    ocmd:supcar(playerid, params[])
    {
    if(sI[playerid][pAdmin] < 1)return SendClientMessage(playerid, COLOR_ROT, ">> Du bist kein Admin");
    {
    ShowPlayerDialog(playerid, D_ADM_SUPCAR, DIALOG_STYLE_LIST, ""SERVER_HTML""SERVER_TAG""HTML_WEIS": Supcar", "Sultan \nInfernus \nNRG \nMaverick \n"HTML_ROT"SupCar löschen", "Spawnen", "Zurück");
    }
    return 1;
    }


    if(dialogid == D_ADM_SUPCAR)
    {
    if(response)
    {
    new Float:a_x, Float:a_y, Float:a_z, Float:a_r;
    GetPlayerFacingAngle(playerid, a_r);
    GetPlayerPos(playerid, a_x, a_y, a_z);
    switch(listitem)
    {
    case 0:
    {
    if(sI[playerid][pSupCar] == true)return ShowPlayerDialog(playerid, D_ADM_SUPCAR, DIALOG_STYLE_LIST, ""SERVER_HTML""SERVER_TAG""HTML_WEIS": Supcar", "Sultan \nInfernus \nNRG \nMaverick \n"HTML_ROT"SupCar löschen", "Spawnen", "Zurück");
    supCar[playerid] = CreateVehicle(560, a_x, a_y, a_z, a_r, 132, 132, -1, 1);
    SetVehicleNumberPlate(supCar[playerid], "SupCar");
    PutPlayerInVehicle(playerid, supCar[playerid], 0);
    sI[playerid][pSupCar] = true;
    }
    case 1:
    {
    if(sI[playerid][pSupCar] == true)return SendClientMessage(playerid, COLOR_ROT, ">> Du hast bereits ein Supcar gespawnt!"), ShowPlayerDialog(playerid, D_ADM_SUPCAR, DIALOG_STYLE_LIST, ""SERVER_HTML""SERVER_TAG""HTML_WEIS": Supcar", "Sultan \nInfernus \nNRG \nMaverick \n"HTML_ROT"SupCar löschen", "Spawnen", "Zurück");
    supCar[playerid] = CreateVehicle(411, a_x, a_y, a_z, a_r, 132, 132, -1, 1);
    SetVehicleNumberPlate(supCar[playerid], "SupCar");
    PutPlayerInVehicle(playerid, supCar[playerid], 0);
    sI[playerid][pSupCar] = true;
    }
    case 2:
    {
    if(sI[playerid][pSupCar] == true)return SendClientMessage(playerid, COLOR_ROT, ">> Du hast bereits ein Supcar gespawnt!"), ShowPlayerDialog(playerid, D_ADM_SUPCAR, DIALOG_STYLE_LIST, ""SERVER_HTML""SERVER_TAG""HTML_WEIS": Supcar", "Sultan \nInfernus \nNRG \nMaverick \n"HTML_ROT"SupCar löschen", "Spawnen", "Zurück");
    supCar[playerid] = CreateVehicle(522, a_x, a_y, a_z, a_r, 132, 132, -1, 1);
    SetVehicleNumberPlate(supCar[playerid], "SupCar");
    PutPlayerInVehicle(playerid, supCar[playerid], 0);
    sI[playerid][pSupCar] = true;
    }
    case 4:
    {
    if(sI[playerid][pSupCar] == true)return SendClientMessage(playerid, COLOR_ROT, ">> Du hast bereits ein Supcar gespawnt!"), ShowPlayerDialog(playerid, D_ADM_SUPCAR, DIALOG_STYLE_LIST, ""SERVER_HTML""SERVER_TAG""HTML_WEIS": Supcar", "Sultan \nInfernus \nNRG \nMaverick \n"HTML_ROT"SupCar löschen", "Spawnen", "Zurück");
    supCar[playerid] = CreateVehicle(487, a_x, a_y, a_z, a_r, 132, 132, -1, 1);
    SetVehicleNumberPlate(supCar[playerid], "SupCar");
    PutPlayerInVehicle(playerid, supCar[playerid], 0);
    sI[playerid][pSupCar] = true;
    }
    case 5:
    {
    if(sI[playerid][pSupCar] == false)return SendClientMessage(playerid, COLOR_ROT, ">> Du hast kein SupCar gespawnt!"), ShowPlayerDialog(playerid, D_ADM_SUPCAR, DIALOG_STYLE_LIST, ""SERVER_HTML""SERVER_TAG""HTML_WEIS": Supcar", "Sultan \nInfernus \nNRG \nMaverick \n"HTML_ROT"SupCar löschen", "Spawnen", "Zurück");
    DestroyVehicle(supCar[playerid]);
    sI[playerid][pSupCar] = false;
    }
    }
    }
    else
    {
    return 0;
    }
    return 1;
    }

    Ich möchte es aber gern per stock machen. also dass ich die Funktion GiveMoney(playerid, money) habe.
    Also dass ich wenn der Spieler Geld bekommen soll einfach GiveMoney(playerid, 2000); machen kann und bei Minus einfach GiveMoney(playerid, -2000);

    Ich habe mir jetzt einen Stock erstellt um von der Variable pBarGeld etwas abzuziehen, leider weiß ich nicht wie ich es machen muss, dass ich von der Variable nur den angegebenen Betrag addiere oder subtrahiere.


    stock GiveMoney(playerid, money)
    {
    new aktuellgeld;
    aktuellgeld = sI[playerid][pBarGeld];
    sI[playerid][pBarGeld] = aktuellgeld +- money;
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid, sI[playerid][pBarGeld]);
    return 1;
    }

    Wenn ich Abfragen will ob die Taste "N" gedrückt ist wie stell ich dass an? So geht es InGame nicht :(
    if(newkeys & KEY_NO)
    {
    if(IsPlayerInRangeOfPoint(playerid, 1211.2795,-1749.7644,13.5941, 2.0)) //Stadthalle
    {
    SetPlayerPos(playerid, 384.808624,173.804992,1008.382812);
    }
    }


    wo liegt mein Fehler :) danke im voraus