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
----------
Loaded log file: "server_log.txt".
----------
SA-MP Dedicated Server
----------------------
v0.3.7, (C)2005-2015 SA-MP Team
[12:14:06] filterscripts = "" (string)
[12:14:06]
[12:14:06] Server Plugins
[12:14:06] --------------
[12:14:06] Loading plugin: sscanf
[12:14:06]
[12:14:06] ===============================
[12:14:06] sscanf plugin loaded.
[12:14:06] Version: 2.8.1
[12:14:06] (c) 2012 Alex "Y_Less" Cole
[12:14:06] ===============================
[12:14:06] Loaded.
[12:14:06] Loading plugin: mysql
[12:14:06] >> plugin.mysql: R34 successfully loaded.
[12:14:06] Loaded.
[12:14:06] Loading plugin: crashdetect
[12:14:06] crashdetect v4.7.2 is OK.
[12:14:06] Loaded.
[12:14:06] Loaded 3 plugins.
[12:14:07]
[12:14:07] Filterscripts
[12:14:07] ---------------
[12:14:07] Loaded 0 filterscripts.
[12:14:07] AllowAdminTeleport() : function is deprecated. Please see OnPlayerClickMap()
[12:14:07] Conexiunea la baza de date 'zp_rxs2015' cu user-ul 'zp_rxs2015' a reusit!!!
[12:14:07]
----------------------------------
[12:14:07] RXS - Loading
[12:14:07] ----------------------------------
[12:14:07] Number of vehicle models: 0
[12:14:09] --- Server Shutting Down.
[12:14:09]
[12:14:09] ===============================
[12:14:09] sscanf plugin unloaded.
[12:14:09] ===============================
[12:14:09] plugin.mysql: Unloading plugin...
[12:14:09] plugin.mysql: Plugin unloaded.
Liniile de cod / sursa / script-ul(obligatoriu):
#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;
}
Imagini / Video (optional):N/a
Ati incercat sa rezolvati singur?:Da am incercat am facut update la includes plugins etc si nimic am incercat si cu versiuni mai vechi. Si nimic la fel.
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
1 answer to this question
Recommended Posts