Beiträge von Cal44

    moinsen ich habe das mysql plugin von strickenkid


    und habe ein problem und zwar kann dmein script keine verbindung zur datenbank aufbauen


    das steht in der server log

    SQL
    [Wed Apr 6 17:41:42 2011] -------------------------
    [Wed Apr 6 17:41:42 2011] Logging Started
    [Wed Apr 6 17:41:42 2011] -------------------------
    [Wed Apr 6 17:41:42 2011] Function: mysql_init executed with result: "0".
    [Wed Apr 6 17:41:42 2011] Error (0): Failed to connect. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).


    Cal44

    moinsen ich habe mal eine frage und zwar


    was müsste mal alles ändern um das gf script auf mysql zu bekommen?


    mfg cal44

    guten tag ich habe ein krankenhaus fehler


    undzwar ich sterbe spawne im krankenhaus etc das funktioniert aber


    wenn ich mich irgendwo auslogge egal wo ob krankenhaus oder nicht krankenhaus und mich wieder einlogge spawne ich im kh


    also


    ich spawne egal ob ich im kh bin im kh

    ganz oben in deinem gm das hier rein
    #include <M-Zones>
    dann ads hier unter Ongamemodeinit
    M_Init();
    -------------
    M_Connect(playerid);
    das hier in onplayerconnect rein


    und dann ganz am ende deines scriptes das hier rein
    public M_OnPlayerEnterZone(playerid,zoneid)


    {


    return 1;


    }


    public M_OnPlayerLeaveZone(playerid,zoneid)


    {


    return 1;


    }



    Cal44

    versuch mal das hier



    geh hier in den ordner


    /etc/php5/apache2 dann in die php.ini



    dann scherib ganz unten das hier rein


    [suhosin]
    suhosin.post.max_vars = 4000
    suhosin.request.max_vars = 2000


    so sollte es klappen

    ich habe unter onplayerregister


    format(var, 32, "Wanted=%d\n",WantedLevel[playerid]);fwrite(hFile, var);


    unter onplayerupdate


    format(var, 32, "Wanted=%d\n",WantedLevel[playerid]);fwrite(hFile, var);
    SetPlayerWantedLevel(playerid,WantedLevel[playerid]);


    und unter onplayerlogin


    if( strcmp( key , "Wanted" , true ) == 0 ) { val = ini_GetValue( Data ); WantedLevel[playerid] = strval( val ); }


    SetPlayerWantedLevel(playerid,WantedLevel[playerid]);
    new stern = WantedLevel[playerid];
    WantedPoints[playerid] = stern * 2;

    moinsen ich habe das tutorial von benjamin befolgt allerdings wenn ich jetzt ein wanted gebe fängt es von vorne an


    sprich:


    ich bekomme 3 wanteds


    logge mich aus und wieder ein


    jemand gibt mir noch ein wanted


    jetz habe ich aber wieder 1 wanted und nicht 4


    OnPlayerConnect
    GetPlayerName(playerid, playrname, sizeof(playrname));
    format(connect, sizeof(connect), "%s.ini", playrname);
    if(fexist(connect))
    {
    gPlayerAccount[playerid] = 1;
    SendClientMessage(playerid, COLOR_YELLOW, "Du bist Registriert logge dich mit /login <Passwort> ein");
    return 1;
    }
    else
    {
    gPlayerAccount[playerid] = 0;
    SendClientMessage(playerid, COLOR_YELLOW, "Bitte Registrier dich mit /register <Passwort>");
    }
    PlayerInfo[playerid][pAutoschein] = 0;
    PlayerInfo[playerid][pMotorradschein] = 0;
    PlayerInfo[playerid][pBootschein] = 0;
    PlayerInfo[playerid][pFlugschein] = 0;
    PlayerInfo[playerid][pWaffenschein] = 0;
    PlayerInfo[playerid][pAdmin] = 0;
    PlayerInfo[playerid][pWarns] = 0;
    PlayerInfo[playerid][pGetoetet] = 0;
    PlayerInfo[playerid][pGestorben] = 0;
    GivePlayerMoney(playerid,PlayerInfo[playerid][pGeld]);

    OnPlayerCommandText
    if (strcmp(cmd, "/login", true) ==0 )
    {
    if(IsPlayerConnected(playerid))
    {
    new tmppass[64];
    if(gPlayerLogged[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_GREY, "Du bist bereits eingeloggt.");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GREY, " Benutze: /login [Passwort]");
    return 1;
    }
    strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
    Encrypt(tmppass);
    OnPlayerLogin(playerid,tmppass);
    }
    return 1;
    }
    if (strcmp(cmd, "/register", true)==0)
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GREY, "Benutze: /register [Passwort]");
    return 1;
    }
    if (gPlayerAccount[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_GREY, "Du bist bereits Registriert");
    return 1;
    }
    strmid(PlayerInfo[playerid][pPassword], tmp, 0, strlen(cmdtext), 255);
    Encrypt(PlayerInfo[playerid][pPassword]);
    GetPlayerName(playerid, playername, sizeof(playername));
    format(string, sizeof(string), "%s.ini", playername);
    new File: file = fopen(string, io_read);
    if (file)
    {
    SendClientMessage(playerid, COLOR_GREY, "Du bist bereits Registriert");
    fclose(file);
    return 1;
    }
    new File:hFile;
    hFile = fopen(string, io_append);
    new var[32];//
    format(var, 32, "%s\n", PlayerInfo[playerid][pPassword]);fwrite(hFile, var);
    format(var, 32, "Getötet=%d\n",PlayerInfo[playerid][pGetoetet]);fwrite(hFile, var);
    format(var, 32, "Gestorben=%d\n",PlayerInfo[playerid][pGestorben]);fwrite(hFile, var);
    PlayerInfo[playerid][pGeld] = GetPlayerMoney(playerid);
    format(var, 32, "Autoschein=%d\n",PlayerInfo[playerid][pAutoschein]);fwrite(hFile, var);
    format(var, 32, "Geld=%d\n",PlayerInfo[playerid][pGeld]);fwrite(hFile, var);
    format(var, 32, "Motorradschein=%d\n",PlayerInfo[playerid][pMotorradschein]);fwrite(hFile, var);
    format(var, 32, "Bootschein=%d\n",PlayerInfo[playerid][pBootschein]);fwrite(hFile, var);
    format(var, 32, "Flugschein=%d\n",PlayerInfo[playerid][pFlugschein]);fwrite(hFile, var);
    format(var, 32, "Waffenschein=%d\n",PlayerInfo[playerid][pWaffenschein]);fwrite(hFile, var);
    format(var, 32, "Admin=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
    format(var, 32, "Warnungen=%d\n",PlayerInfo[playerid][pWarns]);fwrite(hFile, var);
    fclose(hFile);
    SendClientMessage(playerid, COLOR_WHITE, "Erfolgreich Registriert!");
    SendClientMessage(playerid, COLOR_WHITE, "Nächstes mal benutze /login <Passwort> zum Einloggen.");
    OnPlayerLogin(playerid,PlayerInfo[playerid][pPassword]);
    return 1;
    }

    OnPlayerLogin
    new pname2[MAX_PLAYER_NAME];
    new pname3[MAX_PLAYER_NAME];
    new string2[64];
    new string3[128];
    GetPlayerName(playerid, pname2, sizeof(pname2));
    format(string2, sizeof(string2), "%s.ini", pname2);
    new File: UserFile = fopen(string2, io_read);
    if (UserFile)
    {
    new valtmp[128];
    fread(UserFile, valtmp);strmid(PlayerInfo[playerid][pPassword], valtmp, 0, strlen(valtmp)-1, 255);
    if ((strcmp(PlayerInfo[playerid][pPassword], string, true, strlen(valtmp)-1) == 0))
    {
    new key[128],val[128];
    new Data[128];
    while(fread(UserFile,Data,sizeof(Data)))
    {
    key = ini_GetKey(Data);
    if( strcmp( key , "Getötet" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pGetoetet] = strval( val ); }
    if( strcmp( key , "Gestorben" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pGestorben] = strval( val ); }
    if( strcmp( key , "Waffenschein" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pWaffenschein] = strval( val ); }
    if( strcmp( key , "Motorradschein" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMotorradschein] = strval( val ); }
    if( strcmp( key , "Bootschein" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBootschein] = strval( val ); }
    if( strcmp( key , "Waffenschein" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pWaffenschein] = strval( val ); }
    if( strcmp( key , "Flugschein" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pFlugschein] = strval( val ); }
    if( strcmp( key , "Autoschein" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAutoschein] = strval( val ); }
    if( strcmp( key , "Geld" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pGeld] = strval( val ); }
    if( strcmp( key , "Admin" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdmin] = strval( val ); }
    if( strcmp( key , "Warnungen" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pWarns] = strval( val ); }
    GivePlayerMoney(playerid,PlayerInfo[playerid][pGeld]);
    }
    fclose(UserFile);
    gPlayerLogged[playerid] = 1;
    gPlayerAccount[playerid] = 1;
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid,PlayerInfo[playerid][pGeld]);
    new kills = PlayerInfo[playerid][pGetoetet];
    SetPlayerScore(playerid, kills);
    GetPlayerName(playerid, pname3, sizeof(pname3));
    format(string3, sizeof(string3), "Willkommen %s, du hast dich erfolgreich eingeloggt!", pname3);
    SendClientMessage(playerid, COLOR_WHITE,string3);
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, "Das angegebene Passwort stimmt nicht");
    fclose(UserFile);
    }
    }
    return 1;
    }

    OnPlayerUpdate
    {
    if(IsPlayerConnected(playerid))
    {
    if(gPlayerLogged[playerid])
    {
    new string3[32];
    new pname3[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname3, sizeof(pname3));
    format(string3, sizeof(string3), "%s.ini", pname3);
    new File: pFile = fopen(string3, io_write);
    if (pFile)
    {
    new var[32];
    format(var, 32, "%s\n", PlayerInfo[playerid][pPassword]);fwrite(pFile, var);
    fclose(pFile);
    new File: hFile = fopen(string3, io_append);
    PlayerInfo[playerid][pGeld] = GetPlayerMoney(playerid);
    format(var, 32, "Getötet=%d\n",PlayerInfo[playerid][pGetoetet]);fwrite(hFile, var);
    format(var, 32, "Gestorben=%d\n",PlayerInfo[playerid][pGestorben]);fwrite(hFile, var);
    format(var, 32, "Geld=%d\n",PlayerInfo[playerid][pGeld]);fwrite(hFile, var);
    format(var, 32, "Autoschein=%d\n",PlayerInfo[playerid][pAutoschein]);fwrite(hFile, var);
    format(var, 32, "Motorradschein=%d\n",PlayerInfo[playerid][pMotorradschein]);fwrite(hFile, var);
    format(var, 32, "Bootschein=%d\n",PlayerInfo[playerid][pBootschein]);fwrite(hFile, var);
    format(var, 32, "Waffenschein=%d\n",PlayerInfo[playerid][pWaffenschein]);fwrite(hFile, var);
    format(var, 32, "Flugschein=%d\n",PlayerInfo[playerid][pFlugschein]);fwrite(hFile, var);
    format(var, 32, "Admin=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
    format(var, 32, "Warnungen=%d\n",PlayerInfo[playerid][pWarns]);fwrite(hFile, var);
    fclose(hFile);
    }
    }
    }
    return 1;
    }

    OnPlayerRegister
    {
    if(IsPlayerConnected(playerid))
    {
    new string3[32];
    new playername3[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername3, sizeof(playername3));
    format(string3, sizeof(string3), "%s.ini", playername3);
    new File: hFile = fopen(string3, io_write);
    if (hFile)
    {
    PlayerInfo[playerid][pGeld] = GetPlayerMoney(playerid);
    strmid(PlayerInfo[playerid][pPassword], password, 0, strlen(password), 255);
    new var[32];
    format(var, 32, "Passwort=%s\n", PlayerInfo[playerid][pPassword]);fwrite(hFile, var);
    format(var, 32, "Getötet=%d\n",PlayerInfo[playerid][pGetoetet]);fwrite(hFile, var);
    format(var, 32, "Gestorben=%d\n",PlayerInfo[playerid][pGestorben]);fwrite(hFile, var);
    format(var, 32, "Autoschein=%d\n",PlayerInfo[playerid][pAutoschein]);fwrite(hFile, var);
    format(var, 32, "Motorradschein=%d\n",PlayerInfo[playerid][pMotorradschein]);fwrite(hFile, var);
    format(var, 32, "Bootschein=%d\n",PlayerInfo[playerid][pBootschein]);fwrite(hFile, var);
    format(var, 32, "Waffenschein=%d\n",PlayerInfo[playerid][pWaffenschein]);fwrite(hFile, var);
    format(var, 32, "Flugschein=%d\n",PlayerInfo[playerid][pFlugschein]);fwrite(hFile, var);
    format(var, 32, "Geld=%d\n",PlayerInfo[playerid][pGeld]);fwrite(hFile, var);
    format(var, 32, "Admin=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
    format(var, 32, "Warnungen=%d\n",PlayerInfo[playerid][pWarns]);fwrite(hFile, var);
    fclose(hFile);
    SendClientMessage(playerid, COLOR_YELLOW, "Account registriert, du kannst dich nun einloggen mit /login [Passwort]).");
    }
    }
    return 1;
    }

    hallo erstmal ich habe ein problem mit meinem selfmade script beim login / register system undzwar wenn ich mich neu regi und einlogge klappt alles aber wenn ich in der ini des spielers etwas editiere (nicht beim passwort editiere ich) und mich einloggen will steht da falsches passwort ich bitte um hilfe danke