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,
    ich habe mal ein filterscript gebaut aber dies klappt nicht ich hatte das schonmal bei einem filterscript von T4125Gamer das problem war bei beidem dass wenn man /(irgendwas)
    machst wo sich dann ein diaoog öfnnet öfnet er sich auch aber wenn man irgendwo drauf klick passiert da nichts ich habe hier mal meinem kompletten filterscript
    (ich habe 0.3e)

    // 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

    Einmal editiert, zuletzt von Nixon ()


  • Hier


    // 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
    #define PlayerName(%0) pName[%0]
    enum {
    DIALOG_BANK = 17823,
    DIALOG_TRANSFER,
    DIALOG_TRANSFER2,
    DIALOG_DEPOSIT,
    DIALOG_WITHDRAW,
    };


    new pName[MAX_PLAYERS][18];
    new id,
    str[128],
    Spielerdatei[30];


    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print(" banksystem by lcp9");
    print("--------------------------------------\n");
    return 1;
    }
    public OnFilterScriptExit()
    {
    new i;
    for(; i < MAX_PLAYERS; ++i)if(IsPlayerConnected(i))SpielerSpeichern(i);
    return 1;
    }
    public OnPlayerConnect(playerid)
    {

    strdel(Spielerdatei,0,30);
    strdel(pName[playerid],0,18);
    GetPlayerName(playerid,pName[playerid],18);
    format(Spielerdatei,30,"/bank/%s.txt",PlayerName(playerid));
    LoadAccount(playerid,Spielerdatei);
    return 1;
    }
    public OnPlayerDisconnect(playerid)
    {
    SpielerSpeichern(playerid);
    return 1;
    }
    stock SpielerSpeichern(playerid){
    strdel(Spielerdatei,0,30);
    format(Spielerdatei,30,"/bank/%s.txt",PlayerName(playerid));
    dini_IntSet(Spielerdatei,"bank",GetPVarInt(playerid,"bank"));
    return 1;
    }
    stock LoadAccount(playerid, string[]){
    if(dini_Exists(Spielerdatei))return SetPVarInt(playerid,"bank",dini_Int(string,"bank"));
    return dini_Create(Spielerdatei);
    }
    ocmd:bank(playerid, params[])
    {
    strdel(str,0,128);
    format(str,128,"{0005FF}You have {19FF00}%d${0005FF} in your bank account",GetPVarInt(playerid,"bank"));
    SendClientMessage(playerid,ROT,str);
    ShowPlayerDialog(playerid,DIALOG_BANK,DIALOG_STYLE_LIST,str,"{3C00FF}Deposit money\n{3C00FF}Withdraw money\n{3C00FF}Transfer money","Yes","Cancel");
    return 1;
    }


    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    switch(dialogid){
    case DIALOG_BANK:{
    if(response){
    switch(listitem){
    case 0:return ShowPlayerDialog(playerid,DIALOG_DEPOSIT,1,"Deposit!","How much money to deposit?","Ok","Cancel");
    case 1:return ShowPlayerDialog(playerid,DIALOG_WITHDRAW,1,"Withdraw!","How much money to withdraw?","Ok","Cancel");
    case 2:return ShowPlayerDialog(playerid,DIALOG_TRANSFER,1,"Transfer money","To him do want to give money?","Ok","Cancel");


    }
    }
    }
    case DIALOG_DEPOSIT:{
    if(!response){
    strdel(str,0,128);
    format(str,128,"{0005FF}You have {19FF00}%d${0005FF} in your bank account",GetPVarInt(playerid,"bank"));
    return ShowPlayerDialog(playerid,DIALOG_BANK,DIALOG_STYLE_LIST,str,"{3C00FF}Deposit money\n{3C00FF}Withdraw money\n{3C00FF}Transfer money","Yes","Cancel");
    }
    new money = strval(inputtext);
    if(GetPlayerMoney(playerid) < money || money <= 0)return ShowPlayerDialog(playerid,DIALOG_DEPOSIT,1,"Deposit!","You haven't got enought money!","Ok","Cancel");
    strdel(str,0,128);
    format(str,64,"You deposited %d$",money);
    GivePlayerMoney(playerid,-money);
    SetPVarInt(playerid,"bank", GetPVarInt(playerid,"bank") +money);
    return SendClientMessage(playerid,ROT,str);
    }
    case DIALOG_WITHDRAW:{
    if(!response){
    strdel(str,0,128);
    format(str,128,"{0005FF}You have {19FF00}%d${0005FF} in your bank account",GetPVarInt(playerid,"bank"));
    return ShowPlayerDialog(playerid,DIALOG_BANK,DIALOG_STYLE_LIST,str,"{3C00FF}Deposit money\n{3C00FF}Withdraw money\n{3C00FF}Transfer money","Yes","Cancel");
    }
    new money = strval(inputtext);
    if(GetPVarInt(playerid,"bank") < money || money <= 0)return ShowPlayerDialog(playerid,DIALOG_WITHDRAW,1,"Deposit money","You don't have so much money on your bank !","Ok","Cancel");
    strdel(str,0,128);
    format(str,64,"You withdraw %d$",money);
    GivePlayerMoney(playerid,money);
    SetPVarInt(playerid,"bank", GetPVarInt(playerid,"bank") -money);
    return SendClientMessage(playerid,ROT,str);
    }
    case DIALOG_TRANSFER:{
    if(!response){
    strdel(str,0,128);
    format(str,128,"{0005FF}You have {19FF00}%d${0005FF} in your bank account",GetPVarInt(playerid,"bank"));
    return ShowPlayerDialog(playerid,DIALOG_BANK,DIALOG_STYLE_LIST,str,"{3C00FF}Deposit money\n{3C00FF}Withdraw money\n{3C00FF}Transfer money","Yes","Cancel");
    }
    strdel(str,0,128);
    format(str,128,"Ok you choosed %s(%d)\nNow Enter The Amount You Want To Transfer",PlayerName(id),id);
    SendClientMessage(playerid,ROT,str);
    id = strval(inputtext);
    if(!IsPlayerConnected(id))return ShowPlayerDialog(playerid,DIALOG_TRANSFER,1,"Transfer money","To him do want to give money?","Ok","Cancel");
    return ShowPlayerDialog(playerid,DIALOG_TRANSFER2,DIALOG_STYLE_INPUT,"PAY","How much you want to pay?","ok","Cancel");
    }
    case DIALOG_TRANSFER2:{
    if(!response)return ShowPlayerDialog(playerid,DIALOG_TRANSFER,1,"Transfer money","To him do want to give money?","Ok","Cancel");
    new money = strval(inputtext);
    if(GetPVarInt(playerid,"bank") < money || money <= 0)return ShowPlayerDialog(playerid,DIALOG_TRANSFER2,1,"Deposit!","You haven't got enought money!","Ok","Cancel");
    SetPVarInt(playerid,"bank", GetPVarInt(playerid,"bank") -money);
    SetPVarInt(id,"bank", GetPVarInt(playerid,"bank") +money);
    strdel(str,0,128);
    format(str,64,"You gave player %s %d $",PlayerName(id),money);
    SendClientMessage(playerid,ROT,str);
    strdel(str,0,64);
    format(str,64,"Player %s gave you %d $",PlayerName(playerid),money);
    return SendClientMessage(id,ROT,str);
    }
    }
    return 1;
    }


  • mhh ja schön jetzt ist nur die frage WAS SOLL ICH DAMIT
    du hast mir ein völlich neues bank system gescriptet?
    und ich habe das problem schon behoben :D
    und das was ich auch geschrieben habe das ich das problem schonmal hatte bei nem anderen system das heist das kann es nicht sein
    ach ja geschafft habe ich es indem ich alle callbacks bei allen OnDialogResponse auf 0 gesetzt habe :P

  • Noch ein paar mehr Fullquotes, ne ?

    Main: CPU: Intel Core i5-4440 @ 3,10 GHz | CPU-Cooling: Matterhorn -PURE- | RAM: 16GB Crucial Ballistix Sport DDR3-1600 DIMM CL9-9-9-24 |
    Motherboard: ASRock B85M Pro4 | GPU: Sapphire Radeon R9 390X Nitro 8GB GDDR5 |

    SSD: Samsung SSD 840 Evo 500GB | Power Supply: 550 Watt Corsair CS Series Modular 80+ Gold | Case: beQuiet! Silent Base 800


    As I walk through the valley of the shadow of death
    I take a look at my life and realize there's nothin' left.