Beiträge von Club_House

    Hallo Liebes Breadfish,


    da ich selber ein Script schreibe und zuzeit nicht mehr weiter weiß frage ich euch ob ihr mir helfen könnt.
    Und zwar ich möchte gerne den Spawn Button Deaktivieren aber wies nicht wie und wo daich im Bereich Scripten neu bin.Die Datenbankdaten habe ich mal weggemacht aber die Datenbank geht.



    Es wäre sehr nett von euch wen ihr mir helfen könnt.



    Vielen Dank :)


    //Include´s


    #include <a_samp>
    #include <a_mysql>
    #include <sscanf2>
    #include <ocmd>



    //Enums
    enum playerInfo{
    eingeloggt,
    level,
    pid,
    geld,
    alevel
    }



    enum buildingsEnum{
    Float:b_x,
    Float:b_y,
    Float:b_z,
    Float:b_ix,
    Float:b_iy,
    Float:b_iz,
    b_interior
    }



    enum hausEnum{
    Float:h_x,
    Float:h_y,
    Float:h_z,
    Float:ih_x,
    Float:ih_y,
    Float:ih_z,
    h_interior,
    h_besitzer[MAX_PLAYER_NAME],
    h_preis,
    h_id,
    h_pickup,
    Text3D:h_text
    }



    //Globale Variablen



    new dbhandle;
    new sInfo[MAX_PLAYERS][playerInfo];



    new Float:TelePos[MAX_PLAYERS][6];
    new hInfo[9000][hausEnum];
    new bInfo[][buildingsEnum] = {
    {660.6880,-573.4324,16.3359,-25.8953,-186.9506,1003.5469,17},
    {999.6731,-920.2469,42.3281,-26.0325,-140.4643,1003.5469,16}



    };




    //Farbe



    #define Gelb 0xFFFF1BFF
    #define Rot 0xFF0000FF
    #define Grün 0x41FF00FF
    #define Türkis 0x00C3FFFF
    #define Blau 0x0023FFFF



    //DIALOG



    #define DIALOG_TP 1
    #define DIALOG_REGISTER 2
    #define DIALOG_LOGIN 3



    //Datenbank



    #define db_host "****"
    #define db_user "***"
    #define db_pass "******"
    #define db_db "******"





    //Forward



    forward akick();
    forward neustart();
    forward OnUserCheck(playerid);
    forward OnPasswortCheck(playerid);
    forward OnPlayerRegister(playerid);
    forward OnHausesLoad();
    forward OnHausCreated(id);
    forward updateHaus2(id);




    main()
    {
    print("\n----------------------------------");
    print(" Das ist ein Server von ***");
    print("----------------------------------\n");
    }




    public OnGameModeInit()
    {
    SetGameModeText("CoR-Roleplay");
    AddPlayerClass(1,681.7202,-473.8583,16.5363,182.6269,0,0,0,0,0,0);
    AddStaticVehicle(411,667.9714,-476.4971,16.0630,246.1584,64,1); // bigboss auto

    //MySQL

    dbhandle = mysql_connect(db_host,db_user,db_db,db_pass);

    //Gebäude laden
    for(new i=0; i<sizeof(bInfo); i++)
    {
    CreatePickup(1239,1,bInfo[i][b_x],bInfo[i][b_y],bInfo[i][b_z],0);
    }

    //Häuser laden
    new query[128];
    format(query, sizeof(query), "SELECT * FROM haus");
    mysql_function_query(dbhandle, query, true, "OnHausesLoad", "");

    return 1;
    }




    public OnHausesLoad()
    {
    new num_fields,num_rows;
    cache_get_data(num_rows,num_fields,dbhandle);
    if(!num_rows)return 1;
    for(new i=0; i<num_rows; i++)
    {
    new id=getFreeHausID();
    hInfo[id][h_x]=cache_get_field_content_float(i, "h_x", dbhandle);
    hInfo[id][h_y]=cache_get_field_content_float(i, "h_y", dbhandle);
    hInfo[id][h_z]=cache_get_field_content_float(i, "h_z", dbhandle);
    hInfo[id][ih_x]=cache_get_field_content_float(i, "ih_x", dbhandle);
    hInfo[id][ih_y]=cache_get_field_content_float(i, "ih_y", dbhandle);
    hInfo[id][ih_z]=cache_get_field_content_float(i, "ih_z", dbhandle);
    hInfo[id][h_interior]=cache_get_field_content_int(i, "h_interior", dbhandle);
    new tmp_name[MAX_PLAYER_NAME];
    cache_get_field_content(i, "besitzer", tmp_name, dbhandle);
    strmid(hInfo[id][h_besitzer], tmp_name, 0, sizeof(tmp_name), sizeof(tmp_name));
    hInfo[id][h_id]=cache_get_field_content_int(i, "id", dbhandle);
    hInfo[id][h_preis]=cache_get_field_content_int(i, "h_preis", dbhandle);
    updateHaus(id);
    }
    return 1;
    }



    updateHaus(id)
    {



    if(hInfo[id][h_pickup])
    {
    DestroyPickup(hInfo[id][h_pickup]);
    }
    if(hInfo[id][h_text])
    {
    Delete3DTextLabel(hInfo[id][h_text]);
    }
    updateHaus2(id);
    return 1;
    }




    public updateHaus2(id)
    {
    new string[256];
    if(!strlen(hInfo[id][h_besitzer]))
    {
    hInfo[id][h_pickup]=CreatePickup(1273, 1, hInfo[id][h_x], hInfo[id][h_y], hInfo[id][h_z], -1);
    format(string,sizeof(string), "Zum Verkauf\nKosten: %i$\n/hauskaufen", hInfo[id][h_preis]);
    hInfo[id][h_text]=Create3DTextLabel(string, Rot, hInfo[id][h_x], hInfo[id][h_y], hInfo[id][h_z], 10, 0, 1);
    }
    else
    {
    hInfo[id][h_pickup]=CreatePickup(1239, 1, hInfo[id][h_x], hInfo[id][h_y], hInfo[id][h_z], -1);
    format(string,sizeof(string), "Besitzer: %s\n/enter", hInfo[id][h_besitzer]);
    hInfo[id][h_text]=Create3DTextLabel(string, Blau, hInfo[id][h_x], hInfo[id][h_y], hInfo[id][h_z], 10, 0, 1);
    }
    return 1;
    }



    public OnGameModeExit()
    {
    mysql_close(dbhandle);
    return 1;
    }



    public OnPlayerRequestClass(playerid, classid)
    {
    return 1;
    }



    public OnPlayerConnect(playerid)
    {
    SetPlayerColor(playerid,0xFEFEFEFF); // Tab normal
    EnableStuntBonusForAll(0);// kein Bonus geld mehr
    ShowPlayerMarkers(0); // spieler wir nicht mehr auf ger minimap angezeigt
    DisableInteriorEnterExits();// alle Häuser sind aus
    UsePlayerPedAnims(); // normal gehen

    //Login/Register

    new name[MAX_PLAYER_NAME],query[128];
    GetPlayerName(playerid,name,sizeof(name));
    format(query,sizeof(query),"SELECT id FROM acc WHERE username='%s'",name);
    mysql_function_query(dbhandle,query,true,"OnUserCheck","i",playerid);
    return 1;
    }



    public OnUserCheck(playerid)
    {
    new num_rows,num_fields;
    cache_get_data(num_rows,num_fields,dbhandle);
    if(num_rows==0)
    {
    //Registrierung
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"Registrierung","{FFFFFF}Bitte wähle ein Passwort um dir einen {00FFFA}Account{FFFFFF} zu erstellen!\n{FFFFFF}Mit der Registrierung stimmst du automatisch unseren {00FFFA}Regeln{FFFFFF} zu.","Registrieren","Abbrechen");
    }
    else
    {
    //Login
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Status: {C3FF00}Dein Accunt wurde gefunden,warte auf Passworteingabe.","Login","Abbrechen");
    }
    return 1;
    }



    saveplayer(playerid)
    {
    if(sInfo[playerid][eingeloggt]==0)return 1;
    //Speichern
    new query[128];
    format(query,sizeof(query),"UPDATE acc SET level='%i',geld='%i',alevel='%i' WHERE id='%i'",sInfo[playerid][level],GetPlayerMoney(playerid),sInfo[playerid][alevel],sInfo[playerid][pid]);
    mysql_function_query(dbhandle,query,false,"","");
    return 1;
    }



    resetPlayer(playerid)
    {
    sInfo[playerid][level]=0;
    sInfo[playerid][eingeloggt]=0;
    sInfo[playerid][pid]=0;
    sInfo[playerid][alevel]=0;
    return 1;
    }



    getFreeHausID()
    {
    for(new i=0; i<sizeof(hInfo); i++)
    {
    if(hInfo[i][h_id]==0)return i;
    }
    return 0;
    }



    public OnPlayerRegister(playerid)
    {
    sInfo[playerid][pid] = cache_insert_id(dbhandle);
    sInfo[playerid][eingeloggt] = 1;
    return 1;
    }




    public OnPlayerDisconnect(playerid, reason)
    {
    saveplayer(playerid);
    resetPlayer(playerid);
    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;
    }



    getPlayerName(playerid)
    {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
    }



    hatPlayerHaus(playerid)
    {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    for(new i=0; i<sizeof(hInfo); i++)
    {
    if(!hInfo[i][h_id])continue;
    if(!strlen(hInfo[i][h_besitzer]))continue;
    if(!strcmp(name, hInfo[i][h_besitzer], true))return 1;
    }
    return 0;
    }



    saveHaus(id)
    {
    new query[128];
    format(query, sizeof(query), "UPDATE haus SET besitzer='%s', h_preis='%i' WHERE id='%i'", hInfo[id][h_besitzer], hInfo[id][h_preis], hInfo[id][h_id]);
    mysql_function_query(dbhandle, query, false, "", "");
    return 1;
    }




    public OnHausCreated(id)
    {
    hInfo[id][h_id]=cache_insert_id();
    }



    //Befehle



    ocmd:exit(playerid, params[])
    {
    for(new i=0; i<sizeof(bInfo); i++)
    {
    if(GetPlayerVirtualWorld(playerid)!=i)continue;
    if(!IsPlayerInRangeOfPoint(playerid,2,bInfo[i][b_ix],bInfo[i][b_iy],bInfo[i][b_iz]))continue;
    SetPlayerPos(playerid,bInfo[i][b_x],bInfo[i][b_y],bInfo[i][b_z]);
    SetPlayerInterior(playerid,0);
    SetPlayerVirtualWorld(playerid,0);
    }
    return 1;
    }



    ocmd:enter(playerid, params[])
    {
    for(new i=0; i<sizeof(bInfo); i++)
    {
    if(!IsPlayerInRangeOfPoint(playerid,2,bInfo[i][b_x],bInfo[i][b_y],bInfo[i][b_z]))continue;
    SetPlayerPos(playerid,bInfo[i][b_ix],bInfo[i][b_iy],bInfo[i][b_iz]);
    SetPlayerInterior(playerid,bInfo[i][b_interior]);
    SetPlayerVirtualWorld(playerid,i);
    return 1;
    }
    return 1;
    }



    ocmd:deletehaus(playerid, params[])
    {
    if(!isAdmin(playerid, 2000))return
    SendClientMessage(playerid, Rot, "Dein Adminrang ist zu niedrig.");
    for(new i=0; i<sizeof(hInfo); i++)
    {
    if(!hInfo[i][h_id])continue;
    if(!IsPlayerInRangeOfPoint(playerid, 5,
    hInfo[i][h_x], hInfo[i][h_y], hInfo[i][h_z]))continue;
    new query[128];
    format(query,sizeof(query),
    "DELETE FROM haus WHERE id='%i'", hInfo[i][h_id]);
    mysql_function_query(dbhandle, query, false, "", "");
    hInfo[i][h_x]=0.0;
    hInfo[i][h_y]=0.0;
    hInfo[i][h_z]=0.0;
    hInfo[i][ih_x]=0.0;
    hInfo[i][ih_y]=0.0;
    hInfo[i][ih_z]=0.0;
    hInfo[i][h_id]=0;
    hInfo[i][h_preis]=0;
    hInfo[i][h_interior]=0;
    if(hInfo[i][h_pickup])
    {
    DestroyPickup(hInfo[i][h_pickup]);
    }
    if(hInfo[i][h_text])
    {
    Delete3DTextLabel(hInfo[i][h_text]);
    }
    return 1;
    }
    return 1;
    }



    ocmd:createhaus(playerid, params[])
    {
    if(!isAdmin(playerid, 2000))return
    SendClientMessage(playerid, Rot, "Dein Adminrang ist zu niedrig.");
    new Float:xc, Float:yc, Float:zc;
    GetPlayerPos(playerid, xc, yc, zc);



    new id=getFreeHausID();
    hInfo[id][h_x]=xc;
    hInfo[id][h_y]=yc;
    hInfo[id][h_z]=zc;
    hInfo[id][ih_x]=0.0;
    hInfo[id][ih_y]=0.0;
    hInfo[id][ih_z]=0.0;
    hInfo[id][h_interior]=0;
    strmid(hInfo[id][h_besitzer], "", 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);
    hInfo[id][h_preis]=15000;
    updateHaus(id);
    //In Datenbank abspeichern
    new query[256];
    format(query, sizeof(query),
    "INSERT INTO haus (h_x, h_y, h_z, ih_x, ih_y, ih_z, h_interior, h_preis) VALUES ('%f', '%f', '%f', '0.0', '0.0', '0.0', '0', '1')",
    xc, yc, zc);
    mysql_function_query(dbhandle, query, true, "OnHausCreated", "i", id);
    return 1;
    }



    ocmd:hausverkaufen(playerid, params[])
    {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    for(new i=0; i<sizeof(hInfo); i++)
    {
    if(!hInfo[i][h_id])continue;
    if(!IsPlayerInRangeOfPoint(playerid, 5,
    hInfo[i][h_x], hInfo[i][h_y], hInfo[i][h_z]))continue;
    if(!strlen(hInfo[i][h_besitzer]))continue;
    if(!strcmp(hInfo[i][h_besitzer], name, true))
    {
    hInfo[i][h_preis]=hInfo[i][h_preis]/2;
    GivePlayerMoney(playerid, hInfo[i][h_preis]);
    strmid(hInfo[i][h_besitzer], "", 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);
    updateHaus(i);
    saveHaus(i);
    return 1;
    }
    }
    return 1;
    }



    ocmd:hauskaufen(playerid, params[])
    {
    if(hatPlayerHaus(playerid))return
    SendClientMessage(playerid, Rot, "Du hast bereits ein Haus.");
    for(new i=0; i<sizeof(hInfo); i++)
    {
    if(!hInfo[i][h_id])continue;
    if(!IsPlayerInRangeOfPoint(playerid, 5,
    hInfo[i][h_x], hInfo[i][h_y], hInfo[i][h_z]))continue;
    if(!strlen(hInfo[i][h_besitzer]))
    {
    if(GetPlayerMoney(playerid)<hInfo[i][h_preis])return
    SendClientMessage(playerid, Rot, "Du hast nicht genügend Geld.");
    GivePlayerMoney(playerid, -hInfo[i][h_preis]);
    strmid(hInfo[i][h_besitzer], getPlayerName(playerid), 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);
    updateHaus(i);
    saveHaus(i);
    return 1;
    }
    return SendClientMessage(playerid, Rot,
    "Das Haus steht nicht zum Verkauf.");
    }
    return 1;
    }



    ocmd:tp(playerid,params[])
    {
    if(!isAdmin(playerid,3))return SendClientMessage(playerid,Rot,"Info: Dein Adminlevel ist zu niedrig!");
    ShowPlayerDialog(playerid,DIALOG_TP,DIALOG_STYLE_LIST,"Wohin willst du dich teleportieren?","Spawn\nBSN","Teleport","Abbrechen");
    return 1;
    }



    ocmd:setadmin(playerid, params[])
    {
    if(!isAdmin(playerid,2000))return SendClientMessage(playerid,Rot,"Info: Dein Adminlevel ist zu niedrig!");
    new a_id,a_level,string[256],aName[MAX_PLAYER_NAME],aName2[MAX_PLAYER_NAME];
    if(sscanf(params,"ui",a_id,a_level))return SendClientMessage(playerid,Rot,"Info: /setadmin [Playerid] [Admin-Level]");
    sInfo[a_id][alevel]=a_level;
    saveplayer(pid);
    GetPlayerName(playerid, aName, sizeof(aName));
    GetPlayerName(a_id, aName2, sizeof(aName2));
    format(string, sizeof(string), "Info: %s hat das Admin-Level von %s auf %d geändert. ",aName, aName2, a_level);
    SendClientMessage(a_id,Türkis,string);
    format(string, sizeof(string), "Info: %s hat das Admin-Level von %s auf %d erfolgreich geändert ",aName, aName2, a_level);
    SendClientMessage(playerid,Türkis,string);
    return 1;
    }




    ocmd:pn(playerid, params[])
    {
    new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
    if(sscanf(params, "us[256]", id, str2))
    {
    SendClientMessage(playerid, Rot, "Info: /pn [Playerid] [Text]");
    return 1;
    }
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, Rot, "Info: Spieler nicht gefunden");
    if(playerid == id) return SendClientMessage(playerid, Rot, "Info: Du kannst dir nicht selber schreiben!");
    {
    GetPlayerName(playerid, Name1, sizeof(Name1));
    GetPlayerName(id, Name2, sizeof(Name2));
    format(str, sizeof(str), "PN von %s (ID %d): %s", Name1, playerid, str2);
    SendClientMessage(id, Grün, str);
    format(str, sizeof(str), "PN zu %s (ID %d): %s", Name2, id, str2);
    SendClientMessage(playerid, Grün, str);
    }
    return 1;
    }




    ocmd:gmx(playerid,parmas[])
    {
    if(!isAdmin(playerid,2000))return SendClientMessage(playerid,Rot,"Dein Adminlevel ist zu niedrig!");
    GameTextForPlayer(playerid,"Server NEUSTART!",2900,3);
    SendClientMessage(playerid,Rot,"Info: Du wurdest gekickt Grund : SERVER NEUSTART!!");
    SetTimer("akick",1000,false);
    return 1;
    }



    isAdmin(playerid,a_level)
    {
    if(sInfo[playerid][alevel]>=a_level)return 1;
    return 0;
    }



    public akick()
    {
    for(new i=0; i<MAX_PLAYERS; i++)
    {
    Kick(i);
    }
    SetTimer("neustart",1300,false);
    return 1;
    }



    public neustart()
    {
    SendRconCommand("gmx");
    return 1;
    }



    public OnPlayerCommandText(playerid, cmdtext[])
    {
    return 1;
    }
    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;
    }



    public OnVehicleStreamOut(vehicleid, forplayerid)
    {
    return 1;
    }



    SetPlayerMoney(playerid,money)
    {
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid,money);
    return 1;
    }



    public OnPasswortCheck(playerid)
    {
    new num_rows,num_fields;
    cache_get_data(num_rows,num_fields,dbhandle);
    if(num_rows==1)
    {
    //Passwort richtig
    sInfo[playerid][eingeloggt] = 1;
    sInfo[playerid][level] = cache_get_field_content_int(0,"level",dbhandle);
    SetPlayerScore(playerid,sInfo[playerid][level]);
    sInfo[playerid][pid] = cache_get_field_content_int(0,"id",dbhandle);
    sInfo[playerid][geld] = cache_get_field_content_int(0,"geld",dbhandle);
    SetPlayerMoney(playerid,sInfo[playerid][geld]);
    sInfo[playerid][alevel] = cache_get_field_content_int(0,"alevel",dbhandle);
    }
    else
    {
    //Passwort falsch
    SendClientMessage(playerid,Rot,"Info: Das eingegebene Passwort ist falsch.");
    SendClientMessage(playerid,Rot,"Info: Hast du dein Passwort vergessen? Dan wende dich an den Support.");
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Status: {C3FF00}Dein Accunt wurde gefunden,warte auf Passworteingabe.","Login","Abbrechen");
    }
    return 1;
    }



    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(dialogid==DIALOG_LOGIN)
    {
    if(response)
    {
    new name[MAX_PLAYER_NAME],query[128],passwort[128];
    GetPlayerName(playerid,name,sizeof(name));
    if(strlen(inputtext)>0)
    {
    mysql_escape_string(inputtext,passwort,dbhandle);
    format(query,sizeof(query),"SELECT * FROM acc WHERE username ='%s'AND passwort= MD5('%s')",name,passwort);
    mysql_function_query(dbhandle,query,true,"OnPasswortCheck","i",playerid);
    }
    else
    {
    //Kein Eingabe
    SendClientMessage(playerid,Rot,"Info: Bitte gibt dein Passwort ein.");
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Status: {C3FF00}Dein Accunt wurde gefunden,warte auf Passworteingabe.","Login","Abbrechen");
    }
    }
    else
    {
    Kick(playerid);
    }
    return 1;
    }
    if(dialogid==DIALOG_REGISTER)
    {
    if(response)
    {
    new name[MAX_PLAYER_NAME],query[128],passwort[128];
    GetPlayerName(playerid,name,sizeof(name));
    if(strlen(inputtext)>3)
    {
    //Registrierungsfunktion
    mysql_escape_string(inputtext,passwort,dbhandle);
    format(query,sizeof(query),"INSERT INTO acc (username,passwort) VALUES('%s',MD5('%s'))",name,passwort);
    mysql_function_query(dbhandle,query,true,"OnPlayerRegister","i",playerid);
    AddPlayerClass(1,681.7202,-473.8583,16.5363,182.6269,0,0,0,0,0,0);

    }
    else
    {
    //Kleiner als 3 Zeichen
    SendClientMessage(playerid,Rot,"Info: Dein Passwort muss mindestens 4 Zeichen lang sein.");
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"Registrierung","{FFFFFF}Bitte wähle ein Passwort um dir einen {00FFFA}Account{FFFFFF} zu erstellen!\n{FFFFFF}Mit der Registrierung stimmst du automatisch unseren {00FFFA}Regeln{FFFFFF} zu.","Registrieren","Abbrechen");
    }
    }
    else
    {
    Kick(playerid);
    }
    return 1;
    }
    if(dialogid==DIALOG_TP)
    {
    if(response)
    {
    if(listitem==0)
    {
    //Spawn
    new tmpcar = GetPlayerVehicleID(playerid);
    SetVehiclePos(tmpcar,697.6049,-473.5656,16.3359);
    LinkVehicleToInterior(tmpcar,0);
    SetPlayerVirtualWorld(playerid,0);
    TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
    SendClientMessage(playerid,Gelb,"Du hast dich erfolgreich zum Spawn geportet.");
    }
    {
    if(listitem==1)
    {
    //BSN
    new tmpcar = GetPlayerVehicleID(playerid);
    SetVehiclePos(tmpcar,1211.8396,-874.5818,42.9138);
    LinkVehicleToInterior(tmpcar,0);
    SetPlayerVirtualWorld(playerid,0);
    TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
    SendClientMessage(playerid,Gelb,"Du hast dich erfolgreich zum BSN geportet.");
    }
    }
    }
    else
    {
    SendClientMessage(playerid,Rot,"Info: Du hast den Vorgang abgebrochen.");
    }
    }
    return 1;
    }




    public OnPlayerClickPlayer(playerid, clickedplayerid, source)
    {
    return 1;
    }

    Hallo zusammen,


    ich versuche gerade mein Script auf Datenbank zu schreiben aber leider kommt mir der Fehler in die Quere.


    im Script :

    //Globale Variablen


    new dbhandle;


    //Datenbank


    #define db_host "127.0.0.1"//
    #define db_user "samp" //
    #define db_pass "T3bbw9VFdQnVAuG6"
    #define db_db "samp" //


    public OnGameModeInit()
    {
    SetGameModeText("CoR-Roleplay");
    AddPlayerClass(1,681.7202,-473.8583,16.5363,182.6269,0,0,0,0,0,0);
    AddStaticVehicle(411,667.9714,-476.4971,16.0630,246.1584,64,1);

    //MySQL

    dbhandle = mysql_connect(db_host,db_user,db_db,db_pass);
    return 1;
    }
    public OnGameModeExit()
    {
    mysql_close(dbhandle);
    return 1;
    }



    im Anhang ist die mysql_log für euch villt könnt ihr mir weiter helfen.
    Vielen Dank :)