filterscript problem

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
  • Hi community,
    undzwar habe ich ein filterscript erstellt das auch funkt wenn man es im orginal gamemode einbaut aber wenn man es als filterscript bentutzt dann
    öfnnet sich der richtige dialog aber wenn man irgendwo draufklickt passiert nichts garnichts.
    Das problem hatte ich auch bei einem filterscript von T4125Gamer hier sind nochmal die codes:

    // This is a comment
    // uncomment the line below if you want to write a filterscript


    #include <a_samp>
    #include <ocmd>
    #include <dini>
    #define ROT 0xFF000FFF
    new id;



    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print(" banksystem by lcp9");
    print("--------------------------------------\n");
    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }




    main()
    {
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
    }



    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
    }


    public OnPlayerConnect(playerid)
    {
    new Spielerdatei[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Spielerdatei,sizeof(Spielerdatei),"/bank/%s.txt",name);
    if(dini_Exists(Spielerdatei))
    {
    LoadAccount(playerid);
    }
    else
    {
    GetPlayerName(playerid,name,sizeof(name));
    format(Spielerdatei,sizeof(Spielerdatei),"/bank/%s.txt",name);
    dini_Create(Spielerdatei);
    }
    return 1;
    }


    public OnPlayerDisconnect(playerid, reason)
    {
    return 1;
    }


    public OnPlayerSpawn(playerid)
    {
    return 1;
    }


    public OnPlayerDeath(playerid, killerid, reason)
    {
    return 1;
    }


    public OnVehicleSpawn(vehicleid)
    {
    return 1;
    }


    public OnVehicleDeath(vehicleid, killerid)
    {
    return 1;
    }


    public OnPlayerText(playerid, text[])
    {
    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
    // Do something here
    return 1;
    }
    return 0;
    }


    public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
    {
    return 1;
    }


    public OnPlayerExitVehicle(playerid, vehicleid)
    {
    return 1;
    }


    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    return 1;
    }


    public OnPlayerEnterCheckpoint(playerid)
    {
    return 1;
    }


    public OnPlayerLeaveCheckpoint(playerid)
    {
    return 1;
    }


    public OnPlayerEnterRaceCheckpoint(playerid)
    {
    return 1;
    }


    public OnPlayerLeaveRaceCheckpoint(playerid)
    {
    return 1;
    }


    public OnRconCommand(cmd[])
    {
    return 1;
    }


    public OnPlayerRequestSpawn(playerid)
    {
    return 1;
    }


    public OnObjectMoved(objectid)
    {
    return 1;
    }


    public OnPlayerObjectMoved(playerid, objectid)
    {
    return 1;
    }


    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    return 1;
    }


    public OnVehicleMod(playerid, vehicleid, componentid)
    {
    return 1;
    }


    public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
    {
    return 1;
    }


    public OnVehicleRespray(playerid, vehicleid, color1, color2)
    {
    return 1;
    }


    public OnPlayerSelectedMenuRow(playerid, row)
    {
    return 1;
    }


    public OnPlayerExitedMenu(playerid)
    {
    return 1;
    }


    public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
    {
    return 1;
    }


    public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
    {
    return 1;
    }


    public OnRconLoginAttempt(ip[], password[], success)
    {
    return 1;
    }


    public OnPlayerUpdate(playerid)
    {
    return 1;
    }


    public OnPlayerStreamIn(playerid, forplayerid)
    {
    return 1;
    }


    public OnPlayerStreamOut(playerid, forplayerid)
    {
    return 1;
    }


    public OnVehicleStreamIn(vehicleid, forplayerid)
    {
    return 1;
    }
    stock SpielerSpeichern(playerid)
    {
    new Spielerdatei[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Spielerdatei,sizeof(Spielerdatei),"/bank/%s.txt",name);
    dini_IntSet(Spielerdatei,"bank",GetPVarInt(playerid,"bank"));

    return 1;
    }
    ocmd:bank(playerid, params[])
    {
    new str[128];
    format(str,sizeof(str),"{0005FF}You have {19FF00}%d${0005FF} in your bank account",GetPVarInt(playerid,"bank"));
    SendClientMessage(playerid,ROT,str);
    ShowPlayerDialog(playerid,50,DIALOG_STYLE_LIST,str,"{3C00FF}Deposit money\n{3C00FF}Withdraw money\n{3C00FF}Transfer money","Yes","Cancel");
    return 1;
    }
    stock LoadAccount(playerid)
    {
    new Spielerdatei[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Spielerdatei,sizeof(Spielerdatei),"/bank/%s.txt",name);
    SetPVarInt(playerid,"bank",dini_Int(Spielerdatei,"bank"));
    return 1;
    }
    public OnVehicleStreamOut(vehicleid, forplayerid)
    {
    return 1;
    }


    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(dialogid == 50)
    {
    if(response)
    {
    if(listitem == 0)
    {
    ShowPlayerDialog(playerid,51,1,"Deposit!","How much money to deposit?","Ok","Cancel");
    return 1;
    }
    else if(listitem == 1)
    {
    ShowPlayerDialog(playerid,52,1,"Withdraw!","How much money to withdraw?","Ok","Cancel");
    return 1;
    }
    else if(listitem == 2)
    {
    ShowPlayerDialog(playerid,53,1,"Transfer money","To him do want to give money?","Ok","Cancel");
    return 1;

    }
    }
    }
    if(dialogid == 51)
    {
    if(response)
    {
    new Spielerdatei[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Spielerdatei,sizeof(Spielerdatei),"/bank/%s.txt",name);


    if(GetPlayerMoney(playerid) < strval(inputtext))
    {
    SendClientMessage(playerid,ROT,"You haven't got enought money!");
    return 1;
    }
    else
    {
    new string[128];
    format(string,sizeof(string),"You deposited %d$",strval(inputtext));
    GivePlayerMoney(playerid,-strval(inputtext));
    SetPVarInt(playerid,"bank", GetPVarInt(playerid,"bank") +strval(inputtext));
    SendClientMessage(playerid,ROT,string);
    SpielerSpeichern(playerid);
    return 1;
    }
    }
    }
    if(dialogid == 52)
    {
    if(response)
    {


    new Spielerdatei[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Spielerdatei,sizeof(Spielerdatei),"/bank/%s.txt",name);
    if(GetPVarInt(playerid,"bank") < strval(inputtext))
    {
    SendClientMessage(playerid,ROT,"You don't have so much money on your bank !");
    return 1;
    }
    else
    {
    new string[128];
    format(string,sizeof(string),"You withdraw %d$",strval(inputtext));
    GivePlayerMoney(playerid,strval(inputtext));
    SetPVarInt(playerid,"bank", GetPVarInt(playerid,"bank") -strval(inputtext));
    SendClientMessage(playerid,ROT,string);
    SpielerSpeichern(playerid);
    return 1;
    }
    }
    }
    if(dialogid == 53)
    {
    if(response)
    {


    new give[MAX_PLAYER_NAME];
    id = strval(inputtext);
    new string[128];
    format(string,sizeof(string),"Ok you choosed id(%d)\nNow Enter The Amount You Want To Transfer",id);
    SendClientMessage(playerid,ROT,string);
    GetPlayerName(playerid, give, MAX_PLAYER_NAME);
    new get[MAX_PLAYER_NAME];
    GetPlayerName(id, get, MAX_PLAYER_NAME);
    GetPlayerName(strval(inputtext), get,MAX_PLAYER_NAME);
    ShowPlayerDialog(playerid,54,DIALOG_STYLE_INPUT,"PAY","How much you want to pay?","ok","Cancel");
    return 1;
    }
    }
    if(dialogid == 54)
    {
    if(response)
    {
    new Spielerdatei[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Spielerdatei,sizeof(Spielerdatei),"/bank/%s.txt",name);


    if(GetPVarInt(playerid,"bank") < strval(inputtext))
    {
    SendClientMessage(playerid,ROT,"You haven't got enought money!");
    return 1;
    }
    else
    {


    new string[128];
    new Name[MAX_PLAYER_NAME];
    new give[MAX_PLAYER_NAME];
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    GetPlayerName(id, Name, sizeof(Name));
    GetPlayerName(playerid, give, MAX_PLAYER_NAME);
    SetPVarInt(playerid,"bank", GetPVarInt(playerid,"bank") -strval(inputtext));
    SetPVarInt(id,"bank", GetPVarInt(playerid,"bank") +strval(inputtext));
    format(string,sizeof(string),"You gave player %s %d $",Name,strval(inputtext));
    SendClientMessage(playerid,ROT,string);
    new string2[128];
    format(string2,sizeof(string2),"Player %s gave you %d $",pname,strval(inputtext));
    SendClientMessage(id,ROT,string2);
    SpielerSpeichern(playerid);
    return 1;
    }
    }
    }
    return 1;
    }


    public OnPlayerClickPlayer(playerid, clickedplayerid, source)
    {
    return 1;
    }
    //edit ich habe irgendwie zwei themen angelegt WTF?! auf einmal hää
    ich habs zweimal probt aber bei dem ersten mal kam die meldung fehler wegen 30 sekunden keine message machen aber hat sich irgendwi trozdem erstellt

  • Bin damit zwar nicht so vertraut aber versuchs mal anstatt mit
    if(response)


    so:
    beim ersten Button
    if(response == 1)


    und beim zweiten Button
    if(response == 0)

    Erst wenn
    der letzte Baum gerodet,
    der letzte Fisch vergiftet
    und der letzte Fisch gefangen ist,
    werdet ihr feststellen,
    dass man Gold nicht essen kann.

  • ne das bringt nichts ich glaube es klappt alles ausser dieses OnDialogResponse in filtersctips bei mir irgendwie
    //edit habs geschafft indem ich überall bei OnDialogResponse da callback return 0;
    gesetzt zuerst habe ich das nur bei dem filterscript porbt aber nachdem ich es überall probiert habe klappts jetzt :D

    Einmal editiert, zuletzt von Nixon ()