Meine Account Datenbank sieht so aus:
Id
Name
password
Adminlevel
Level
Money
Fraktion
Rang
Spawn
Meine Account Datenbank sieht so aus:
Id
Name
password
Adminlevel
Level
Money
Fraktion
Rang
Spawn
Guten Abend Breadfish
Ich habe mich an ein Fraktionssystem gesetzt und habe gemerkt das die Fraktion nicht in die Datenbank abgespeichert wird.
Mysql_Log:
[10/12/16 21:49:25] [INFO] changed log level from 'warning, error' to 'debug, info, warning, error'
[10/12/16 21:55:26] [DEBUG] mysql_format(1, 0xF5416730, 128, "SELECT id FROM Accounts WHERE Name = '%e'") (Nitradoscript.p:264)
[10/12/16 21:55:26] [DEBUG] CHandle::EscapeString(this=0x8b5aab0, src='Tiriago')
[10/12/16 21:55:26] [DEBUG] CConnection::EscapeString(src='Tiriago', this=0x8c4b6d0, connection=0x8ccc178)
[10/12/16 21:55:26] [DEBUG] CHandle::EscapeString - return value: true, escaped string: 'Tiriago'
[10/12/16 21:55:26] [DEBUG] mysql_format: return value: '46' (Nitradoscript.p:264)
[10/12/16 21:55:26] [DEBUG] mysql_pquery(1, "SELECT id FROM Accounts WHERE Name = 'Tiriago'", "OnUserCheck", "d") (Nitradoscript.p:265)
[10/12/16 21:55:26] [DEBUG] CCallback::Create(amx=0x8ccbd38, name='OnUserCheck', format='d', params=0xf5416718, param_offset=5)
[10/12/16 21:55:26] [DEBUG] CCallback::Create - callback index for 'OnUserCheck': 32
[10/12/16 21:55:26] [DEBUG] processing specifier 'd' with parameter index 0
[10/12/16 21:55:26] [DEBUG] retrieved and pushed value '0'
[10/12/16 21:55:26] [INFO] Callback 'OnUserCheck' set up for delayed execution.
[10/12/16 21:55:26] [DEBUG] created delayed callback with 1 parameter
[10/12/16 21:55:26] [DEBUG] CHandle::Execute(this=0x8b5aab0, type=2, query=0x8d1b020)
[10/12/16 21:55:26] [DEBUG] CConnectionPool::Queue(query=0x8d1b020, this=0x8c52490)
[10/12/16 21:55:26] [DEBUG] CConnection::Execute(query=0x8d1b020, this=0xf4aeb008, connection=0x8cf2af8)
[10/12/16 21:55:26] [DEBUG] CQuery::Execute(this=0x8d1b020, connection=0x8cf2af8)
[10/12/16 21:55:26] [DEBUG] CHandle::Execute - return value: true
[10/12/16 21:55:26] [DEBUG] mysql_pquery: return value: '1' (Nitradoscript.p:265)
[10/12/16 21:55:26] [INFO] query "SELECT id FROM Accounts WHERE Name = 'Tiriago'" successfully executed within 0.309 milliseconds
[10/12/16 21:55:26] [DEBUG] CResultSet::Create(connection=0x8cf2af8, query_str='SELECT id FROM Accounts WHERE Name = 'Tiriago'')
[10/12/16 21:55:26] [DEBUG] created new resultset '0xf4100688'
[10/12/16 21:55:26] [DEBUG] fetched MySQL result '0xf41008e0'
[10/12/16 21:55:26] [DEBUG] allocated 20 bytes for PAWN result
[10/12/16 21:55:26] [DEBUG] CCallback::Execute(amx=0x8ccbd38, index=32, num_params=1)
[10/12/16 21:55:26] [INFO] Executing callback 'OnUserCheck' with 1 parameter...
[10/12/16 21:55:26] [DEBUG] processing internal specifier 'c'
[10/12/16 21:55:26] [DEBUG] pushed value '0' onto AMX stack
[10/12/16 21:55:26] [DEBUG] executing AMX callback with index '32'
[10/12/16 21:55:26] [DEBUG] cache_get_row_count(0xF5416930) (Nitradoscript.p:290)
[10/12/16 21:55:26] [DEBUG] cache_get_row_count: return value: '1' (Nitradoscript.p:290)
[10/12/16 21:55:26] [DEBUG] AMX callback executed with error '0'
[10/12/16 21:55:26] [INFO] Callback successfully executed.
[10/12/16 21:55:31] [DEBUG] mysql_format(1, 0xF5416524, 256, "SELECT * FROM Accounts WHERE Name = '%s' AND password = MD5('%s')") (Nitradoscript.p:1063)
[10/12/16 21:55:31] [DEBUG] mysql_format: return value: '74' (Nitradoscript.p:1063)
[10/12/16 21:55:31] [DEBUG] mysql_pquery(1, "SELECT * FROM Accounts WHERE Name = 'Tiriago' AND password = MD5('jaguar')", "OnUserLogin", "d") (Nitradoscript.p:1065)
[10/12/16 21:55:31] [DEBUG] CCallback::Create(amx=0x8ccbd38, name='OnUserLogin', format='d', params=0xf541650c, param_offset=5)
[10/12/16 21:55:31] [DEBUG] CCallback::Create - callback index for 'OnUserLogin': 33
[10/12/16 21:55:31] [DEBUG] processing specifier 'd' with parameter index 0
[10/12/16 21:55:31] [DEBUG] retrieved and pushed value '0'
[10/12/16 21:55:31] [INFO] Callback 'OnUserLogin' set up for delayed execution.
[10/12/16 21:55:31] [DEBUG] created delayed callback with 1 parameter
[10/12/16 21:55:31] [DEBUG] CHandle::Execute(this=0x8b5aab0, type=2, query=0x8d1b3f0)
[10/12/16 21:55:31] [DEBUG] CConnectionPool::Queue(query=0x8d1b3f0, this=0x8c52490)
[10/12/16 21:55:31] [DEBUG] CHandle::Execute - return value: true
[10/12/16 21:55:31] [DEBUG] mysql_pquery: return value: '1' (Nitradoscript.p:1065)
[10/12/16 21:55:31] [DEBUG] CConnection::Execute(query=0x8d1b3f0, this=0xf4269008, connection=0x8cf9148)
[10/12/16 21:55:31] [DEBUG] CQuery::Execute(this=0x8d1b3f0, connection=0x8cf9148)
[10/12/16 21:55:31] [INFO] query "SELECT * FROM Accounts WHERE Name = 'Tiriago' AND password = MD5('jaguar')" successfully executed within 0.563 milliseconds
[10/12/16 21:55:31] [DEBUG] CResultSet::Create(connection=0x8cf9148, query_str='SELECT * FROM Accounts WHERE Name = 'Tiriago' AND password = MD5('jaguar')')
[10/12/16 21:55:31] [DEBUG] created new resultset '0xf37004f0'
[10/12/16 21:55:31] [DEBUG] fetched MySQL result '0xf37007a8'
[10/12/16 21:55:31] [DEBUG] allocated 100 bytes for PAWN result
[10/12/16 21:55:31] [DEBUG] CCallback::Execute(amx=0x8ccbd38, index=33, num_params=1)
[10/12/16 21:55:31] [INFO] Executing callback 'OnUserLogin' with 1 parameter...
[10/12/16 21:55:31] [DEBUG] processing internal specifier 'c'
[10/12/16 21:55:31] [DEBUG] pushed value '0' onto AMX stack
[10/12/16 21:55:31] [DEBUG] executing AMX callback with index '33'
[10/12/16 21:55:31] [DEBUG] cache_get_row_count(0xF5416930) (Nitradoscript.p:1115)
[10/12/16 21:55:31] [DEBUG] cache_get_row_count: return value: '1' (Nitradoscript.p:1115)
[10/12/16 21:55:31] [DEBUG] cache_get_value_name_int(0, "db_id", 0xF54015A4) (Nitradoscript.p:1125)
[10/12/16 21:55:31] [ERROR] cache_get_value_name_int: field 'db_id' not found (Nitradoscript.p:1125)
[10/12/16 21:55:31] [DEBUG] cache_get_value_name_int(0, "Adminlevel", 0xF540160C) (Nitradoscript.p:1126)
[10/12/16 21:55:31] [DEBUG] cache_get_value_name_int: assigned value: '7' (Nitradoscript.p:1126)
[10/12/16 21:55:31] [DEBUG] cache_get_value_name_int: return value: '1' (Nitradoscript.p:1126)
[10/12/16 21:55:31] [DEBUG] cache_get_value_name_int(0, "Level", 0xF5401610) (Nitradoscript.p:1127)
[10/12/16 21:55:31] [DEBUG] cache_get_value_name_int: assigned value: '2' (Nitradoscript.p:1127)
[10/12/16 21:55:31] [DEBUG] cache_get_value_name_int: return value: '1' (Nitradoscript.p:1127)
[10/12/16 21:55:31] [DEBUG] cache_get_value_name_int(0, "Money", 0xF5401614) (Nitradoscript.p:1128)
[10/12/16 21:55:31] [DEBUG] cache_get_value_name_int: assigned value: '0' (Nitradoscript.p:1128)
[10/12/16 21:55:31] [DEBUG] cache_get_value_name_int: return value: '1' (Nitradoscript.p:1128)
[10/12/16 21:55:31] [DEBUG] cache_get_value_name_int(0, "Fraktion", 0xF5401618) (Nitradoscript.p:1129)
[10/12/16 21:55:31] [DEBUG] cache_get_value_name_int: assigned value: '0' (Nitradoscript.p:1129)
[10/12/16 21:55:31] [DEBUG] cache_get_value_name_int: return value: '1' (Nitradoscript.p:1129)
[10/12/16 21:55:31] [DEBUG] cache_get_value_name_int(0, "Rang", 0xF540161C) (Nitradoscript.p:1130)
[10/12/16 21:55:31] [DEBUG] cache_get_value_name_int: assigned value: '0' (Nitradoscript.p:1130)
[10/12/16 21:55:31] [DEBUG] cache_get_value_name_int: return value: '1' (Nitradoscript.p:1130)
[10/12/16 21:55:31] [DEBUG] cache_get_value_name_int(0, "Spawn", 0xF5401620) (Nitradoscript.p:1131)
[10/12/16 21:55:31] [DEBUG] cache_get_value_name_int: assigned value: '0' (Nitradoscript.p:1131)
[10/12/16 21:55:31] [DEBUG] cache_get_value_name_int: return value: '1' (Nitradoscript.p:1131)
[10/12/16 21:55:31] [DEBUG] AMX callback executed with error '0'
[10/12/16 21:55:31] [INFO] Callback successfully executed.
Alles anzeigen
So sieht mein System aus:
Spielernenum:
enum playerInfo{
db_id,
bool:eingeloggt,
Name[MAX_PLAYER_NAME],
Adminlevel,
Level,
Money,
Fraktion,
Rang,
Spawn
}
new sInfo[MAX_PLAYER_NAME][playerInfo];
Alles anzeigen
frakteEnum:
enum frakteEnum{
f_name[300],
Float:f_x,
Float:f_y,
Float:f_z,
Float:f_r,
f_inter,
f_world,
f_color
}
Alles anzeigen
fInfo:
new fInfo[][frakteEnum] ={
{"Zivilist",329.0244,-1513.3033,36.0391,225.8344,0,0,weiß},//Zivilist 0
{"SAPD",213.4162,162.7460,1003.0234,274.4569,3,1,blau},//SAPD 1
{"SWAT",2731.5903,-2450.0164,17.5937,272.4424,0,0,helblau},//SWAT2
{"FBI",2286.9651,2431.6011,10.8203,176.4887,0,0,duneklhelblau},//FBI3
{"ARMY",214.2768,1822.5925,6.4141,265.0869,0,0,hellgrün},//ARMY4
{"Medic/Feuerwehr",302.9467,-1505.8025,24.6007,231.6743,0,0,rot},//MEDIC5
{"Fahrschule",2124.3032,-2273.0491,20.6719,221.7338,0,0,orange},//Fahrschule6
{"Aztecas",2788.4141,-1944.7075,13.5469,87.2128,0,0,türkis},//AZTECAS7
{"Vagos",204.6566,39.7421,2.5781,260.2514,0,0,gelb},//Vagos8
{"Ballas",1084.8976,-1226.7927,15.8203,269.7700,0,0,pink},//Ballas9
{"Yakuza",-2188.6282,-2265.0452,30.6250,71.4091,0,0,grau}//Yakuza10
};
Alles anzeigen
OnPlayerRequestClass:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1686.2013,-2315.4673,13.3828);
SetPlayerCameraPos(playerid, 1686.2013,-2315.4673,13.3828);
SetPlayerCameraLookAt(playerid, 1686.2013,-2315.4673,13.3828);
SetPlayerFacingAngle(playerid,179.8357);
//Wenn der Spieler die Class-Selection betritt prüfe,ob er bereits eingeloggt ist
if(!sInfo[playerid][eingeloggt])
{
//Wenn nicht,dann prüfe ob der Spieler ein Konto hat
new query[128];
mysql_format(handle,query,sizeof(query),"SELECT id FROM Accounts WHERE Name = '%e'",sInfo[playerid][Name]);
mysql_pquery(handle,query,"OnUserCheck","d",playerid);
}
r
Alles anzeigen
OnPlayerConnect und OnUserCheck:
public OnPlayerConnect(playerid)
{
sInfo[playerid][db_id] =0;
sInfo[playerid][eingeloggt] =false;
sInfo[playerid][Adminlevel] =0;
sInfo[playerid][Level] = 0;
sInfo[playerid][Money] = 0;
sInfo[playerid][Fraktion] = 0;
sInfo[playerid][Rang] = 0;
sInfo[playerid][Spawn] = 0;
GetPlayerName(playerid,sInfo[playerid][Name],MAX_PLAYER_NAME);
SetPlayerColor(playerid,weiß);
sInfo[playerid][Level]=1;
SetPlayerScore(playerid,sInfo[playerid][Level]);
return 1;
}
public OnUserCheck(playerid)
{
//Query wurde ausgeführt und das Ergebnis im Cache gespeichert
new rows;
cache_get_row_count(rows);
if(rows == 0)
{
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"Account erstellen","Bitte Registriere dich:","Registrieren","Abbrechen");
}
else
{
//Es existiert ein Ergebnis,das heißt der Spieler ist registriert und muss sich einloggen
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Einloggen","Bitte loggte dich ein:","Einloggen","Abbrechen");
}
return 1;
}
resetPlayer(playerid)
{
for(new i=0; i<sizeof(sInfo[]); i++)
{
sInfo[playerid][playerInfo:i]=0;
}
return 1;
}
Alles anzeigen
OnPlayerSpawn:
public OnPlayerSpawn(playerid)
{
if(!isPlayerInFrakt(playerid,0))
{
if(sInfo[playerid][Spawn]==1)
{
new fID;
fID= sInfo[playerid][Fraktion];
SetPlayerPos(playerid,fInfo[fID][f_x],fInfo[fID][f_y],fInfo[fID][f_z]);
SetPlayerFacingAngle(playerid,fInfo[fID][f_r]);
SetPlayerInterior(playerid,fInfo[fID][f_inter]);
SetPlayerVirtualWorld(playerid,fInfo[fID][f_world]);
SetPlayerColor(playerid,fInfo[fID][f_color]);
}
}
SendClientMessage(playerid,rot,"/hilfe um die Befehle zu sehen!");
return 1;
}
Alles anzeigen
Abfrage wegen Fraktion:
OnUserLogin:
public OnUserLogin(playerid)
{
new rows;
cache_get_row_count(rows);
if(rows == 0)
{
//Der Spieler hat ein falsches Passwort eingegeben
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Einloggen","Bitte logge dich ein:\n{0xFF0000FF}Falsches Passwort!","Einloggen","Abbrechen");
}
else
{
//Es existiert ein Ergebnis,das heißt der Spieler hat das richtige Passwort eingegeben
//Wir lesen nun die erste Zeile des Caches aus (id 0)
cache_get_value_name_int(0,"db_id",sInfo[playerid][db_id]);
cache_get_value_name_int(0,"Adminlevel",sInfo[playerid][Adminlevel]);
cache_get_value_name_int(0,"Level",sInfo[playerid][Level]);
cache_get_value_name_int(0,"Money",sInfo[playerid][Money]);
cache_get_value_name_int(0,"Fraktion",sInfo[playerid][Fraktion]);
cache_get_value_name_int(0,"Rang",sInfo[playerid][Rang]);
cache_get_value_name_int(0,"Spawn",sInfo[playerid][Spawn]);
}
return 1;
}
Alles anzeigen
SaveUserStats:
stock SaveUserStats(playerid)
{
//Wen der Spieler nicht eingeloggt ist, dann speichere seine Statistiken nicht
if(!sInfo[playerid][eingeloggt])return 1;
//Ansonsten speichere Sie ab
new query[600];
mysql_format(handle,query,sizeof(query),"UPDATE Accounts Set Name = '%s',Adminlevel = '%d',Level = '%d',Money = '%d',Fraktion = '%d',Rang = '%d',Spawn = '%d' WHERE id = '%d' ",
sInfo[playerid][Name],sInfo[playerid][Adminlevel],sInfo[playerid][Level],sInfo[playerid][Money],sInfo[playerid][Fraktion],sInfo[playerid][Rang],sInfo[playerid][Spawn],sInfo[playerid][db_id]);
//Das Query wird abgesendet
mysql_pquery(handle,query);
return 1;
}
Alles anzeigen
Dann hattest du ein Glückstreffer.
Domains werden in der Regel erst nach 24 Stunden richtig Registriert.
Es kann auch mal vorkommen das es nach 4 Stunden passiert aber das ist sehr selten da normal 24 Stunden für jede Domain ist.
@[NeS]Fischer es dauert 24Stunden bis die Domain Registriert wird. Nach dem die Domain Registriert wurde kannst du dein Webspace mit deiner Domain verbinden.
Du meinst ?
von:
mysql_format(handle,query,sizeof(query),"UPDATE Accounts Set Name = '%s',Adminlevel = '%d',Level = '%d',Money = '%d',Fraktion = '%d',Rang = '%d',Spawn = '%d' WHERE id = '%d' ",
sInfo[playerid][Name],sInfo[playerid][Adminlevel],sInfo[playerid][Level],sInfo[playerid][Money],sInfo[playerid][Fraktion],sInfo[playerid][Rang],sInfo[playerid][Spawn
Zu:
mysql_format(handle,query,sizeof(query),"UPDATE Accounts Set Name = '%s',Adminlevel = '%d',Level = '%d',Money = '%d',Fraktion = '%d',Rang = '%d',Spawn = '%d' WHERE id = '%d' ",
sInfo[playerid][Name],sInfo[playerid][Adminlevel],sInfo[playerid][Level],sInfo[playerid][Money],sInfo[playerid][Fraktion],sInfo[playerid][Rang],sInfo[playerid][Spawn],sInfo[playerid][db_id]);
@AirM4X Danke!
Neues Problem:
Nach dem man sich Registriert hat sehen die Spieler Stats so aus:
Spieler: x
Adminlevel: 0
Spieler: 1
Money: 0
Fraktion: 0
Rang:-0
Spawn: 0
Nach dem man sich erneut einloggt sehen die Spielerstats aber so aus in der Datenbank:
http://www.pic-upload.de/view-31884342/Datenbank2.png.html
Wenn man in einer Fraktion ist und Spawnchange benutzt und man Stirbt wird man nicht in die Fraktionsbase gesetzt:
Fraktionsbefehle:
ocmd:fc(playerid,params[])
{
if(isPlayerInFrakt(playerid, 0))return SendClientMessage(
playerid, rot, "Du bist in keiner Fraktion.");
new string[128];
if(sscanf(params, "s[128]", string))return SendClientMessage(
playerid, rot, "INFO: /f [nachricht]");
new fID = sInfo[playerid][Fraktion];
format(string,sizeof(string), "**(( %s: %s ))**", getPlayerName(playerid), string);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i))continue;
if(!isPlayerInFrakt(i, fID))continue;
SendClientMessage(i, helblau, string);
}
return 1;
}
ocmd:einladen(playerid,params[])
{
if(isPlayerInFrakt(playerid, 0))return SendClientMessage(
playerid, helblau, "Du bist in keiner Fraktion.");
if(sInfo[playerid][Rang] < 6)return SendClientMessage(
playerid, helblau, "Dein Rang ist zu niedrig.");
new pID, fID;
fID = sInfo[playerid][Fraktion];
if(sscanf(params, "u", pID))return SendClientMessage(
playerid, gelb, "INFO: /invite [playerid]");
if(!isPlayerInFrakt(pID, 0))return SendClientMessage(
playerid, gelb, "Spieler ist kein Zivilist.");
new string[128];
format(string,sizeof(string), "%s hat dich in die Fraktion %s eingeladen.",
getPlayerName(playerid), fInfo[fID][f_name]);
SendClientMessage(pID, gelb, string);
SendClientMessage(pID, gelb,
"Zum akzeptieren /accept invite eingeben.");
SetPVarInt(pID, "inv_fraktid", fID);
SetPVarInt(pID, "inv_inviter", playerid);
return 1;
}
ocmd:fraktionshilfe(playerid,params[])
{
if(isPlayerInFrakt(playerid,0))return SendClientMessage(playerid,rot,"Du bist in keiner Fraktion");
SendClientMessage(playerid,grün,"/fc");
SendClientMessage(playerid,rot,"/einladen");
SendClientMessage(playerid,grün,"/annehmen");
SendClientMessage(playerid,rot,"/spawnchange");
SendClientMessage(playerid,grün,"/einladen");
return 1;
}
ocmd:verbrechen(playerid,params[])
{
if(!isPlayerInFrakt(playerid,1))return SendClientMessage(playerid,rot,"Du bist nicht im SAPD!");
{
new pID,wLevel;
if(sscanf(params,"ii",pID,wLevel))return SendClientMessage(playerid,duneklhelblau,"Info: /Fandungslevel[playerid][fandungslevel]");
if(wLevel<-1||wLevel>6)return SendClientMessage(playerid,rot,"Falsche Fandungslevel!");
SetPlayerWantedLevel(pID,wLevel);
return 1;
}
}
ocmd:spawnchange(playerid,params[])
{
if(isPlayerInFrakt(playerid,0)) return SendClientMessage(playerid,rot,"Du bist in keiner Fraktion.");
if(sInfo[playerid][Spawn] == 0)
{
sInfo[playerid][Spawn] = 1;
}
else
{
sInfo[playerid][Spawn] = 0;
}
SendClientMessage(playerid,grün,"Spawn geändert");
return 1;
}
ocmd:annehmen(playerid, params[])
{
new item[64];
if(sscanf(params,"s[64]",item))return SendClientMessage(
playerid, gelb, "INFO: /accept [invite]");
if(!strcmp(item, "invite", false))
{
if(GetPVarInt(playerid, "inv_fraktid") == 0)return SendClientMessage(
playerid, grün, "Du wurdest in keine Fraktion eingeladen.");
new fID = GetPVarInt(playerid, "inv_fraktid");
sInfo[playerid][Fraktion] = fID;
sInfo[playerid][Rang] = 1;
new string[128];
format(string,sizeof(string), "Du bist der Fraktion %s beigetreten.",
fInfo[fID][f_name]);
SendClientMessage(playerid, grün, string);
format(string,sizeof(string), "%s ist der Fraktion beigetreten.",
getPlayerName(playerid));
SendClientMessage(GetPVarInt(playerid, "inv_inviter"), grün,
string);
SetPVarInt(playerid, "inv_fraktid", 0);
return 1;
}
return 1;
}
Alles anzeigen
Laut der Mysql_Log:
[10/12/16 08:30:04] [INFO] changed log level from 'warning, error' to 'debug, info, warning, error'
[10/12/16 08:31:21] [DEBUG] mysql_format(1, 0xF54B96F0, 128, "SELECT id FROM Accounts WHERE Name = '%e'") (Nitradoscript.p:264)
[10/12/16 08:31:21] [DEBUG] CHandle::EscapeString(this=0x8c99a70, src='Tiriago')
[10/12/16 08:31:21] [DEBUG] CConnection::EscapeString(src='Tiriago', this=0x8d8a698, connection=0x8e0b140)
[10/12/16 08:31:21] [DEBUG] CHandle::EscapeString - return value: true, escaped string: 'Tiriago'
[10/12/16 08:31:21] [DEBUG] mysql_format: return value: '46' (Nitradoscript.p:264)
[10/12/16 08:31:21] [DEBUG] mysql_pquery(1, "SELECT id FROM Accounts WHERE Name = 'Tiriago'", "OnUserCheck", "d") (Nitradoscript.p:265)
[10/12/16 08:31:21] [DEBUG] CCallback::Create(amx=0x8e0ad00, name='OnUserCheck', format='d', params=0xf54b96d8, param_offset=5)
[10/12/16 08:31:21] [DEBUG] CCallback::Create - callback index for 'OnUserCheck': 32
[10/12/16 08:31:21] [DEBUG] processing specifier 'd' with parameter index 0
[10/12/16 08:31:21] [DEBUG] retrieved and pushed value '0'
[10/12/16 08:31:21] [INFO] Callback 'OnUserCheck' set up for delayed execution.
[10/12/16 08:31:21] [DEBUG] created delayed callback with 1 parameter
[10/12/16 08:31:21] [DEBUG] CHandle::Execute(this=0x8c99a70, type=2, query=0x8e59ff0)
[10/12/16 08:31:21] [DEBUG] CConnectionPool::Queue(query=0x8e59ff0, this=0x8d91458)
[10/12/16 08:31:21] [DEBUG] CHandle::Execute - return value: true
[10/12/16 08:31:21] [DEBUG] mysql_pquery: return value: '1' (Nitradoscript.p:265)
[10/12/16 08:31:21] [DEBUG] CConnection::Execute(query=0x8e59ff0, this=0xf4b8e008, connection=0x8e31ac0)
[10/12/16 08:31:21] [DEBUG] CQuery::Execute(this=0x8e59ff0, connection=0x8e31ac0)
[10/12/16 08:31:21] [INFO] query "SELECT id FROM Accounts WHERE Name = 'Tiriago'" successfully executed within 0.264 milliseconds
[10/12/16 08:31:21] [DEBUG] CResultSet::Create(connection=0x8e31ac0, query_str='SELECT id FROM Accounts WHERE Name = 'Tiriago'')
[10/12/16 08:31:21] [DEBUG] created new resultset '0xf42004f0'
[10/12/16 08:31:21] [DEBUG] fetched MySQL result '0xf4200768'
[10/12/16 08:31:21] [DEBUG] allocated 0 bytes for PAWN result
[10/12/16 08:31:21] [DEBUG] CCallback::Execute(amx=0x8e0ad00, index=32, num_params=1)
[10/12/16 08:31:21] [INFO] Executing callback 'OnUserCheck' with 1 parameter...
[10/12/16 08:31:21] [DEBUG] processing internal specifier 'c'
[10/12/16 08:31:21] [DEBUG] pushed value '0' onto AMX stack
[10/12/16 08:31:21] [DEBUG] executing AMX callback with index '32'
[10/12/16 08:31:21] [DEBUG] cache_get_row_count(0xF54B98F0) (Nitradoscript.p:290)
[10/12/16 08:31:21] [DEBUG] cache_get_row_count: return value: '1' (Nitradoscript.p:290)
[10/12/16 08:31:21] [DEBUG] AMX callback executed with error '0'
[10/12/16 08:31:21] [INFO] Callback successfully executed.
[10/12/16 08:31:25] [DEBUG] mysql_format(1, 0xF54B94E4, 256, "INSERT INTO Accounts (Name, password) VALUES ('%s', MD5('%s'))") (Nitradoscript.p:1050)
[10/12/16 08:31:25] [DEBUG] mysql_format: return value: '71' (Nitradoscript.p:1050)
[10/12/16 08:31:25] [DEBUG] mysql_pquery(1, "INSERT INTO Accounts (Name, password) VALUES ('Tiriago', MD5('jaguar'))", "OnUserRegister", "d") (Nitradoscript.p:1052)
[10/12/16 08:31:25] [DEBUG] CCallback::Create(amx=0x8e0ad00, name='OnUserRegister', format='d', params=0xf54b94cc, param_offset=5)
[10/12/16 08:31:25] [DEBUG] CCallback::Create - callback index for 'OnUserRegister': 34
[10/12/16 08:31:25] [DEBUG] processing specifier 'd' with parameter index 0
[10/12/16 08:31:25] [DEBUG] retrieved and pushed value '0'
[10/12/16 08:31:25] [INFO] Callback 'OnUserRegister' set up for delayed execution.
[10/12/16 08:31:25] [DEBUG] created delayed callback with 1 parameter
[10/12/16 08:31:25] [DEBUG] CHandle::Execute(this=0x8c99a70, type=2, query=0x8e5a3c8)
[10/12/16 08:31:25] [DEBUG] CConnectionPool::Queue(query=0x8e5a3c8, this=0x8d91458)
[10/12/16 08:31:25] [DEBUG] CHandle::Execute - return value: true
[10/12/16 08:31:25] [DEBUG] mysql_pquery: return value: '1' (Nitradoscript.p:1052)
[10/12/16 08:31:25] [DEBUG] CConnection::Execute(query=0x8e5a3c8, this=0xf430c008, connection=0x8e38110)
[10/12/16 08:31:25] [DEBUG] CQuery::Execute(this=0x8e5a3c8, connection=0x8e38110)
[10/12/16 08:31:25] [INFO] query "INSERT INTO Accounts (Name, password) VALUES ('Tiriago', MD5('jaguar'))" successfully executed within 2.106 milliseconds
[10/12/16 08:31:25] [DEBUG] CResultSet::Create(connection=0x8e38110, query_str='INSERT INTO Accounts (Name, password) VALUES ('Tiriago', MD5('jaguar'))')
[10/12/16 08:31:25] [DEBUG] created new resultset '0xf3800618'
[10/12/16 08:31:25] [DEBUG] fetched MySQL result '0x0'
[10/12/16 08:31:25] [DEBUG] CCallback::Execute(amx=0x8e0ad00, index=34, num_params=1)
[10/12/16 08:31:25] [INFO] Executing callback 'OnUserRegister' with 1 parameter...
[10/12/16 08:31:25] [DEBUG] processing internal specifier 'c'
[10/12/16 08:31:25] [DEBUG] pushed value '0' onto AMX stack
[10/12/16 08:31:25] [DEBUG] executing AMX callback with index '34'
[10/12/16 08:31:25] [DEBUG] cache_insert_id() (Nitradoscript.p:1108)
[10/12/16 08:31:25] [DEBUG] cache_insert_id: return value: '1' (Nitradoscript.p:1108)
[10/12/16 08:31:25] [DEBUG] AMX callback executed with error '0'
[10/12/16 08:31:25] [INFO] Callback successfully executed.
Alles anzeigen
Möchte das aber in der Datenbank die Spielerstats alle gespeichert werden.
So sieht Mein Code für Register/Login Spielerenum und Fraktionsenum aus:
Dialoge:
Spielerenum und Fraktionsenum:
enum playerInfo{
db_id,
bool:eingeloggt,
Name[MAX_PLAYER_NAME],
Adminlevel,
Level,
Money,
Fraktion,
Rang,
Spawn
}
new sInfo[MAX_PLAYER_NAME][playerInfo];
enum frakteEnum{
f_name[300],
Float:f_x,
Float:f_y,
Float:f_z,
Float:f_r,
f_inter,
f_world,
f_color
}
Alles anzeigen
fraktionsinformation:
new fInfo[][frakteEnum] ={
{"Zivilist",329.0244,-1513.3033,36.0391,225.8344,0,0,weiß},//Zivilist 0
{"SAPD",213.4162,162.7460,1003.0234,274.4569,3,1,blau},//SAPD 1
{"SWAT",2731.5903,-2450.0164,17.5937,272.4424,0,0,helblau},//SWAT2
{"FBI",2286.9651,2431.6011,10.8203,176.4887,0,0,duneklhelblau},//FBI3
{"ARMY",214.2768,1822.5925,6.4141,265.0869,0,0,hellgrün},//ARMY4
{"Medic/Feuerwehr",302.9467,-1505.8025,24.6007,231.6743,0,0,rot},//MEDIC5
{"Fahrschule",2124.3032,-2273.0491,20.6719,221.7338,0,0,orange},//Fahrschule6
{"Aztecas",2788.4141,-1944.7075,13.5469,87.2128,0,0,türkis},//AZTECAS7
{"Vagos",204.6566,39.7421,2.5781,260.2514,0,0,gelb},//Vagos8
{"Ballas",1084.8976,-1226.7927,15.8203,269.7700,0,0,pink},//Ballas9
{"Yakuza",-2188.6282,-2265.0452,30.6250,71.4091,0,0,grau}//Yakuza10
};
Alles anzeigen
OnPlayerRequestClass:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1686.2013,-2315.4673,13.3828);
SetPlayerCameraPos(playerid, 1686.2013,-2315.4673,13.3828);
SetPlayerCameraLookAt(playerid, 1686.2013,-2315.4673,13.3828);
SetPlayerFacingAngle(playerid,179.8357);
//Wenn der Spieler die Class-Selection betritt prüfe,ob er bereits eingeloggt ist
if(!sInfo[playerid][eingeloggt])
{
//Wenn nicht,dann prüfe ob der Spieler ein Konto hat
new query[128];
mysql_format(handle,query,sizeof(query),"SELECT id FROM Accounts WHERE Name = '%e'",sInfo[playerid][Name]);
mysql_pquery(handle,query,"OnUserCheck","d",playerid);
}
return 1;
}
Alles anzeigen
OnPlayerConnect:
public OnPlayerConnect(playerid)
{
sInfo[playerid][db_id] =0;
sInfo[playerid][eingeloggt] =false;
sInfo[playerid][Adminlevel] =0;
sInfo[playerid][Level] = 0;
sInfo[playerid][Money] = 0;
sInfo[playerid][Fraktion] = 0;
sInfo[playerid][Rang] = 0;
sInfo[playerid][Spawn] = 0;
GetPlayerName(playerid,sInfo[playerid][Name],MAX_PLAYER_NAME);
SetPlayerColor(playerid,weiß);
sInfo[playerid][Level]=1;
SetPlayerScore(playerid,sInfo[playerid][Level]);
return 1;
}
Alles anzeigen
resetPlayer:
resetPlayer(playerid)
{
for(new i=0; i<sizeof(sInfo[]); i++)
{
sInfo[playerid][playerInfo:i]=0;
}
return 1;
}
OnPlayerDisconnect:
public OnPlayerDisconnect(playerid, reason)
{
SaveUserStats(playerid);
resetPlayer(playerid);
return 1;
}
OnPlayerSpawn:
public OnPlayerSpawn(playerid)
{
if(!isPlayerInFrakt(playerid,0))
{
if(sInfo[playerid][Spawn]==1)
{
new fID;
fID= sInfo[playerid][Fraktion];
SetPlayerPos(playerid,fInfo[fID][f_x],fInfo[fID][f_y],fInfo[fID][f_z]);
SetPlayerFacingAngle(playerid,fInfo[fID][f_r]);
SetPlayerInterior(playerid,fInfo[fID][f_inter]);
SetPlayerVirtualWorld(playerid,fInfo[fID][f_world]);
SetPlayerColor(playerid,fInfo[fID][f_color]);
}
}
SendClientMessage(playerid,rot,"/hilfe um die Befehle zu sehen!");
return 1;
}
Alles anzeigen
Fraktionsabfrage und Adminabfrage:
isPlayerInFrakt(playerid,f_id){
if(sInfo[playerid][Fraktion]==f_id)return 1;
return 0;
}
isAdmin(playerid,alevel)
{
if(sInfo[playerid][Adminlevel]>=alevel)return 1;
return 0;
}
Welche Fraktion es gibt und Adminränge:
/*
LSPD2
SWAT3
FBI 4
ARMY 5
Medic/Feuerwehr 6
Fahrschule 7
Aztecas 8
Vagos 9
Ballas 10
Yakuza 11
*/
//OCMD Befehle
/*
AdminRänge:
Supporter 1
Supersupporter 2
Moderator 3
Supermoderator 4
Administrator 5
Kon-Serverchf 6
Serverchef/Scripter 7
ERROR
*/
Alles anzeigen
OnUserLogin:
public OnUserLogin(playerid)
{
new rows;
cache_get_row_count(rows);
if(rows == 0)
{
//Der Spieler hat ein falsches Passwort eingegeben
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Einloggen","Bitte logge dich ein:\n{0xFF0000FF}Falsches Passwort!","Einloggen","Abbrechen");
}
else
{
//Es existiert ein Ergebnis,das heißt der Spieler hat das richtige Passwort eingegeben
//Wir lesen nun die erste Zeile des Caches aus (id 0)
cache_get_value_name_int(0,"db_id",sInfo[playerid][db_id]);
cache_get_value_name_int(0,"Adminlevel",sInfo[playerid][Adminlevel]);
cache_get_value_name_int(0,"Level",sInfo[playerid][Level]);
cache_get_value_name_int(0,"Money",sInfo[playerid][Money]);
cache_get_value_name_int(0,"Fraktion",sInfo[playerid][Fraktion]);
cache_get_value_name_int(0,"Rang",sInfo[playerid][Rang]);
cache_get_value_name_int(0,"Spawn",sInfo[playerid][Spawn]);
}
return 1;
}
Alles anzeigen
SaveUserStats:
stock SaveUserStats(playerid)
{
//Wen der Spieler nicht eingeloggt ist, dann speichere seine Statistiken nicht
if(!sInfo[playerid][eingeloggt])return 1;
//Ansonsten speichere Sie ab
new query[600];
mysql_format(handle,query,sizeof(query),"UPDATE Accounts Set Name = '%s',Adminlevel = '%d',Level = '%d',Money = '%d',Fraktion = '%d',Rang = '%d',Spawn = '%d' WHERE id = '%d' ",
sInfo[playerid][Name],sInfo[playerid][Adminlevel],sInfo[playerid][Level],sInfo[playerid][Money],sInfo[playerid][Fraktion],sInfo[playerid][Rang],sInfo[playerid][Spawn]);
//Das Query wird abgesendet
mysql_pquery(handle,query);
return 1;
}
Alles anzeigen
Folgedes Gehört zum Register/Login verfahren:
Bild von meiner DatenBank Link;
http://www.pic-upload.de/view-31884324/Datenbank.png.html
Dialoge Definiert:
SpielerEnum:
enum playerInfo{
db_id,
bool:eingeloggt,
Name[MAX_PLAYER_NAME],
Adminlevel,
Level,
Money,
Fraktion,
Rang,
Spawn
}
new sInfo[MAX_PLAYER_NAME][playerInfo];
Alles anzeigen
OnPlayerRequestClass:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1686.2013,-2315.4673,13.3828);
SetPlayerCameraPos(playerid, 1686.2013,-2315.4673,13.3828);
SetPlayerCameraLookAt(playerid, 1686.2013,-2315.4673,13.3828);
SetPlayerFacingAngle(playerid,179.8357);
//Wenn der Spieler die Class-Selection betritt prüfe,ob er bereits eingeloggt ist
if(!sInfo[playerid][eingeloggt])
{
//Wenn nicht,dann prüfe ob der Spieler ein Konto hat
new query[128];
mysql_format(handle,query,sizeof(query),"SELECT id FROM Accounts WHERE Name = '%e'",sInfo[playerid][Name]);
mysql_pquery(handle,query,"OnUserCheck","d",playerid);
}
return 1;
}
Alles anzeigen
OnUserCheck:
public OnUserCheck(playerid)
{
//Query wurde ausgeführt und das Ergebnis im Cache gespeichert
new rows;
cache_get_row_count(rows);
if(rows == 0)
{
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"Account erstellen","Bitte Registriere dich:","Registrieren","Abbrechen");
}
else
{
//Es existiert ein Ergebnis,das heißt der Spieler ist registriert und muss sich einloggen
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Einloggen","Bitte loggte dich ein:","Einloggen","Abbrechen");
}
return 1;
}
resetPlayer(playerid)
{
for(new i=0; i<sizeof(sInfo[]); i++)
{
sInfo[playerid][playerInfo:i]=0;
}
return 1;
}
Alles anzeigen
OnPlayerDisconnect:
public OnPlayerDisconnect(playerid, reason)
{
SaveUserStats(playerid);
resetPlayer(playerid);
return 1;
}
OnPlayerSpawn:
public OnPlayerSpawn(playerid)
{
if(!isPlayerInFrakt(playerid,0))
{
if(sInfo[playerid][Spawn]==1)
{
new fID;
fID= sInfo[playerid][Fraktion];
SetPlayerPos(playerid,fInfo[fID][f_x],fInfo[fID][f_y],fInfo[fID][f_z]);
SetPlayerFacingAngle(playerid,fInfo[fID][f_r]);
SetPlayerInterior(playerid,fInfo[fID][f_inter]);
SetPlayerVirtualWorld(playerid,fInfo[fID][f_world]);
SetPlayerColor(playerid,fInfo[fID][f_color]);
}
}
SendClientMessage(playerid,rot,"/hilfe um die Befehle zu sehen!");
return 1;
}
Alles anzeigen
GetPlayerName:
getPlayerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
return name;
}
OnDialogResponse:
if(dialogid == DIALOG_REGISTER)
{
//Spieler hat Abbrechen gewählt
if(!response) return Kick(playerid);
//Wenn der Spieler kein, oder ein zu kurzes, Passwort eingegeben hat
if(strlen(inputtext) < 5) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Registration", "Bitte registriere Dich:\n{0xFF0000FF}Mindestens 5 Zeichen!", "Ok", "Abbrechen");
//Wenn alles passt wird der Spieler in der Datenbank angelegt
//Als Verschlüsselung für das Passwort wird MD5 verwendet
new query[256];
mysql_format(handle, query, sizeof(query), "INSERT INTO Accounts (name, password) VALUES ('%s', MD5('%s'))", sInfo[playerid][Name], inputtext);
//Das Query wird abgesendet und die playerid an OnUserRegister übergeben
mysql_pquery(handle, query, "OnUserRegister", "d", playerid);
return 1;
}
if(dialogid == DIALOG_LOGIN)
{
//Spieler hat Abbrechen gewählt
if(!response) return Kick(playerid);
//Wenn der Spieler kein, oder ein zu kurzes, Passwort eingegeben hat
if(strlen(inputtext) < 5) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Anmeldung", "Bitte logge Dich ein:\n{0xFF0000FF}Mindestens 5 Zeichen!", "Ok", "Abbrechen");
//Wenn alles passt wird die Datenbank ausgelesen
new query[256];
mysql_format(handle, query, sizeof(query), "SELECT * FROM Accounts WHERE name = '%s' AND password = MD5('%s')", sInfo[playerid][Name], inputtext);
//Das Query wird abgesendet und die playerid an OnUserLogin übergeben
mysql_pquery(handle, query, "OnUserLogin", "d", playerid);
return 1;
}
Alles anzeigen
OnUserRegister:
public OnUserRegister(playerid)
{
//Der Spieler wurde in die Datenbank eingetragen, es wird die id ausgelsen
sInfo[playerid][db_id] = cache_insert_id();
SendClientMessage(playerid,grün,"[Konto]Registration erfolgreich");
return 1;
}
OnUserLogin:
public OnUserLogin(playerid)
{
new rows;
cache_get_row_count(rows);
if(rows == 0)
{
//Der Spieler hat ein falsches Passwort eingegeben
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Einloggen","Bitte logge dich ein:\n{0xFF0000FF}Falsches Passwort!","Einloggen","Abbrechen");
}
else
{
//Es existiert ein Ergebnis,das heißt der Spieler hat das richtige Passwort eingegeben
//Wir lesen nun die erste Zeile des Caches aus (id 0)
cache_get_value_name_int(0,"db_id",sInfo[playerid][db_id]);
cache_get_value_name_int(0,"Adminlevel",sInfo[playerid][Adminlevel]);
cache_get_value_name_int(0,"Level",sInfo[playerid][Level]);
cache_get_value_name_int(0,"Money",sInfo[playerid][Money]);
cache_get_value_name_int(0,"Fraktion",sInfo[playerid][Fraktion]);
cache_get_value_name_int(0,"Rang",sInfo[playerid][Rang]);
cache_get_value_name_int(0,"Spawn",sInfo[playerid][Spawn]);
}
return 1;
}
Alles anzeigen
SaveUserStats und SpielerName:
stock SaveUserStats(playerid)
{
//Wen der Spieler nicht eingeloggt ist, dann speichere seine Statistiken nicht
if(!sInfo[playerid][eingeloggt])return 1;
//Ansonsten speichere Sie ab
new query[600];
mysql_format(handle,query,sizeof(query),"UPDATE Accounts Set Name = '%s',Adminlevel = '%d',Level = '%d',Money = '%d',Fraktion = '%d',Rang = '%d',Spawn = '%d' WHERE id = '%d' ",
sInfo[playerid][Name],sInfo[playerid][Adminlevel],sInfo[playerid][Level],sInfo[playerid][Money],sInfo[playerid][Fraktion],sInfo[playerid][Rang],sInfo[playerid][Spawn]);
//Das Query wird abgesendet
mysql_pquery(handle,query);
return 1;
}
stock SpielerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
return name;
}
Alles anzeigen
Ich habe es gemacht aber dennoch Fehler :
Account wird nicht erstellt.
Mysql_Log:
[10/12/16 08:05:01] [INFO] changed log level from 'warning, error' to 'debug, info, warning, error'
[10/12/16 08:05:35] [DEBUG] mysql_format(1, 0xF54606F0, 128, "SELECT id FROM Accounts WHERE Name = '%e'") (Nitradoscript.p:264)
[10/12/16 08:05:35] [DEBUG] CHandle::EscapeString(this=0x9f11a70, src='Tiriago')
[10/12/16 08:05:35] [DEBUG] CConnection::EscapeString(src='Tiriago', this=0xa002698, connection=0xa083140)
[10/12/16 08:05:35] [DEBUG] CHandle::EscapeString - return value: true, escaped string: 'Tiriago'
[10/12/16 08:05:35] [DEBUG] mysql_format: return value: '46' (Nitradoscript.p:264)
[10/12/16 08:05:35] [DEBUG] mysql_pquery(1, "SELECT id FROM Accounts WHERE Name = 'Tiriago'", "OnUserCheck", "d") (Nitradoscript.p:265)
[10/12/16 08:05:35] [DEBUG] CCallback::Create(amx=0xa082d00, name='OnUserCheck', format='d', params=0xf54606d8, param_offset=5)
[10/12/16 08:05:35] [DEBUG] CCallback::Create - callback index for 'OnUserCheck': 32
[10/12/16 08:05:35] [DEBUG] processing specifier 'd' with parameter index 0
[10/12/16 08:05:35] [DEBUG] retrieved and pushed value '0'
[10/12/16 08:05:35] [INFO] Callback 'OnUserCheck' set up for delayed execution.
[10/12/16 08:05:35] [DEBUG] created delayed callback with 1 parameter
[10/12/16 08:05:35] [DEBUG] CHandle::Execute(this=0x9f11a70, type=2, query=0xa0d1fe8)
[10/12/16 08:05:35] [DEBUG] CConnectionPool::Queue(query=0xa0d1fe8, this=0xa009458)
[10/12/16 08:05:35] [DEBUG] CHandle::Execute - return value: true
[10/12/16 08:05:35] [DEBUG] mysql_pquery: return value: '1' (Nitradoscript.p:265)
[10/12/16 08:05:35] [DEBUG] CConnection::Execute(query=0xa0d1fe8, this=0xf4b35008, connection=0xa0a9ac0)
[10/12/16 08:05:35] [DEBUG] CQuery::Execute(this=0xa0d1fe8, connection=0xa0a9ac0)
[10/12/16 08:05:35] [INFO] query "SELECT id FROM Accounts WHERE Name = 'Tiriago'" successfully executed within 0.255 milliseconds
[10/12/16 08:05:35] [DEBUG] CResultSet::Create(connection=0xa0a9ac0, query_str='SELECT id FROM Accounts WHERE Name = 'Tiriago'')
[10/12/16 08:05:35] [DEBUG] created new resultset '0xf41004f0'
[10/12/16 08:05:35] [DEBUG] fetched MySQL result '0xf4100768'
[10/12/16 08:05:35] [DEBUG] allocated 0 bytes for PAWN result
[10/12/16 08:05:35] [DEBUG] CCallback::Execute(amx=0xa082d00, index=32, num_params=1)
[10/12/16 08:05:35] [INFO] Executing callback 'OnUserCheck' with 1 parameter...
[10/12/16 08:05:35] [DEBUG] processing internal specifier 'c'
[10/12/16 08:05:35] [DEBUG] pushed value '0' onto AMX stack
[10/12/16 08:05:35] [DEBUG] executing AMX callback with index '32'
[10/12/16 08:05:35] [DEBUG] cache_get_row_count(0xF54608F0) (Nitradoscript.p:290)
[10/12/16 08:05:35] [DEBUG] cache_get_row_count: return value: '1' (Nitradoscript.p:290)
[10/12/16 08:05:35] [DEBUG] AMX callback executed with error '0'
[10/12/16 08:05:35] [INFO] Callback successfully executed.
[10/12/16 08:05:40] [DEBUG] mysql_format(1, 0xF54604E4, 256, "INSERT INTO Accounts (name, password) VALUES ('%s', MD5('%s'))") (Nitradoscript.p:1050)
[10/12/16 08:05:40] [DEBUG] mysql_format: return value: '71' (Nitradoscript.p:1050)
[10/12/16 08:05:40] [DEBUG] mysql_pquery(1, "INSERT INTO Accounts (name, password) VALUES ('Tiriago', MD5('jaguar'))", "OnUserRegister", "d") (Nitradoscript.p:1052)
[10/12/16 08:05:40] [DEBUG] CCallback::Create(amx=0xa082d00, name='OnUserRegister', format='d', params=0xf54604cc, param_offset=5)
[10/12/16 08:05:40] [DEBUG] CCallback::Create - callback index for 'OnUserRegister': 34
[10/12/16 08:05:40] [DEBUG] processing specifier 'd' with parameter index 0
[10/12/16 08:05:40] [DEBUG] retrieved and pushed value '0'
[10/12/16 08:05:40] [INFO] Callback 'OnUserRegister' set up for delayed execution.
[10/12/16 08:05:40] [DEBUG] created delayed callback with 1 parameter
[10/12/16 08:05:40] [DEBUG] CHandle::Execute(this=0x9f11a70, type=2, query=0xa0d22c0)
[10/12/16 08:05:40] [DEBUG] CConnectionPool::Queue(query=0xa0d22c0, this=0xa009458)
[10/12/16 08:05:40] [DEBUG] CHandle::Execute - return value: true
[10/12/16 08:05:40] [DEBUG] mysql_pquery: return value: '1' (Nitradoscript.p:1052)
[10/12/16 08:05:40] [DEBUG] CConnection::Execute(query=0xa0d22c0, this=0xf42b3008, connection=0xa0b0110)
[10/12/16 08:05:40] [DEBUG] CQuery::Execute(this=0xa0d22c0, connection=0xa0b0110)
[10/12/16 08:05:40] [ERROR] error #1054 while executing query "INSERT INTO Accounts (name, password) VALUES ('Tiriago', MD5('jaguar'))": Unknown column 'password' in 'field list' (Nitradoscript.p:1052)
[10/12/16 08:05:40] [DEBUG] CConnection::GetError(this=0xf42b3008, connection=0xa0b0110)
[10/12/16 08:05:40] [DEBUG] CCallback::Create(amx=0xa082d00, name='OnQueryError', format='dsssd)
[10/12/16 08:05:40] [DEBUG] CCallback::Create - callback index for 'OnQueryError': -10044
[10/12/16 08:05:40] [DEBUG] processing specifier 'd'
[10/12/16 08:05:40] [DEBUG] retrieved and pushed value '1054'
[10/12/16 08:05:40] [DEBUG] processing specifier 's'
[10/12/16 08:05:40] [DEBUG] retrieved and pushed value 'Unknown column 'password' in 'field list''
[10/12/16 08:05:40] [DEBUG] processing specifier 's'
[10/12/16 08:05:40] [DEBUG] retrieved and pushed value 'OnUserRegister'
[10/12/16 08:05:40] [DEBUG] processing specifier 's'
[10/12/16 08:05:40] [DEBUG] retrieved and pushed value 'INSERT INTO Accounts (name, password) VALUES ('Tiriago', MD5('jaguar'))'
[10/12/16 08:05:40] [DEBUG] processing specifier 'd'
[10/12/16 08:05:40] [DEBUG] retrieved and pushed value '1'
[10/12/16 08:05:40] [INFO] Callback 'OnQueryError' set up for delayed execution.
[10/12/16 08:05:40] [DEBUG] created delayed callback with 5 parameters
[10/12/16 08:05:40] [DEBUG] CCallback::Execute(amx=0xa082d00, index=-10044, num_params=5)
[10/12/16 08:05:40] [INFO] Executing callback 's�' with 5 parameters...
[10/12/16 08:05:40] [DEBUG] processing internal specifier 'c'
[10/12/16 08:05:40] [DEBUG] pushed value '1' onto AMX stack
[10/12/16 08:05:40] [DEBUG] processing internal specifier 's'
[10/12/16 08:05:40] [DEBUG] pushed value 'INSERT INTO Accounts (name, password) VALUES ('Tiriago', MD5('jaguar'))' onto AMX stack
[10/12/16 08:05:40] [DEBUG] processing internal specifier 's'
[10/12/16 08:05:40] [DEBUG] pushed value 'OnUserRegister' onto AMX stack
[10/12/16 08:05:40] [DEBUG] processing internal specifier 's'
[10/12/16 08:05:40] [DEBUG] pushed value 'Unknown column 'password' in 'field list'' onto AMX stack
[10/12/16 08:05:40] [DEBUG] processing internal specifier 'c'
[10/12/16 08:05:40] [DEBUG] pushed value '1054' onto AMX stack
[10/12/16 08:05:40] [DEBUG] executing AMX callback with index '-10044'
[10/12/16 08:05:40] [DEBUG] AMX callback executed with error '0'
[10/12/16 08:05:40] [INFO] Callback successfully executed.
Alles anzeigen
Ich habe die Logs gefunden:
Mysq_Log Datei:
[10/12/16 07:13:42] [INFO] changed log level from 'warning, error' to 'debug, info, warning, error'
[10/12/16 07:14:38] [DEBUG] mysql_format(1, 0xF54B96F0, 128, "SELECT id FROM Accounts WHERE Name = '%e'") (Nitradoscript.p:264)
[10/12/16 07:14:38] [DEBUG] CHandle::EscapeString(this=0x8bf9a70, src='Tiriago')
[10/12/16 07:14:38] [DEBUG] CConnection::EscapeString(src='Tiriago', this=0x8cea698, connection=0x8d6b140)
[10/12/16 07:14:38] [DEBUG] CHandle::EscapeString - return value: true, escaped string: 'Tiriago'
[10/12/16 07:14:38] [DEBUG] mysql_format: return value: '46' (Nitradoscript.p:264)
[10/12/16 07:14:38] [DEBUG] mysql_pquery(1, "SELECT id FROM Accounts WHERE Name = 'Tiriago'", "OnUserCheck", "d") (Nitradoscript.p:265)
[10/12/16 07:14:38] [DEBUG] CCallback::Create(amx=0x8d6ad00, name='OnUserCheck', format='d', params=0xf54b96d8, param_offset=5)
[10/12/16 07:14:38] [DEBUG] CCallback::Create - callback index for 'OnUserCheck': 32
[10/12/16 07:14:38] [DEBUG] processing specifier 'd' with parameter index 0
[10/12/16 07:14:38] [DEBUG] retrieved and pushed value '0'
[10/12/16 07:14:38] [INFO] Callback 'OnUserCheck' set up for delayed execution.
[10/12/16 07:14:38] [DEBUG] created delayed callback with 1 parameter
[10/12/16 07:14:38] [DEBUG] CHandle::Execute(this=0x8bf9a70, type=2, query=0x8db9ff0)
[10/12/16 07:14:38] [DEBUG] CConnectionPool::Queue(query=0x8db9ff0, this=0x8cf1458)
[10/12/16 07:14:38] [DEBUG] CHandle::Execute - return value: true
[10/12/16 07:14:38] [DEBUG] mysql_pquery: return value: '1' (Nitradoscript.p:265)
[10/12/16 07:14:38] [DEBUG] CConnection::Execute(query=0x8db9ff0, this=0xf4b8e008, connection=0x8d91ac0)
[10/12/16 07:14:38] [DEBUG] CQuery::Execute(this=0x8db9ff0, connection=0x8d91ac0)
[10/12/16 07:14:38] [ERROR] error #1054 while executing query "SELECT id FROM Accounts WHERE Name = 'Tiriago'": Unknown column 'Name' in 'where clause' (Nitradoscript.p:265)
[10/12/16 07:14:38] [DEBUG] CConnection::GetError(this=0xf4b8e008, connection=0x8d91ac0)
[10/12/16 07:14:38] [DEBUG] CCallback::Create(amx=0x8d6ad00, name='OnQueryError', format='dsssd)
[10/12/16 07:14:38] [DEBUG] CCallback::Create - callback index for 'OnQueryError': -10044
[10/12/16 07:14:38] [DEBUG] processing specifier 'd'
[10/12/16 07:14:38] [DEBUG] retrieved and pushed value '1054'
[10/12/16 07:14:38] [DEBUG] processing specifier 's'
[10/12/16 07:14:38] [DEBUG] retrieved and pushed value 'Unknown column 'Name' in 'where clause''
[10/12/16 07:14:38] [DEBUG] processing specifier 's'
[10/12/16 07:14:38] [DEBUG] retrieved and pushed value 'OnUserCheck'
[10/12/16 07:14:38] [DEBUG] processing specifier 's'
[10/12/16 07:14:38] [DEBUG] retrieved and pushed value 'SELECT id FROM Accounts WHERE Name = 'Tiriago''
[10/12/16 07:14:38] [DEBUG] processing specifier 'd'
[10/12/16 07:14:38] [DEBUG] retrieved and pushed value '1'
[10/12/16 07:14:38] [INFO] Callback 'OnQueryError' set up for delayed execution.
[10/12/16 07:14:38] [DEBUG] created delayed callback with 5 parameters
[10/12/16 07:14:38] [DEBUG] CCallback::Execute(amx=0x8d6ad00, index=-10044, num_params=5)
[10/12/16 07:14:38] [INFO] Executing callback 's�' with 5 parameters...
[10/12/16 07:14:38] [DEBUG] processing internal specifier 'c'
[10/12/16 07:14:38] [DEBUG] pushed value '1' onto AMX stack
[10/12/16 07:14:38] [DEBUG] processing internal specifier 's'
[10/12/16 07:14:38] [DEBUG] pushed value 'SELECT id FROM Accounts WHERE Name = 'Tiriago'' onto AMX stack
[10/12/16 07:14:38] [DEBUG] processing internal specifier 's'
[10/12/16 07:14:38] [DEBUG] pushed value 'OnUserCheck' onto AMX stack
[10/12/16 07:14:38] [DEBUG] processing internal specifier 's'
[10/12/16 07:14:38] [DEBUG] pushed value 'Unknown column 'Name' in 'where clause'' onto AMX stack
[10/12/16 07:14:38] [DEBUG] processing internal specifier 'c'
[10/12/16 07:14:38] [DEBUG] pushed value '1054' onto AMX stack
[10/12/16 07:14:38] [DEBUG] executing AMX callback with index '-10044'
[10/12/16 07:14:38] [DEBUG] AMX callback executed with error '0'
[10/12/16 07:14:38] [INFO] Callback successfully executed.
[10/12/16 07:14:40] [DEBUG] mysql_format(1, 0xF54B96F0, 128, "SELECT id FROM Accounts WHERE Name = '%e'") (Nitradoscript.p:264)
[10/12/16 07:14:40] [DEBUG] CHandle::EscapeString(this=0x8bf9a70, src='Tiriago')
[10/12/16 07:14:40] [DEBUG] CConnection::EscapeString(src='Tiriago', this=0x8cea698, connection=0x8d6b140)
[10/12/16 07:14:40] [DEBUG] CHandle::EscapeString - return value: true, escaped string: 'Tiriago'
[10/12/16 07:14:40] [DEBUG] mysql_format: return value: '46' (Nitradoscript.p:264)
[10/12/16 07:14:40] [DEBUG] mysql_pquery(1, "SELECT id FROM Accounts WHERE Name = 'Tiriago'", "OnUserCheck", "d") (Nitradoscript.p:265)
[10/12/16 07:14:40] [DEBUG] CCallback::Create(amx=0x8d6ad00, name='OnUserCheck', format='d', params=0xf54b96d8, param_offset=5)
[10/12/16 07:14:40] [DEBUG] CCallback::Create - callback index for 'OnUserCheck': 32
[10/12/16 07:14:40] [DEBUG] processing specifier 'd' with parameter index 0
[10/12/16 07:14:40] [DEBUG] retrieved and pushed value '0'
[10/12/16 07:14:40] [INFO] Callback 'OnUserCheck' set up for delayed execution.
[10/12/16 07:14:40] [DEBUG] created delayed callback with 1 parameter
[10/12/16 07:14:40] [DEBUG] CHandle::Execute(this=0x8bf9a70, type=2, query=0x8db9c40)
[10/12/16 07:14:40] [DEBUG] CConnectionPool::Queue(query=0x8db9c40, this=0x8cf1458)
[10/12/16 07:14:40] [DEBUG] CHandle::Execute - return value: true
[10/12/16 07:14:40] [DEBUG] mysql_pquery: return value: '1' (Nitradoscript.p:265)
[10/12/16 07:14:40] [DEBUG] CConnection::Execute(query=0x8db9c40, this=0xf430c008, connection=0x8d98110)
[10/12/16 07:14:40] [DEBUG] CQuery::Execute(this=0x8db9c40, connection=0x8d98110)
[10/12/16 07:14:40] [ERROR] error #1054 while executing query "SELECT id FROM Accounts WHERE Name = 'Tiriago'": Unknown column 'Name' in 'where clause' (Nitradoscript.p:265)
[10/12/16 07:14:40] [DEBUG] CConnection::GetError(this=0xf430c008, connection=0x8d98110)
[10/12/16 07:14:40] [DEBUG] CCallback::Create(amx=0x8d6ad00, name='OnQueryError', format='dsssd)
[10/12/16 07:14:40] [DEBUG] CCallback::Create - callback index for 'OnQueryError': -10044
[10/12/16 07:14:40] [DEBUG] processing specifier 'd'
[10/12/16 07:14:40] [DEBUG] retrieved and pushed value '1054'
[10/12/16 07:14:40] [DEBUG] processing specifier 's'
[10/12/16 07:14:40] [DEBUG] retrieved and pushed value 'Unknown column 'Name' in 'where clause''
[10/12/16 07:14:40] [DEBUG] processing specifier 's'
[10/12/16 07:14:40] [DEBUG] retrieved and pushed value 'OnUserCheck'
[10/12/16 07:14:40] [DEBUG] processing specifier 's'
[10/12/16 07:14:40] [DEBUG] retrieved and pushed value 'SELECT id FROM Accounts WHERE Name = 'Tiriago''
[10/12/16 07:14:40] [DEBUG] processing specifier 'd'
[10/12/16 07:14:40] [DEBUG] retrieved and pushed value '1'
[10/12/16 07:14:40] [INFO] Callback 'OnQueryError' set up for delayed execution.
[10/12/16 07:14:40] [DEBUG] created delayed callback with 5 parameters
[10/12/16 07:14:40] [DEBUG] CCallback::Execute(amx=0x8d6ad00, index=-10044, num_params=5)
[10/12/16 07:14:40] [INFO] Executing callback 's�' with 5 parameters...
[10/12/16 07:14:40] [DEBUG] processing internal specifier 'c'
[10/12/16 07:14:40] [DEBUG] pushed value '1' onto AMX stack
[10/12/16 07:14:40] [DEBUG] processing internal specifier 's'
[10/12/16 07:14:40] [DEBUG] pushed value 'SELECT id FROM Accounts WHERE Name = 'Tiriago'' onto AMX stack
[10/12/16 07:14:40] [DEBUG] processing internal specifier 's'
[10/12/16 07:14:40] [DEBUG] pushed value 'OnUserCheck' onto AMX stack
[10/12/16 07:14:40] [DEBUG] processing internal specifier 's'
[10/12/16 07:14:40] [DEBUG] pushed value 'Unknown column 'Name' in 'where clause'' onto AMX stack
[10/12/16 07:14:40] [DEBUG] processing internal specifier 'c'
[10/12/16 07:14:40] [DEBUG] pushed value '1054' onto AMX stack
[10/12/16 07:14:40] [DEBUG] executing AMX callback with index '-10044'
[10/12/16 07:14:40] [DEBUG] AMX callback executed with error '0'
[10/12/16 07:14:40] [INFO] Callback successfully executed.
[10/12/16 07:14:40] [DEBUG] mysql_format(1, 0xF54B96F0, 128, "SELECT id FROM Accounts WHERE Name = '%e'") (Nitradoscript.p:264)
[10/12/16 07:14:40] [DEBUG] CHandle::EscapeString(this=0x8bf9a70, src='Tiriago')
[10/12/16 07:14:40] [DEBUG] CConnection::EscapeString(src='Tiriago', this=0x8cea698, connection=0x8d6b140)
[10/12/16 07:14:40] [DEBUG] CHandle::EscapeString - return value: true, escaped string: 'Tiriago'
[10/12/16 07:14:40] [DEBUG] mysql_format: return value: '46' (Nitradoscript.p:264)
[10/12/16 07:14:40] [DEBUG] mysql_pquery(1, "SELECT id FROM Accounts WHERE Name = 'Tiriago'", "OnUserCheck", "d") (Nitradoscript.p:265)
[10/12/16 07:14:40] [DEBUG] CCallback::Create(amx=0x8d6ad00, name='OnUserCheck', format='d', params=0xf54b96d8, param_offset=5)
[10/12/16 07:14:40] [DEBUG] CCallback::Create - callback index for 'OnUserCheck': 32
[10/12/16 07:14:40] [DEBUG] processing specifier 'd' with parameter index 0
[10/12/16 07:14:40] [DEBUG] retrieved and pushed value '0'
[10/12/16 07:14:40] [INFO] Callback 'OnUserCheck' set up for delayed execution.
[10/12/16 07:14:40] [DEBUG] created delayed callback with 1 parameter
[10/12/16 07:14:40] [DEBUG] CHandle::Execute(this=0x8bf9a70, type=2, query=0x8dba768)
[10/12/16 07:14:40] [DEBUG] CConnectionPool::Queue(query=0x8dba768, this=0x8cf1458)
[10/12/16 07:14:40] [DEBUG] CHandle::Execute - return value: true
[10/12/16 07:14:40] [DEBUG] mysql_pquery: return value: '1' (Nitradoscript.p:265)
[10/12/16 07:14:40] [DEBUG] CConnection::Execute(query=0x8dba768, this=0xf4b8e008, connection=0x8d91ac0)
[10/12/16 07:14:40] [DEBUG] CQuery::Execute(this=0x8dba768, connection=0x8d91ac0)
[10/12/16 07:14:40] [ERROR] error #1054 while executing query "SELECT id FROM Accounts WHERE Name = 'Tiriago'": Unknown column 'Name' in 'where clause' (Nitradoscript.p:265)
[10/12/16 07:14:40] [DEBUG] CConnection::GetError(this=0xf4b8e008, connection=0x8d91ac0)
[10/12/16 07:14:40] [DEBUG] CCallback::Create(amx=0x8d6ad00, name='OnQueryError', format='dsssd)
[10/12/16 07:14:40] [DEBUG] CCallback::Create - callback index for 'OnQueryError': -10044
[10/12/16 07:14:40] [DEBUG] processing specifier 'd'
[10/12/16 07:14:40] [DEBUG] retrieved and pushed value '1054'
[10/12/16 07:14:40] [DEBUG] processing specifier 's'
[10/12/16 07:14:40] [DEBUG] retrieved and pushed value 'Unknown column 'Name' in 'where clause''
[10/12/16 07:14:40] [DEBUG] processing specifier 's'
[10/12/16 07:14:40] [DEBUG] retrieved and pushed value 'OnUserCheck'
[10/12/16 07:14:40] [DEBUG] processing specifier 's'
[10/12/16 07:14:40] [DEBUG] retrieved and pushed value 'SELECT id FROM Accounts WHERE Name = 'Tiriago''
[10/12/16 07:14:40] [DEBUG] processing specifier 'd'
[10/12/16 07:14:40] [DEBUG] retrieved and pushed value '1'
[10/12/16 07:14:40] [INFO] Callback 'OnQueryError' set up for delayed execution.
[10/12/16 07:14:40] [DEBUG] created delayed callback with 5 parameters
[10/12/16 07:14:40] [DEBUG] CCallback::Execute(amx=0x8d6ad00, index=-10044, num_params=5)
[10/12/16 07:14:40] [INFO] Executing callback 's�' with 5 parameters...
[10/12/16 07:14:40] [DEBUG] processing internal specifier 'c'
[10/12/16 07:14:40] [DEBUG] pushed value '1' onto AMX stack
[10/12/16 07:14:40] [DEBUG] processing internal specifier 's'
[10/12/16 07:14:40] [DEBUG] pushed value 'SELECT id FROM Accounts WHERE Name = 'Tiriago'' onto AMX stack
[10/12/16 07:14:40] [DEBUG] processing internal specifier 's'
[10/12/16 07:14:40] [DEBUG] pushed value 'OnUserCheck' onto AMX stack
[10/12/16 07:14:40] [DEBUG] processing internal specifier 's'
[10/12/16 07:14:40] [DEBUG] pushed value 'Unknown column 'Name' in 'where clause'' onto AMX stack
[10/12/16 07:14:40] [DEBUG] processing internal specifier 'c'
[10/12/16 07:14:40] [DEBUG] pushed value '1054' onto AMX stack
[10/12/16 07:14:40] [DEBUG] executing AMX callback with index '-10044'
[10/12/16 07:14:40] [DEBUG] AMX callback executed with error '0'
[10/12/16 07:14:40] [INFO] Callback successfully executed.
Alles anzeigen
Habe keine Log da die nicht generiert wird
Kann dir nur die Server.Log gebe.
Server.log:
----------
Loaded log file: "server_log.txt".
----------
SA-MP Dedicated Server
----------------------
v0.3.7-R2, (C)2005-2015 SA-MP Team
[22:45:57] filterscripts = "" (string)
[22:45:57] weburl = "www.sa-mp.com" (string)
[22:45:57]
[22:45:57] Server Plugins
[22:45:57] --------------
[22:45:57] Loading plugin: mysql.so
[22:45:57] >> plugin.mysql: R41 successfully loaded.
[22:45:57] Loaded.
[22:45:57] Loading plugin: log-core.so
[22:45:57] Plugin does not conform to architecture.
[22:45:57] Failed.
[22:45:57] Loading plugin: sscanf.so
[22:45:57]
[22:45:57] ===============================
[22:45:57] sscanf plugin loaded.
[22:45:57] Version: 2.8.2
[22:45:57] (c) 2012 Alex "Y_Less" Cole
[22:45:57] ===============================
[22:45:57] Loaded.
[22:45:57] Loading plugin: streamer.so
[22:45:57]
*** Streamer Plugin v2.8.2 by Incognito loaded ***
[22:45:57] Loaded.
[22:45:57] Loaded 3 plugins.
[22:45:57]
[22:45:57] Filterscripts
[22:45:57] ---------------
[22:45:57] Loaded 0 filterscripts.
[22:45:57] [MYSQL] Verbingungsaufbau.........
[22:45:57]
----------------------------------
[22:45:57] Selfmade Version 0.2
[22:45:57] ----------------------------------
[22:45:57] Number of vehicle models: 28
Alles anzeigen
Guten Abend
Mir ist grade aufgefallen das wenn ich mich auf mein Server Verbinde kann ich nur auf Spawn drücken.
Ich habe kein Plan ob es am Script liegt oder nicht.
Hier die Sachen die Für die Account-Erstellung wichtig sind:
Define:
Mysql Daten:
#define MYSQL_HOST "85.131.156.213"
#define MYSQL_USER "ni630601_1_DB"
#define MYSQL_PASS "0fufEL1y"
#define MYSQL_DBSE "ni630601_1_DB"
new MySQL:handle;
Spielerinfo:
enum playerInfo{
db_id,
bool:eingeloggt,
Name[MAX_PLAYER_NAME],
Adminlevel,
Level,
Money,
Fraktion,
Rang,
Spawn
}
new sInfo[MAX_PLAYER_NAME][playerInfo];
Alles anzeigen
FraktionsEnum:
enum frakteEnum{
f_name[300],
Float:f_x,
Float:f_y,
Float:f_z,
Float:f_r,
f_inter,
f_world,
f_color
}
new fInfo[][frakteEnum] ={
{"Zivilist",329.0244,-1513.3033,36.0391,225.8344,0,0,weiß},//Zivilist 0
{"SAPD",213.4162,162.7460,1003.0234,274.4569,3,1,blau},//SAPD 1
{"SWAT",2731.5903,-2450.0164,17.5937,272.4424,0,0,helblau},//SWAT2
{"FBI",2286.9651,2431.6011,10.8203,176.4887,0,0,duneklhelblau},//FBI3
{"ARMY",214.2768,1822.5925,6.4141,265.0869,0,0,hellgrün},//ARMY4
{"Medic/Feuerwehr",302.9467,-1505.8025,24.6007,231.6743,0,0,rot},//MEDIC5
{"Fahrschule",2124.3032,-2273.0491,20.6719,221.7338,0,0,orange},//Fahrschule6
{"Aztecas",2788.4141,-1944.7075,13.5469,87.2128,0,0,türkis},//AZTECAS7
{"Vagos",204.6566,39.7421,2.5781,260.2514,0,0,gelb},//Vagos8
{"Ballas",1084.8976,-1226.7927,15.8203,269.7700,0,0,pink},//Ballas9
{"Yakuza",-2188.6282,-2265.0452,30.6250,71.4091,0,0,grau}//Yakuza10
};
Alles anzeigen
OnGameModeExit:
OnPlayerRequestClass:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1686.2013,-2315.4673,13.3828);
SetPlayerCameraPos(playerid, 1686.2013,-2315.4673,13.3828);
SetPlayerCameraLookAt(playerid, 1686.2013,-2315.4673,13.3828);
SetPlayerFacingAngle(playerid,179.8357);
//Wenn der Spieler die Class-Selection betritt prüfe,ob er bereits eingeloggt ist
if(!sInfo[playerid][eingeloggt])
{
//Wenn nicht,dann prüfe ob der Spieler ein Konto hat
new query[128];
mysql_format(handle,query,sizeof(query),"SELECT id FROM Accounts WHERE Name = '%e'",sInfo[playerid][Name]);
mysql_pquery(handle,query,"OnUserCheck","d",playerid);
}
return 1;
}
Alles anzeigen
OnPlayerConnect:
public OnPlayerConnect(playerid)
{
sInfo[playerid][db_id] =0;
sInfo[playerid][eingeloggt] =false;
sInfo[playerid][Adminlevel] =0;
sInfo[playerid][Level] = 0;
sInfo[playerid][Money] = 0;
sInfo[playerid][Fraktion] = 0;
sInfo[playerid][Rang] = 0;
sInfo[playerid][Spawn] = 0;
GetPlayerName(playerid,sInfo[playerid][Name],MAX_PLAYER_NAME);
SetPlayerColor(playerid,weiß);
sInfo[playerid][Level]=1;
SetPlayerScore(playerid,sInfo[playerid][Level]);
return 1;
}
Alles anzeigen
OnUserCheck:
public OnUserCheck(playerid)
{
//Query wurde ausgeführt und das Ergebnis im Cache gespeichert
new rows;
cache_get_row_count(rows);
if(rows == 0)
{
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"Account erstellen","Bitte Registriere dich:","Registrieren","Abbrechen");
}
else
{
//Es existiert ein Ergebnis,das heißt der Spieler ist registriert und muss sich einloggen
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Einloggen","Bitte loggte dich ein:","Einloggen","Abbrechen");
}
return 1;
}
resetPlayer(playerid)
{
for(new i=0; i<sizeof(sInfo[]); i++)
{
sInfo[playerid][playerInfo:i]=0;
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
SaveUserStats(playerid);
resetPlayer(playerid);
return 1;
}
Alles anzeigen
OnPlayerSpawn:
public OnPlayerSpawn(playerid)
{
if(!isPlayerInFrakt(playerid,0))
{
if(sInfo[playerid][Spawn]==1)
{
new fID;
fID= sInfo[playerid][Fraktion];
SetPlayerPos(playerid,fInfo[fID][f_x],fInfo[fID][f_y],fInfo[fID][f_z]);
SetPlayerFacingAngle(playerid,fInfo[fID][f_r]);
SetPlayerInterior(playerid,fInfo[fID][f_inter]);
SetPlayerVirtualWorld(playerid,fInfo[fID][f_world]);
SetPlayerColor(playerid,fInfo[fID][f_color]);
}
}
SendClientMessage(playerid,rot,"/hilfe um die Befehle zu sehen!");
return 1;
}
Alles anzeigen
Fraktion und Adminfunktion:
isPlayerInFrakt(playerid,f_id){
if(sInfo[playerid][Fraktion]==f_id)return 1;
return 0;
}
isAdmin(playerid,alevel)
{
if(sInfo[playerid][Adminlevel]>=alevel)return 1;
return 0;
}
Spawnchange:
ocmd:spawnchange(playerid,params[])
{
if(isPlayerInFrakt(playerid,0)) return SendClientMessage(playerid,rot,"Du bist in keiner Fraktion.");
if(sInfo[playerid][Spawn] == 0)
{
sInfo[playerid][Spawn] = 1;
}
else
{
sInfo[playerid][Spawn] = 0;
}
SendClientMessage(playerid,grün,"Spawn geändert");
return 1;
}
Alles anzeigen
Register/Login Dialog:
if(dialogid == DIALOG_REGISTER)
{
//Spieler hat Abbrechen gewählt
if(!response) return Kick(playerid);
//Wenn der Spieler kein, oder ein zu kurzes, Passwort eingegeben hat
if(strlen(inputtext) < 5) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Registration", "Bitte registriere Dich:\n{0xFF0000FF}Mindestens 5 Zeichen!", "Ok", "Abbrechen");
//Wenn alles passt wird der Spieler in der Datenbank angelegt
//Als Verschlüsselung für das Passwort wird MD5 verwendet
new query[256];
mysql_format(handle, query, sizeof(query), "INSERT INTO Accounts (name, password) VALUES ('%s', MD5('%s'))", sInfo[playerid][Name], inputtext);
//Das Query wird abgesendet und die playerid an OnUserRegister übergeben
mysql_pquery(handle, query, "OnUserRegister", "d", playerid);
return 1;
}
if(dialogid == DIALOG_LOGIN)
{
//Spieler hat Abbrechen gewählt
if(!response) return Kick(playerid);
//Wenn der Spieler kein, oder ein zu kurzes, Passwort eingegeben hat
if(strlen(inputtext) < 5) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Anmeldung", "Bitte logge Dich ein:\n{0xFF0000FF}Mindestens 5 Zeichen!", "Ok", "Abbrechen");
//Wenn alles passt wird die Datenbank ausgelesen
new query[256];
mysql_format(handle, query, sizeof(query), "SELECT * FROM Accounts WHERE name = '%s' AND password = MD5('%s')", sInfo[playerid][Name], inputtext);
//Das Query wird abgesendet und die playerid an OnUserLogin übergeben
mysql_pquery(handle, query, "OnUserLogin", "d", playerid);
return 1;
Alles anzeigen
MySQL_SetupConnection:
stock MySQL_SetupConnection(ttl=4)
{
print("[MYSQL] Verbingungsaufbau.........");
mysql_log();
handle = mysql_connect(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DBSE);
//MYSQL Verbindungsprüfung mit neu verbinden!:
if(mysql_errno(handle) != 0)
{
//Fehler bei der Verbindung mit der Datenban:
if(ttl >1)
{
//Versuche erneute Verbindung aufzubauen
print("[MYSQL] Es konnte keine Verbindung zur Datenbank hergestellt werden.");
printf("[MYSQL] Starte neuen Verbindungsaufbau versuch (ttl: %d).",ttl-1);
return MySQL_SetupConnection(ttl-1);
}
else
{
//Abbrechen und Server Schließen
print("[MYSQL] Es konnte keine Verbindung zur Datenbank hergestellt werden.");
print("[MYSQL] Bitte überprüfen Sie die Verbindungsdaten!");
print("[MYSQL] Der Server wird heruntergefahren!");
return SendRconCommand("exit");
}
}
//printf("[MYSQL] Die Verbindung zur Datenbank wurde erfolgreich hergestellt! Handle: %d",handle);
return 1;
}
Alles anzeigen
OnUserRegister:
public OnUserRegister(playerid)
{
//Der Spieler wurde in die Datenbank eingetragen, es wird die id ausgelsen
sInfo[playerid][db_id] = cache_insert_id();
SendClientMessage(playerid,grün,"[Konto]Registration erfolgreich");
return 1;
}
OnUserLogin:
public OnUserLogin(playerid)
{
new rows;
cache_get_row_count(rows);
if(rows == 0)
{
//Der Spieler hat ein falsches Passwort eingegeben
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Einloggen","Bitte logge dich ein:\n{0xFF0000FF}Falsches Passwort!","Einloggen","Abbrechen");
}
else
{
//Es existiert ein Ergebnis,das heißt der Spieler hat das richtige Passwort eingegeben
//Wir lesen nun die erste Zeile des Caches aus (id 0)
cache_get_value_name_int(0,"db_id",sInfo[playerid][db_id]);
cache_get_value_name_int(0,"Adminlevel",sInfo[playerid][Adminlevel]);
cache_get_value_name_int(0,"Level",sInfo[playerid][Level]);
cache_get_value_name_int(0,"Money",sInfo[playerid][Money]);
cache_get_value_name_int(0,"Fraktion",sInfo[playerid][Fraktion]);
cache_get_value_name_int(0,"Rang",sInfo[playerid][Rang]);
cache_get_value_name_int(0,"Spawn",sInfo[playerid][Spawn]);
}
return 1;
}
Alles anzeigen
SaveUserStats und SpielerName:
stock SaveUserStats(playerid)
{
//Wen der Spieler nicht eingeloggt ist, dann speichere seine Statistiken nicht
if(!sInfo[playerid][eingeloggt])return 1;
//Ansonsten speichere Sie ab
new query[600];
mysql_format(handle,query,sizeof(query),"UPDATE Accounts Set Name = '%s',Adminlevel = '%d',Level = '%d',Money = '%d',Fraktion = '%d',Rang = '%d',Spawn = '%d' WHERE id = '%d' ",
sInfo[playerid][Name],sInfo[playerid][Adminlevel],sInfo[playerid][Level],sInfo[playerid][Money],sInfo[playerid][Fraktion],sInfo[playerid][Rang],sInfo[playerid][Spawn]);
//Das Query wird abgesendet
mysql_pquery(handle,query);
return 1;
}
stock SpielerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
return name;
}
Alles anzeigen
Mir ist aufgefallen das man sogar unter die Map schauen kann wenn man im Wasser ist.
Guten Morgen
Ich versuche mein Server derzeit mit meiner Mysql-DB zu verbinden.
iP: 85.131.156.213
so wie mit
localhost
lässt er sich nicht verbinden.
So sieht meine CFG aus:
X= Zensierter Wert.
echo Executing Server Config...
lanmode 0
rcon_password x
hostname This Is Sparter
gamemode0 Nitradoscript 1
filterscripts
announce 0
query 1
weburl
maxnpc 0
onfoot_rate 40
incar_rate 40
weapon_rate 40
stream_distance 300.0
stream_rate 1000
plugins mysql.so log-core.so sscanf.so streamer.so
language Deutsch/German
maxplayers 40
bind 85.131.156.213
bindip 85.131.156.213
port 7777
Alles anzeigen
Server Log:
----------
Loaded log file: "server_log.txt".
----------
SA-MP Dedicated Server
----------------------
v0.3.7-R2, (C)2005-2015 SA-MP Team
[04:39:09] filterscripts = "" (string)
[04:39:09] weburl = "www.sa-mp.com" (string)
[04:39:09]
[04:39:09] Server Plugins
[04:39:09] --------------
[04:39:09] Loading plugin: mysql.so
[04:39:09] >> plugin.mysql: R41 successfully loaded.
[04:39:09] Loaded.
[04:39:09] Loading plugin: log-core.so
[04:39:09] Plugin does not conform to architecture.
[04:39:09] Failed.
[04:39:09] Loading plugin: sscanf.so
[04:39:09]
[04:39:09] ===============================
[04:39:09] sscanf plugin loaded.
[04:39:09] Version: 2.8.2
[04:39:09] (c) 2012 Alex "Y_Less" Cole
[04:39:09] ===============================
[04:39:09] Loaded.
[04:39:09] Loading plugin: streamer.so
[04:39:09]
*** Streamer Plugin v2.8.2 by Incognito loaded ***
[04:39:09] Loaded.
[04:39:09] Loaded 3 plugins.
[04:39:09]
[04:39:09] Filterscripts
[04:39:09] ---------------
[04:39:09] Loaded 0 filterscripts.
[04:39:09] [MYSQL] Verbingungsaufbau.........
[04:39:09] [MYSQL] Es konnte keine Verbindung zur Datenbank hergestellt werden.
[04:39:09] [MYSQL] Starte neuen Verbindungsaufbau versuch (ttl: 3).
[04:39:09] [MYSQL] Verbingungsaufbau.........
[04:39:09] [MYSQL] Es konnte keine Verbindung zur Datenbank hergestellt werden.
[04:39:09] [MYSQL] Starte neuen Verbindungsaufbau versuch (ttl: 2).
[04:39:09] [MYSQL] Verbingungsaufbau.........
[04:39:09] [MYSQL] Es konnte keine Verbindung zur Datenbank hergestellt werden.
[04:39:09] [MYSQL] Starte neuen Verbindungsaufbau versuch (ttl: 1).
[04:39:09] [MYSQL] Verbingungsaufbau.........
[04:39:09] [MYSQL] Es konnte keine Verbindung zur Datenbank hergestellt werden.
[04:39:09] [MYSQL] Bitte �berpr�fen Sie die Verbindungsdaten!
[04:39:09] [MYSQL] Der Server wird heruntergefahren!
[04:39:09]
----------------------------------
[04:39:09] Selfmade Version 0.2
[04:39:09] ----------------------------------
[04:39:09] Number of vehicle models: 28
[04:39:09] --- Server Shutting Down.
[04:39:09] plugin.mysql: Unloading plugin...
[04:39:09] plugin.mysql: Plugin unloaded.
[04:39:09]
[04:39:09] ===============================
[04:39:09] sscanf plugin unloaded.
[04:39:09] ===============================
[04:39:09]
*** Streamer Plugin v2.8.2 by Incognito unloaded ***
Alles anzeigen
Mysql:
//Mysql Daten:
#define MYSQL_HOST "85.131.156.213"
#define MYSQL_USER "ni630601_1_DB"
#define MYSQL_PASS "x"
#define MYSQL_DBSE "ni630601_1_DB"
new MySQL:handle;
OnGameModeInit:
MySQL_SetupConnection();
OnGameModeExit:
mysql_close(handle);
OnPlayerRequestClass:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1686.2013,-2315.4673,13.3828);
SetPlayerCameraPos(playerid, 1686.2013,-2315.4673,13.3828);
SetPlayerCameraLookAt(playerid, 1686.2013,-2315.4673,13.3828);
SetPlayerFacingAngle(playerid,179.8357);
//Wenn der Spieler die Class-Selection betritt prüfe,ob er bereits eingeloggt ist
if(!sInfo[playerid][eingeloggt])
{
//Wenn nicht,dann prüfe ob der Spieler ein Konto hat
new query[128];
mysql_format(handle,query,sizeof(query),"SELECT id FROM Accounts WHERE Name = '%e'",sInfo[playerid][Name]);
mysql_pquery(handle,query,"OnUserCheck","d",playerid);
}
return 1;
}
OnUserCheck:
public OnUserCheck(playerid)
{
//Query wurde ausgeführt und das Ergebnis im Cache gespeichert
new rows;
cache_get_row_count(rows);
if(rows == 0)
{
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"Account erstellen","Bitte Registriere dich:","Registrieren","Abbrechen");
}
else
{
//Es existiert ein Ergebnis,das heißt der Spieler ist registriert und muss sich einloggen
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Einloggen","Bitte loggte dich ein:","Einloggen","Abbrechen");
}
return 1;
}
resetPlayer(playerid)
{
for(new i=0; i<sizeof(sInfo[]); i++)
{
sInfo[playerid][playerInfo:i]=0;
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
SaveUserStats(playerid);
resetPlayer(playerid);
return 1;
}
MySQL_SetupConnection:
stock MySQL_SetupConnection(ttl=4)
{
print("[MYSQL] Verbingungsaufbau.........");
mysql_log();
handle = mysql_connect(MYSQL_HOST,MYSQL_USER,MYSQL_DBSE,MYSQL_PASS);
//MYSQL Verbindungsprüfung mit neu verbinden!:
if(mysql_errno(handle) != 0)
{
//Fehler bei der Verbindung mit der Datenban:
if(ttl >1)
{
//Versuche erneute Verbindung aufzubauen
print("[MYSQL] Es konnte keine Verbindung zur Datenbank hergestellt werden.");
printf("[MYSQL] Starte neuen Verbindungsaufbau versuch (ttl: %d).",ttl-1);
return MySQL_SetupConnection(ttl-1);
}
else
{
//Abbrechen und Server Schließen
print("[MYSQL] Es konnte keine Verbindung zur Datenbank hergestellt werden.");
print("[MYSQL] Bitte überprüfen Sie die Verbindungsdaten!");
print("[MYSQL] Der Server wird heruntergefahren!");
return SendRconCommand("exit");
}
}
//printf("[MYSQL] Die Verbindung zur Datenbank wurde erfolgreich hergestellt! Handle: %d",handle);
return 1;
}
Alles anzeigen
Der Server startet jetzt nach dem Ändern überhaupt nicht.
Es kommt nicht mal mehr eine Server_Log.txt datei
Guten Morgen Breadfish
Ich habe mir die Mysql.so sscan.so streamer.so herrunter geladen und wollte es direkt auf mein Nitrado-Server packen.
Jedesmal wenn ich Server Start kommt nur folgendes:
Letzte Änderung in der Logdatei: Tue, 11 Oct 2016 03:42:04 +0200
----------
Loaded log file: "server_log.txt".
----------
SA-MP Dedicated Server
----------------------
v0.3.7-R2, (C)2005-2015 SA-MP Team
[03:42:04] filterscripts = "" (string)
[03:42:04] weburl = "www.sa-mp.com" (string)
[03:42:04]
[03:42:04] Server Plugins
[03:42:04] --------------
[03:42:04] Loaded 0 plugins.
[03:42:04]
[03:42:04] Filterscripts
[03:42:04] ---------------
[03:42:04] Loaded 0 filterscripts.
[03:42:04] Script[gamemodes/Nitradoscript.amx]: Run time error 19: "File or function is not found"
[03:42:04] Number of vehicle models: 0
Alles anzeigen
x = Zensiert
Server Config:
echo Executing Server Config...
lanmode 0
rcon_password x
hostname This Is Sparter
gamemode0 Nitradoscript 1
filterscripts
announce 0
query 1
weburl
maxnpc 0
onfoot_rate 40
incar_rate 40
weapon_rate 40
stream_distance 300.0
stream_rate 1000
plugin mysql.so sscanf.so streamer.so
language Deutsch/German
maxplayers 40
bind x
bindip x
port x
Alles anzeigen
Trozdem schade zu behaupten wäre nichts dran geändert. Nur weil manche Sachen nicht geändert wurden muss es dennoch nicht komplett 1:1 das script sein was man downloaden kann
@DarcX bitte auch mal dazu äußern.
@Szertockz hast du dafür auch beweise?
Das was du grade machst ist eine sehr große anschuldigung