FUnktioniert nicht hier der Code und der MYSQL LOG
#define DIALOG_REGISTER 1
#define DIALOG_REGISTER2 31
enum playerInfo{
eingeloggt,
level,
db_id,
alevel,
slevel,
Skin,
fraktion,
rang,
leader,
coleader,
spawnchange,
tutpart,
regstep,
geschlecht
}
forward TutTimer(playerid);
savePlayer(playerid)
{
sInfo[playerid][eingeloggt] = 1;
new query[256];
format(query,sizeof(query),"UPDATE user SET level='%i',skin='%i',geschlecht='%i',money='%i',alevel='%i',slevel='%i',fraktion='%i',rang='%i',leader='%i',coleader='%i',spawnchange='%i' WHERE id='%i'",
GetPlayerScore(playerid),GetPlayerSkin(playerid),GetPlayerMoney(playerid),sInfo[playerid][geschlecht],sInfo[playerid][alevel],sInfo[playerid][slevel],sInfo[playerid][fraktion],sInfo[playerid][rang],sInfo[playerid][leader],sInfo[playerid][coleader],sInfo,sInfo[playerid][spawnchange],sInfo[playerid][db_id]);
return 1;
}
stock SaveAllPlayers()
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
if(!IsPlayerConnected(playerid)) continue;
new query[256];
format(query,sizeof(query),"UPDATE user SET level='%i',skin='%i',geschlecht='%i',money='%i',alevel='%i',slevel='%i',fraktion='%i',rang='%i',leader='%i',coleader='%i',spawnchange='%i' WHERE id='%i'",
GetPlayerScore(playerid),GetPlayerSkin(playerid),GetPlayerMoney(playerid),sInfo[playerid][geschlecht],sInfo[playerid][alevel],sInfo[playerid][slevel],sInfo[playerid][fraktion],sInfo[playerid][rang],sInfo[playerid][leader],sInfo[playerid][coleader],sInfo,sInfo[playerid][spawnchange],sInfo[playerid][db_id]);
mysql_function_query(dbhandle,query,false,"","");
}
return 1;
}
resetPlayer(playerid)
{
sInfo[playerid][level]=0;
sInfo[playerid][eingeloggt]=0;
sInfo[playerid][db_id]=0;
sInfo[playerid][geschlecht]=0;
sInfo[playerid][alevel]=0;
sInfo[playerid][slevel]=0;
sInfo[playerid][Skin]=0;
sInfo[playerid][fraktion]=0;
sInfo[playerid][rang]=0;
sInfo[playerid][leader]=0;
sInfo[playerid][coleader]=0;
sInfo[playerid][spawnchange]=0;
return 1;
}
new name[MAX_PLAYER_NAME],query[128];
GetPlayerName(playerid,name,sizeof(name));
format(query,sizeof(query),"SELECT id FROM user WHERE username='%s'",name);
mysql_function_query(dbhandle,query,true,"OnUserCheck","i",playerid);
if(dialogid==DIALOG_REGISTER)
{
if(response)
{
new name[MAX_PLAYER_NAME],query[128],passwort[35];
GetPlayerName(playerid,name,sizeof(name));
if(strlen(inputtext)>3)
{
//Registrierungsfunktion
mysql_escape_string(inputtext,passwort,dbhandle);
format(query,sizeof(query),"INSERT INTO user (username,password) VALUES ('%s','%s') ",name,passwort);
mysql_function_query(dbhandle,query,false,"OnPlayerRegister","d",playerid);
TogglePlayerControllable(playerid,0);
sInfo[playerid][regstep] = 1;
ShowPlayerDialog(playerid,DIALOG_REGISTER2,DIALOG_STYLE_LIST,"Wähle dein Geschlecht","Männlich\nWeiblich","Auswählen","");
return 1;
}
else
{
//Kleiner als 4 Zeichen
SendClientMessage(playerid,ROT,"Dein Passwort muss mindestens 4 Zeichen lang sein.");
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registrierung","Gib bitte dein gewünschtes Passwort an:","Okay","Abbrechen");
}
}
else
{
Kick(playerid);
}
return 1;
}
if(dialogid==DIALOG_REGISTER2)
{
if(dialogid==DIALOG_REGISTER2)
{
sInfo[playerid][geschlecht] = listitem+1; // 1 = männlich 2 = weiblich
sInfo[playerid][regstep] = 0;
sInfo[playerid][tutpart] = 1;
SetTimerEx("TutTimer",2000,false,"i",playerid);
return savePlayer(playerid);
}
}
public TutTimer(playerid)
{
if(sInfo[playerid][tutpart] == 1)
{
SetPlayerPos(playerid,1494.8136,-1666.0505,14.0469);
SetPlayerFacingAngle(playerid,272.6125);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid,25);
InterpolateCameraPos(playerid, 1115.584228, -1728.955566, 35.356784, 1190.537475, -1698.813476, 38.931377, 10000,CAMERA_MOVE);
InterpolateCameraLookAt(playerid, 1120.251953, -1730.533691, 34.507175, 1191.590576, -1703.500488, 37.544792, 10000,CAMERA_MOVE);
sInfo[playerid][tutpart] = 2;
SetTimerEx("TutTimer",15000,false,"i",playerid);
return 1;
}
if(sInfo[playerid][tutpart] == 2)
{
SetPlayerPos(playerid,1176.4874,-1649.7354,14.0049);
SetPlayerFacingAngle(playerid,196.8897);
SetCameraBehindPlayer(playerid);
InterpolateCameraPos(playerid, -1991.850219, -67.903274, 55.942722, -2080.126220, -53.976066, 55.603290, 10000,CAMERA_MOVE);
InterpolateCameraLookAt(playerid, -1994.148071, -72.153877, 54.657318, -2077.844238, -58.186519, 54.166343, 10000,CAMERA_MOVE);
sInfo[playerid][tutpart] = 3;
SetTimerEx("TutTimer",15000,false,"i",playerid);
return 1;
}
if(sInfo[playerid][tutpart] == 3)
{
SetPlayerPos(playerid,1494.8136,-1666.0505,14.0469);
SetPlayerFacingAngle(playerid,272.6125);
SetCameraBehindPlayer(playerid);
InterpolateCameraPos(playerid, 1419.323608, -1036.734741, 34.718708, 1490.344116, -1047.630981, 35.451251, 10000,CAMERA_MOVE);
InterpolateCameraLookAt(playerid, 1423.311035, -1034.124511, 33.206516, 1487.870605, -1043.521362, 34.039466, 10000,CAMERA_MOVE);
sInfo[playerid][tutpart] = 4;
SetTimerEx("TutTimer",15000,false,"i",playerid);
return 1;
}
if(sInfo[playerid][tutpart] == 4)
{
SetPlayerVirtualWorld(playerid,0);
SetSpawnInfo(playerid,0,26,370.3382,-2059.1753,8.6107,359.5793,0,0,0,0,0,0);
SpawnPlayer(playerid);
TogglePlayerControllable(playerid,1);
TogglePlayerSpectating(playerid, 0);
savePlayer(playerid);
return 1;
}
return 1;
}
public OnPlayerRegister(playerid)
{
sInfo[playerid][db_id] = mysql_insert_id();
SendClientMessage(playerid, ROT, "=====> Willkommen auf PlayPoint Reallife <=====!");
SendClientMessage(playerid, GELB, "=====>Es folgt nun das Tutorial<=====");
SetPlayerMoney(playerid, 2500);
SetPlayerScore(playerid, 1);
SetTimerEx("SkinTimer", 200, 0, "dd", playerid, 26);
SetPlayerColor(playerid, 0xFF00FFFF);
savePlayer(playerid);
printf("%s hat sich Registriert!)",getPlayerName(playerid));
}
[18:28:45] [DEBUG] mysql_connect - host: "127.0.0.1", user: "xSnake", database: "samp", password: "****", port: 3306, autoreconnect: true
[18:28:45] [DEBUG] CMySQLHandle::Create - creating new connection..
[18:28:45] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called
[18:28:45] [DEBUG] CMySQLHandle::Create - connection created with ID = 1
[18:28:45] [DEBUG] CMySQLConnection::Connect - connection was successful
[18:28:45] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[18:28:45] [DEBUG] CMySQLConnection::Connect - connection was successful
[18:28:45] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[18:29:13] [DEBUG] mysql_tquery - connection: 1, query: "SELECT id FROM user WHERE username='GTest'", callback: "OnUserCheck", format: "i"
[18:29:13] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[18:29:13] [DEBUG] mysql_tquery - scheduling query "SELECT id FROM user WHERE username='GTest'"..
[18:29:13] [DEBUG] CMySQLQuery::Execute[OnUserCheck(i)] - starting query execution
[18:29:13] [DEBUG] CMySQLQuery::Execute[OnUserCheck(i)] - query was successful
[18:29:13] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[18:29:13] [DEBUG] CMySQLQuery::Execute[OnUserCheck(i)] - data being passed to ProcessCallbacks()
[18:29:13] [DEBUG] Calling callback "OnUserCheck"..
[18:29:13] [DEBUG] cache_get_data - connection: 1
[18:29:13] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[18:29:13] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
[18:29:21] [DEBUG] mysql_escape_string - source: "sdfh", connection: 1, max_len: 35
[18:29:21] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO user (username,password) VALUES ('GTest','sdfh') ", callback: "OnPlayerRegister", format: "d"
[18:29:21] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[18:29:21] [DEBUG] mysql_tquery - scheduling query "INSERT INTO user (username,password) VALUES ('GTest','sdfh') "..
[18:29:21] [DEBUG] CMySQLQuery::Execute[OnPlayerRegister(d)] - starting query execution
[18:29:21] [DEBUG] CMySQLQuery::Execute[OnPlayerRegister(d)] - query was successful
[18:29:21] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[18:29:21] [DEBUG] CMySQLQuery::Execute[OnPlayerRegister(d)] - data being passed to ProcessCallbacks()
[18:29:21] [DEBUG] Calling callback "OnPlayerRegister"..
[18:29:21] [DEBUG] cache_insert_id - connection: 1
[18:29:21] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[18:29:21] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called