07.12.2011, 23:56
Hey,
I have recently discovered an issue with my script, when a player connects and try to register they get disconnected, I currently use MySQL on my server and have no problems with home host, it is only when i upload to volt-host.com, also my PlayerInfo vars are not working correct, could this be something to do with Linux?
OnPlayerConnect:
Testmode is currently defined in the GameModeInit section
MySQL Parts:
PlayerInfo:
If you need anymore code then please tell me also he said he gets the error of "Lost Connection To The Server"
This has only been tested on 1 person if anyone could test for me please reply.
Thanks in advance
Sorry for the length of the thread.
-Michael
I have recently discovered an issue with my script, when a player connects and try to register they get disconnected, I currently use MySQL on my server and have no problems with home host, it is only when i upload to volt-host.com, also my PlayerInfo vars are not working correct, could this be something to do with Linux?
OnPlayerConnect:
pawn Код:
public OnPlayerConnect(playerid)
{
if(TestMode == 1 && PlayerInfo[playerid][pAdminLevel] == 0)
{
SendClientMessage(playerid,COLOR_RED,"** Server Is Currently In Testing.");
Kick(playerid);
return 1;
}
else if(TestMode == 1 && PlayerInfo[playerid][pAdminLevel] >= 1)
{
SendClientMessage(playerid,COLOR_YELLOW,"** Server Is Currently In Testing");
SendClientMessage(playerid,COLOR_YELLOW,"** The Server Is Currently In Lock Down Administrator");
return 1;
}
else
{
new name[MAX_PLAYER_NAME],string[128];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
format(string,sizeof(string),"** %s Has Joined Los Santos Cops And Robbers!",name);
SendClientMessageToAll(COLOR_GREY,string);
}
return 1;
}
pawn Код:
TestMode = 0;
pawn Код:
public OnQueryError(errorid, error[], resultid, extraid, callback[], query[], connectionHandle) return printf(" MySQL ERROR: errorid: %d | error: %s | resultid: %d | extraid: %d | callback: %s | query: %s", errorid, error, resultid, extraid, callback, query);
public OnQueryFinish(query[], resultid, extraid, connectionHandle) // this is for threaded SQL queries
{
switch(resultid)
{
case qDefault: return 1;
case qAuthentication:
{
mysql_store_result();
if(mysql_num_rows() == 1)
{
new szResult[500];
while(mysql_fetch_row_format(szResult, "|"))
{
sscanf(szResult, "e<p<|>s[25]s[30]ddddddddddddddffdddd", PlayerInfo[extraid]);
SPD(extraid, diagAuthentication);
}
}
else if(mysql_num_rows() < 1) SPD(extraid, diagRegistration);
else SendClientMessage(extraid, COLOR_RED, "There appears to be a problem in our database, please contact an administrator.");
mysql_free_result();
}
}
return 1;
}
pawn Код:
enum E_PLAYER_INFO
{
pUsername[25],
pPassword[31],
pAdminLevel,
pDonator,
pCheater,
pBanned,
pMuted,
pTimesRobbed,
pRobbed,
pWantedLevelsGained,
pWantedLevel,
pKills,
pDeaths,
pScore,
pCash,
pArmour,
pHealth,
pJailed,
pPrisoned,
pLastOnline,
pTimeOnline
};
new PlayerInfo[MAX_PLAYERS][E_PLAYER_INFO];
This has only been tested on 1 person if anyone could test for me please reply.
Thanks in advance
Sorry for the length of the thread.
-Michael