- 0
Problema Server.
-
Similar Content
-
- 5 replies
- 996 views
-
- 8 replies
- 720 views
-
- 1 reply
- 332 views
-
- 1 reply
- 428 views
-
- 0 replies
- 250 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.

Question
SkyLeAs
Problema intalnita (descriere):Salut am o problema cand pun in gamemode #include si zcmd nu imi mai merge serverul nu mai apare register login iar cand le scot merge perfect totul. Ero(area / rile) / warning-(ul / urile): In server log imi da asta
#include #include #include #include //****************************************************************************** #define mysql_host "localhost" #define mysql_db "zp_rxs2015" #define mysql_user "zp_rxs2015" #define mysql_pass "zp_rxs2015" //****************************************************************************** enum { DIALOG_LOGIN, DIALOG_REGISTER }; //****************************************************************************** enum pInfo { pParola, pID }; //****************************************************************************** new PlayerInfo[MAX_PLAYERS][pInfo]; new handle; //****************************************************************************** forward MySQLConnect(); forward OnPlayerLogin(playerid); forward OnLogin(playerid); //****************************************************************************** main() { print("\n----------------------------------"); print(" RXS - Loading\n"); print("----------------------------------\n"); } //****************************************************************************** public MySQLConnect() { handle = mysql_connect(mysql_host, mysql_user, mysql_db, mysql_pass); if(mysql_errno() != 0) { printf("Conexiunea la baza de date %s a esuat ---> Server Inchis ~~~", mysql_db); SendRconCommand("exit"); } else { printf("Conexiunea la baza de date '%s' cu user-ul '%s' a reusit!!!", mysql_db, mysql_user); } return 1; } //****************************************************************************** public OnPlayerCommandText(playerid, cmdtext[]) { //-------------------------------------------------------------------------- return 0; } //****************************************************************************** public OnPlayerSpawn(playerid) { SetPlayerInterior(playerid,0); TogglePlayerClock(playerid,0); return 1; } public OnPlayerDeath(playerid, killerid, reason) { return 1; } //****************************************************************************** SetupPlayerForClassSelection(playerid) { SetPlayerInterior(playerid,14); SetPlayerPos(playerid,258.4893,-41.4008,1002.0234); SetPlayerFacingAngle(playerid, 270.0); SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234); SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234); } //****************************************************************************** public OnPlayerRequestClass(playerid, classid) { SetupPlayerForClassSelection(playerid); return 1; } //****************************************************************************** public OnGameModeInit() { SetGameModeText("Drift/Stunt/Race/DM"); ShowPlayerMarkers(1); ShowNameTags(1); AllowAdminTeleport(1); //-------------------------------------------------------------------------- MySQLConnect(); //-------------------------------------------------------------------------- AddPlayerClass(265,1958.3783,1343.1572,15.3746,270.1425,0,0,0,0,-1,-1); return 1; } //****************************************************************************** stock GetName(playerid) { new Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, Name, sizeof(Name)); return Name; } //****************************************************************************** public OnPlayerLogin(playerid) { new rows, fields; cache_get_data(rows, fields); if(rows) { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Logheaza-te!", "Te rog sa-ti introduci parola contuului mai jos!", "Logare", "Exit"); } else { ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Inregistrare", "Trebuie sa iti creezi un cont ca sa joci pe server. nTasteaza mai jos o parola, pentru a te inregistra!", "Inregistreaza", "Exit"); } return 1; } //****************************************************************************** public OnPlayerConnect(playerid) { new query[100]; mysql_format(handle, query, sizeof(query), "SELECT * FROM Players WHERE Name = '%s'", GetName(playerid)); mysql_tquery(handle, query, "OnPlayerLogin", "i", playerid); return 1; } //****************************************************************************** public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { new query[128], ip[25]; switch(dialogid) { case DIALOG_REGISTER: { if(!response) return Kick(playerid); if(response) { if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Parola incorecta!", "Introdu-ti o parola pentru a te inregistra pe server! n", "Inregistreaza", "Exit"); GetPlayerIp(playerid, ip, sizeof(ip)); mysql_format(handle, query, sizeof(query), "INSERT INTO Players (Name, Passowrd, IP) VALUES ('%s', '%e', '%s')", GetName(playerid), inputtext, ip); mysql_query(handle, query); ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Logheaza-te!", "Te rog sa-ti introduci parola contuului mai jos!", "Logare", "Exit"); } return 1; } case DIALOG_LOGIN: { if(!response) return Kick(playerid); if(response) { if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Parola incorecta!", "Te rog sa iti introduci parola corecta, pentru a te loga pe server.", "Logare", "Exit"); mysql_format(handle, query, sizeof(query), "SELECT * FROM Players WHERE Passowrd = '%e' LIMIT 0,1", inputtext); mysql_tquery(handle, query, "OnLogin", "i", playerid); } return 1; } } return 1; } //****************************************************************************** public OnLogin(playerid) { new rows, fields,temporar[200]; cache_get_data(rows, fields); if(rows) { PlayerInfo[playerid][pParola] = cache_get_field_content(0, "Passowrd",temporar); PlayerInfo[playerid][pID] = cache_get_field_content_int(0, "ID"); SpawnPlayer(playerid); } else { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Parola incorecta!", "Te rog sa iti introduci parola corecta, pentru a te loga pe server.", "Logare", "Exit"); } return 1; } //****************************************************************************** public OnGameModeExit() { mysql_close( handle ) ; return 1; }1 answer to this question
Recommended Posts