Nach register kommt nicht

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
  • Guten Tag


    Ich habe Folgenes Problem, ich habe bei Mogly tutorial video angeschaut zum scripten und verstehe selber nicht voran das legt.


    ich habe keine error und keine warnning aber nach registrerung kommt nicht.




    das ist der code:





    // Kevin-Script



    #include <a_samp>
    #include <a_mysql>
    #include <md5>



    #define MYSQL_HOST "127.0.0.1"
    #define MYSQL_USER "root"
    #define MYSQL_DATA "kevin-script"
    #define MYSQL_PASS ""




    #define Green 0xFF000FF
    #define weiss 0xFFFFFFFF



    new Handle;



    enum playerInfo{
    db_id,
    pEingeloggt,
    pNeuling,
    pAlter,
    pGeschlecht,
    pSkin,
    Float:pRussi,
    Float:pLeben
    }
    new pInfo[MAX_PLAYERS][playerInfo];



    #define DIALOG_REGISTER 1
    #define DIALOG_CHAR1 2
    #define DIALOG_CHAR2 3
    #define DIALOG_CHAR3 4
    #define DIALOG_LOGIN 5









    main()
    {
    print("\n----------------------------------");
    print(" Kevin-Script");
    print("----------------------------------\n");
    }





    public OnGameModeInit()
    {



    SetGameModeText("Kevin-Script");
    Handle=mysql_connect(MYSQL_HOST,MYSQL_USER,MYSQL_DATA,MYSQL_PASS);
    if(mysql_errno() < 1)print("MYSQL: Die Verbindung wurde erfolgreich hergestellt."),
    mysql_log(LOG_ALL);else print("MYSQL: Die Verbindung zum MYSQL Server konnte nicht hergestellt werden.| Server wird herundergefahren.");
    return 1;
    }



    public OnGameModeExit()
    {
    return 1;
    }



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



    public OnPlayerConnect(playerid)
    {
    new query[256];
    mysql_format(Handle, query, sizeof(query),"SELECT * FROM user WHERE Username='%e'",Spielername(playerid));
    mysql_tquery(Handle,query,"UserCheck","i",playerid);
    ClearChat(playerid);
    TogglePlayerSpectating(playerid,1);
    return 1;
    }



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



    public OnPlayerSpawn(playerid)
    {
    SetPlayerVirtualWorld(playerid,0);
    SetCameraBehindPlayer(playerid);
    TogglePlayerControllable(playerid,1);
    if(pInfo[playerid][pNeuling]==1)
    {
    ClearChat(playerid);
    SendClientMessage(playerid,Green,"Es hallt:'Willkommen Am LS-Airport wir wünschen ihnen ein schönen aufenhalt'");
    SetPlayerPos(playerid,1641.8796,-2333.6069,13.5469);
    SetPlayerFacingAngle(playerid,1.0462);
    pInfo[playerid][pNeuling]=0;
    pInfo[playerid][pLeben]=100;
    if(pInfo[playerid][pGeschlecht]==1)
    {
    SetPlayerSkin(playerid,60);
    }
    else
    {
    SetPlayerSkin(playerid,40);
    }
    GameTextForPlayer(playerid,"~y~Willkommen ~n~auf ~n~Den Besten ~g~ Server",6000,40);
    }
    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;
    }



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



    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(dialogid == DIALOG_REGISTER)
    {
    if(!response) return Kick(playerid);
    SetPVarString(playerid,"passwortvar",inputtext);
    if(strlen(inputtext) >= 4)
    {
    ShowPlayerDialog(playerid,DIALOG_CHAR1,DIALOG_STYLE_MSGBOX,"{00FFFA}Charackter 1/3","{FFFFFF}Welche Geschlecht bist du?","{00FFFA}Männlich","{00FFFA}Weiblich");
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"{00FFFA}Neuanfang","{00FFFA}Herzlich Willkommen{FFFFFF},\n{FF0023}Fehler:{FFFFFF} Eingabe ist Falsch \n auf unserem Kevin-Script server bitte gebe ein Password für diessen Account an.","{00FFFA}Weiter","{00FFFA}Abbrechen");
    }

    }
    if(dialogid == DIALOG_CHAR1)
    {
    if(response)
    {
    //männ
    pInfo[playerid][pGeschlecht]=1;
    ShowPlayerDialog(playerid,DIALOG_CHAR2,DIALOG_STYLE_LIST,"{00FFFA}Charackter 2/3","{00AFFF}Hast du die Regeln gelesen?\n{00FF14}Ja\n{FF002D}Nein\n{F000FF}Was es gibt Regeln?","{00FFFA}Weiter","{00FFFA}Abbrechen");
    }
    else
    {
    //weib
    pInfo[playerid][pGeschlecht]=2;
    ShowPlayerDialog(playerid,DIALOG_CHAR2,DIALOG_STYLE_LIST,"{00FFFA}Charackter 2/3","{00AFFF}Hast du die Regeln gelesen?\n{00FF14}Ja\n{FF002D}Nein\n{F000FF}Was es gibt Regeln?","{00FFFA}Weiter","{00FFFA}Abbrechen");



    }
    }
    if(dialogid == DIALOG_CHAR2)
    {
    if(response)
    {
    if(listitem==0)
    {
    ShowPlayerDialog(playerid,DIALOG_CHAR2,DIALOG_STYLE_LIST,"{00FFFA}Charackter 2/3","{00AFFF}Hast du die Regeln gelesen?\n{00FF14}Ja\n{FF002D}Nein\n{F000FF}Was es gibt Regeln?","{00FFFA}Weiter","{00FFFA}Abbrechen");
    }
    if(listitem==1)
    {
    Kick(playerid);
    }
    if(listitem==2)
    {
    Kick(playerid);
    }
    if(listitem==3)
    {
    ShowPlayerDialog(playerid,DIALOG_CHAR3,DIALOG_STYLE_INPUT,"{00FFFA}Charackter 3/3","{FFFFFF}Gebe nun dein alter an","{00FFFA}Weiter","{00FFFA}Abbrechen");
    }



    }
    else
    {Kick(playerid);}




    }
    if(dialogid == DIALOG_CHAR3)
    {
    if(response)
    {
    if (IsNummeric(inputtext))
    {
    //new alterabfrage=strval(inputtext);
    if(strval(inputtext)>=18 && strval (inputtext) <=48)
    {
    pInfo[playerid][pAlter]=strval (inputtext);
    pInfo[playerid][pEingeloggt]=1;
    pInfo[playerid][pNeuling]=1;
    new query[256],passworteingabe[128];
    GetPVarString(playerid,"passwortvar",passworteingabe,128);
    mysql_format(Handle, query, sizeof(query), "INSERT INTO user (Username, Passwort) VALUES ('%e',MD5('%e'))",Spielername(playerid),passworteingabe);
    mysql_function_query(Handle,query,true,"OnplayerRegister", "i",playerid);
    printf("%s",query);

    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_CHAR3,DIALOG_STYLE_INPUT,"{00FFFA}Charackter 3/3","\n{FF0023}Fehler:{FFFFFF} Eingabe ist Falsch\n{FFFFFF}Gebe nun dein alter an","{00FFFA}Weiter","{00FFFA}Abbrechen");



    }
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_CHAR3,DIALOG_STYLE_INPUT,"{00FFFA}Charackter 3/3","\n{FF0023}Fehler:{FFFFFF} Eingabe ist Falsch\n{FFFFFF}Gebe nun dein alter an","{00FFFA}Weiter","{00FFFA}Abbrechen");
    }
    }
    else
    {Kick(playerid);}




    }
    return 1;
    }



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




    forward UserCheck(playerid);
    public UserCheck(playerid)
    {
    new num_rows, num_fields;
    cache_get_data(num_rows,num_fields,Handle);
    SetPlayerVirtualWorld(playerid,1);
    if(num_rows == 0)
    {
    //reg
    ClearChat(playerid);
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"{00FFFA}Neuanfang","{00FFFA}Herzlich Willkommen{FFFFFF},\n auf unserem Kevin-Script server bitte gebe ein Password für diessen Account an.","{00FFFA}Weiter","{00FFFA}Abbrechen");
    }
    else
    {
    //log
    ClearChat(playerid);
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"{00FFFA}Einloggen","{00FFFA}Willkommen zurück{FFFFFF},\n auf unserem Kevin-Script server bitte gebe dein Password für diessen Account an.","{00FFFA}Weiter","{00FFFA}Abbrechen");



    }
    return 1;
    }




    forward OnPlayerRegister(playerid);
    public OnPlayerRegister(playerid)
    {
    pInfo[playerid][db_id]=cache_insert_id(Handle);
    TogglePlayerSpectating(playerid,0);
    SpawnPlayer(playerid);
    SetCameraBehindPlayer(playerid);
    return 1;
    }





    stock Spielername(playerid)
    {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    return name;
    }
    stock ClearChat(playerid)
    {
    for(new i = 0;i<100;i++)
    {

    SendClientMessage(playerid,weiss,"");
    }
    return 1;
    }
    stock IsNummeric(string[])
    {
    for(new i=0,j=strlen(string);i<j;i++)
    {
    if((string[i] > '9' || string[i] < '0'))return 0;



    }
    return 1;
    }


    aber weiß nicht voran das liegt..

  • Zeig uns die Server log und MySql log

  • Zeig uns die Server log und MySql log

    Serverlog


    ----------
    Loaded log file: "server_log.txt".
    ----------



    SA-MP Dedicated Server
    ----------------------
    v0.3.DL-R1, (C)2005-2018 SA-MP Team



    [20:09:50] filterscripts = "" (string)
    [20:09:50]
    [20:09:50] Server Plugins
    [20:09:50] --------------
    [20:09:50] Loading plugin: mysql.dll
    [20:09:50] >> plugin.mysql: R39-3 successfully loaded.
    [20:09:50] Loaded.
    [20:09:50] Loaded 1 plugins.



    [20:09:50] [artwork:crc] lvpdpc2.dff CRC = 0xFBD1EA7C
    [20:09:50] [artwork:crc] lvpdpc2.txd CRC = 0xDC92731E
    [20:09:51] [artwork:crc] lapdpd2.dff CRC = 0xA558D422
    [20:09:51] [artwork:crc] lapdpd2.txd CRC = 0xA442E2DA
    [20:09:51] [artwork:crc] wallzzz.dff CRC = 0x4BC6EDFF
    [20:09:51] [artwork:crc] wallzzz.txd CRC = 0x235E3EEB
    [20:09:51]
    [20:09:51] Filterscripts
    [20:09:51] ---------------
    [20:09:51] Loaded 0 filterscripts.



    [20:09:51] MYSQL: Die Verbindung wurde erfolgreich hergestellt.
    [20:09:51]
    ----------------------------------
    [20:09:51] Kevin-Script
    [20:09:51] ----------------------------------



    [20:09:51] Number of vehicle models: 0


    mysql_log

    [20:09:51] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
    [20:09:51] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
    [20:09:51] [DEBUG] CMySQLConnection::Connect - connection was successful
    [20:09:51] [DEBUG] CMySQLConnection::Connect - connection was successful
    [20:09:51] [DEBUG] CMySQLConnection::Connect - connection was successful
    [20:09:51] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
    [20:09:51] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled

  • Und jetzt erkläre was nicht funktioniert?
    Spawnt dein Spieler nicht oder was passiert genau nach dem registrieren?

  • Da ich dich schon etwas kenne schau mal hier,
    mysql_function_query(Handle,query,true,"OnplayerRegister", "i",playerid);


    das OnplayerRegister musst du groß schreiben laut deinem public

    forward OnPlayerRegister(playerid);
    public OnPlayerRegister(playerid)
    {....


    also so dann


    mysql_function_query(Handle,query,true,"OnPlayerRegister", "i",playerid);
    solltest dann eig. Spawnen.
    Mfg. Mogly1

  • moin.
    Habe gerade gemacht aber leider ohne erfolgt.

  • Bitte mal den bisherigen Code zeigen, OnPlayerRegister mal printen und uns die Server-Log zeigen, nach der Registrierung.

    forward OnPlayerRegister(playerid);
    public OnPlayerRegister(playerid)
    {
    pInfo[playerid][db_id]=cache_insert_id(Handle);
    TogglePlayerSpectating(playerid,0);
    print("OnPlayerRegister aufgerufen");
    SpawnPlayer(playerid);
    SetCameraBehindPlayer(playerid);
    return 1;
    }

  • Bitte mal den bisherigen Code zeigen, OnPlayerRegister mal printen und uns die Server-Log zeigen, nach der Registrierung.
    forward OnPlayerRegister(playerid);public OnPlayerRegister(playerid){pInfo[playerid][db_id]=cache_insert_id(Handle);TogglePlayerSpectating(playerid,0);print("OnPlayerRegister aufgerufen");SpawnPlayer(playerid);SetCameraBehindPlayer(playerid);return 1;}

    ok da ist der code:




    forward OnPlayerRegister(playerid);
    public OnPlayerRegister(playerid)
    {
    pInfo[playerid][db_id]=cache_insert_id(Handle);
    TogglePlayerSpectating(playerid,0);
    SpawnPlayer(playerid);
    SetCameraBehindPlayer(playerid);
    return 1;
    }

  • server log:



    ----------
    Loaded log file: "server_log.txt".
    ----------



    SA-MP Dedicated Server
    ----------------------
    v0.3.DL-R1, (C)2005-2018 SA-MP Team



    [15:50:12] filterscripts = "" (string)
    [15:50:12]
    [15:50:12] Server Plugins
    [15:50:12] --------------
    [15:50:12] Loading plugin: mysql.dll
    [15:50:12] >> plugin.mysql: R39-3 successfully loaded.
    [15:50:12] Loaded.
    [15:50:12] Loaded 1 plugins.



    [15:50:12]
    [15:50:12] Filterscripts
    [15:50:12] ---------------
    [15:50:12] Loaded 0 filterscripts.



    [15:50:12] MYSQL: Die Verbindung wurde erfolgreich hergestellt.
    [15:50:12]
    ----------------------------------
    [15:50:12] Kevin-Script
    [15:50:12] ----------------------------------



    [15:50:12] Number of vehicle models: 0
    [15:50:34] [connection] incoming connection: 127.0.0.1:54757 id: 0
    [15:50:34] [join] ShadowKev1999 has joined the server (0:127.0.0.1)
    [15:50:42] [part] ShadowKev1999 has left the server (0:1)
    [15:51:39] [connection] incoming connection: 127.0.0.1:55250 id: 0
    [15:51:39] [join] ShadowKev1999 has joined the server (0:127.0.0.1)
    [15:52:26] INSERT INTO user (Username, Passwort) VALUES ('ShadowKev1999',MD5('kevin7372'))
    [15:52:26] OnPlayerRegister aufgerufen
    [15:52:37] [part] ShadowKev1999 has left the server (0:1)




    code:
    // Kevin-Script



    #include <a_samp>
    #include <a_mysql>
    #include <md5>



    #define MYSQL_HOST "127.0.0.1"
    #define MYSQL_USER "root"
    #define MYSQL_DATA "kevin-script"
    #define MYSQL_PASS ""




    #define Green 0xFF000FF
    #define weiss 0xFFFFFFFF



    new Handle;



    enum playerInfo{
    db_id,
    pEingeloggt,
    pNeuling,
    pAlter,
    pGeschlecht,
    pSkin,
    Float:pRussi,
    Float:pLeben
    }
    new pInfo[MAX_PLAYERS][playerInfo];



    #define DIALOG_REGISTER 1
    #define DIALOG_CHAR1 2
    #define DIALOG_CHAR2 3
    #define DIALOG_CHAR3 4
    #define DIALOG_LOGIN 5









    main()
    {
    print("\n----------------------------------");
    print(" Kevin-Script");
    print("----------------------------------\n");
    }





    public OnGameModeInit()
    {



    SetGameModeText("Kevin-Script");
    Handle=mysql_connect(MYSQL_HOST,MYSQL_USER,MYSQL_DATA,MYSQL_PASS);
    if(mysql_errno() < 1)print("MYSQL: Die Verbindung wurde erfolgreich hergestellt."),
    mysql_log(LOG_ALL);else print("MYSQL: Die Verbindung zum MYSQL Server konnte nicht hergestellt werden.| Server wird herundergefahren.");
    return 1;
    }



    public OnGameModeExit()
    {
    return 1;
    }



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



    public OnPlayerConnect(playerid)
    {
    new query[256];
    mysql_format(Handle, query, sizeof(query),"SELECT * FROM user WHERE Username='%e'",Spielername(playerid));
    mysql_tquery(Handle,query,"UserCheck","i",playerid);
    ClearChat(playerid);
    TogglePlayerSpectating(playerid,1);
    return 1;
    }



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



    public OnPlayerSpawn(playerid)
    {
    SetPlayerVirtualWorld(playerid,0);
    SetCameraBehindPlayer(playerid);
    TogglePlayerControllable(playerid,1);
    if(pInfo[playerid][pNeuling]==1)
    {
    ClearChat(playerid);
    SendClientMessage(playerid,Green,"Es hallt:'Willkommen Am LS-Airport wir wünschen ihnen ein schönen aufenhalt'");
    SetPlayerPos(playerid,1644.8492,-2330.6609,13.5469);
    SetPlayerFacingAngle(playerid,355.8113);
    pInfo[playerid][pNeuling]=0;
    pInfo[playerid][pLeben]=100;
    if(pInfo[playerid][pGeschlecht]==1)
    {
    SetPlayerSkin(playerid,60);
    }
    else
    {
    SetPlayerSkin(playerid,40);
    }
    GameTextForPlayer(playerid,"~y~Willkommen ~n~auf ~n~Den Besten ~g~ Server",6000,40);
    }
    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;
    }



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



    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(dialogid == DIALOG_REGISTER)
    {
    if(!response) return Kick(playerid);
    SetPVarString(playerid,"passwortvar",inputtext);
    if(strlen(inputtext) >= 4)
    {
    ShowPlayerDialog(playerid,DIALOG_CHAR1,DIALOG_STYLE_MSGBOX,"{00FFFA}Charackter 1/3","{FFFFFF}Welche Geschlecht bist du?","{00FFFA}Männlich","{00FFFA}Weiblich");
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"{00FFFA}Neuanfang","{00FFFA}Herzlich Willkommen{FFFFFF},\n{FF0023}Fehler:{FFFFFF} Eingabe ist Falsch \n auf unserem Kevin-Script server bitte gebe ein Password für diessen Account an.","{00FFFA}Weiter","{00FFFA}Abbrechen");
    }

    }
    if(dialogid == DIALOG_CHAR1)
    {
    if(response)
    {
    //männ
    pInfo[playerid][pGeschlecht]=1;
    ShowPlayerDialog(playerid,DIALOG_CHAR2,DIALOG_STYLE_LIST,"{00FFFA}Charackter 2/3","{00AFFF}Hast du die Regeln gelesen?\n{00FF14}Ja\n{FF002D}Nein\n{F000FF}Was es gibt Regeln?","{00FFFA}Weiter","{00FFFA}Abbrechen");
    }
    else
    {
    //weib
    pInfo[playerid][pGeschlecht]=2;
    ShowPlayerDialog(playerid,DIALOG_CHAR2,DIALOG_STYLE_LIST,"{00FFFA}Charackter 2/3","{00AFFF}Hast du die Regeln gelesen?\n{00FF14}Ja\n{FF002D}Nein\n{F000FF}Was es gibt Regeln?","{00FFFA}Weiter","{00FFFA}Abbrechen");



    }
    }
    if(dialogid == DIALOG_CHAR2)
    {
    if(response)
    {
    if(listitem==0)
    {
    ShowPlayerDialog(playerid,DIALOG_CHAR2,DIALOG_STYLE_LIST,"{00FFFA}Charackter 2/3","{00AFFF}Hast du die Regeln gelesen?\n{00FF14}Ja\n{FF002D}Nein\n{F000FF}Was es gibt Regeln?","{00FFFA}Weiter","{00FFFA}Abbrechen");
    }
    if(listitem==1)
    {
    Kick(playerid);
    }
    if(listitem==2)
    {
    Kick(playerid);
    }
    if(listitem==3)
    {
    ShowPlayerDialog(playerid,DIALOG_CHAR3,DIALOG_STYLE_INPUT,"{00FFFA}Charackter 3/3","{FFFFFF}Gebe nun dein alter an","{00FFFA}Weiter","{00FFFA}Abbrechen");
    }



    }
    else
    {Kick(playerid);}




    }
    if(dialogid == DIALOG_CHAR3)
    {
    if(response)
    {
    if (IsNummeric(inputtext))
    {
    //new alterabfrage=strval(inputtext);
    if(strval(inputtext)>=18 && strval (inputtext) <=48)
    {
    pInfo[playerid][pAlter]=strval (inputtext);
    pInfo[playerid][pEingeloggt]=1;
    pInfo[playerid][pNeuling]=1;
    new query[256],passworteingabe[128];
    GetPVarString(playerid,"passwortvar",passworteingabe,128);
    mysql_format(Handle, query, sizeof(query), "INSERT INTO user (Username, Passwort) VALUES ('%e',MD5('%e'))",Spielername(playerid),passworteingabe);
    TogglePlayerSpectating(playerid,0);
    mysql_function_query(Handle,query,true,"OnPlayerRegister", "i",playerid);
    printf("%s",query);

    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_CHAR3,DIALOG_STYLE_INPUT,"{00FFFA}Charackter 3/3","\n{FF0023}Fehler:{FFFFFF} Eingabe ist Falsch\n{FFFFFF}Gebe nun dein alter an","{00FFFA}Weiter","{00FFFA}Abbrechen");



    }
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_CHAR3,DIALOG_STYLE_INPUT,"{00FFFA}Charackter 3/3","\n{FF0023}Fehler:{FFFFFF} Eingabe ist Falsch\n{FFFFFF}Gebe nun dein alter an","{00FFFA}Weiter","{00FFFA}Abbrechen");
    }
    }
    else
    {Kick(playerid);}




    }
    return 1;
    }



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




    forward UserCheck(playerid);
    public UserCheck(playerid)
    {
    new num_rows, num_fields;
    cache_get_data(num_rows,num_fields,Handle);
    SetPlayerVirtualWorld(playerid,1);
    if(num_rows == 0)
    {
    //reg
    ClearChat(playerid);
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"{00FFFA}Neuanfang","{00FFFA}Herzlich Willkommen{FFFFFF},\n auf unserem Kevin-Script server bitte gebe ein Password für diessen Account an.","{00FFFA}Weiter","{00FFFA}Abbrechen");
    }
    else
    {
    //log
    ClearChat(playerid);
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"{00FFFA}Einloggen","{00FFFA}Willkommen zurück{FFFFFF},\n auf unserem Kevin-Script server bitte gebe dein Password für diessen Account an.","{00FFFA}Weiter","{00FFFA}Abbrechen");



    }
    return 1;
    }




    forward OnPlayerRegister(playerid);
    public OnPlayerRegister(playerid)
    {
    pInfo[playerid][db_id]=cache_insert_id(Handle);
    TogglePlayerSpectating(playerid,0);
    print("OnPlayerRegister aufgerufen");
    SpawnPlayer(playerid);
    SetCameraBehindPlayer(playerid);
    return 1;
    }





    stock Spielername(playerid)
    {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    return name;
    }
    stock ClearChat(playerid)
    {
    for(new i = 0;i<100;i++)
    {

    SendClientMessage(playerid,weiss,"");
    }
    return 1;
    }
    stock IsNummeric(string[])
    {
    for(new i=0,j=strlen(string);i<j;i++)
    {
    if((string[i] > '9' || string[i] < '0'))return 0;



    }
    return 1;
    }

  • jetzt spawn der aber der spawn pung kann er nicht finden weil der fählt duch boden dan spawn der in ein dorf.


    er soll eigelich am ls flughafen spawnen aber tut er nicht.

  • Zeig deine OnPlayerSpawn Funktion bitte.


    ok da ist der OnPlayerSpawn code



    public OnPlayerSpawn(playerid)
    {
    SetPlayerVirtualWorld(playerid,0);
    SetCameraBehindPlayer(playerid);
    TogglePlayerControllable(playerid,1);
    if(pInfo[playerid][pNeuling]==1)
    {
    ClearChat(playerid);
    SendClientMessage(playerid,Green,"Es hallt:'Willkommen Am LS-Airport wir wünschen ihnen ein schönen aufenhalt'");
    SetPlayerPos(playerid,1644.8492,-2330.6609,13.5469);
    SetPlayerFacingAngle(playerid,355.8113);
    pInfo[playerid][pNeuling]=0;
    pInfo[playerid][pLeben]=100;
    if(pInfo[playerid][pGeschlecht]==1)
    {
    SetPlayerSkin(playerid,60);
    }
    else
    {
    SetPlayerSkin(playerid,40);
    }
    GameTextForPlayer(playerid,"~y~Willkommen ~n~auf ~n~Den Besten ~g~ Server",6000,40);
    }
    return 1;
    }

  • Ist der Spieler denn ein Neuling?


    Lass dir mal die Server-Log hierbei ausgeben.
    public OnPlayerSpawn(playerid)
    {
    SetPlayerVirtualWorld(playerid,0);
    SetCameraBehindPlayer(playerid);
    TogglePlayerControllable(playerid,1);
    if(pInfo[playerid][pNeuling]==1)
    {
    ClearChat(playerid);
    SendClientMessage(playerid,Green,"Es hallt:'Willkommen Am LS-Airport wir wünschen ihnen ein schönen aufenhalt'");
    SetPlayerPos(playerid,1644.8492,-2330.6609,13.5469);
    SetPlayerFacingAngle(playerid,355.8113);
    pInfo[playerid][pNeuling]=0;
    pInfo[playerid][pLeben]=100;
    if(pInfo[playerid][pGeschlecht]==1)
    {
    SetPlayerSkin(playerid,60);
    }
    else
    {
    SetPlayerSkin(playerid,40);
    }
    GameTextForPlayer(playerid,"~y~Willkommen ~n~auf ~n~Den Besten ~g~ Server",6000,40);
    }
    printf("%d", pInfo[playerid][pNeuling]);
    return 1;
    }