Hey Leute,
ich habe ein dummes Problem^^.
Ich habe eine Selfmade Reallife Mode bekommen und wenn ich ich connecte bleibt das Bild
am Startbildschirm stehen und nichts weiter passiert.
Ich habe mir dabei Gedacht das es am Befehl /Register oder /login liegen könnte.
Ich poste die Befehle einfach mal hier ins Board und ich hoffe ihr könnt mir helfen:
if(strcmp(cmd, "/register", true) == 0)
{
new playername[32];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(file, sizeof(file), "/Accounts/%s.ini", sendername);
tmp = strtok(cmdtext, idx);
GetPlayerName(playerid, playername, sizeof(playername));
if(20 < strlen(tmp) || strlen(tmp) < 4)
{
SendClientMessage(playerid, COLOR_DBLUE, "Fehler! Das Passwort muss länger als 4 Buchstaben sein!");
return 1;
}
if(!strlen(tmp))
SendClientMessage(playerid, COLOR_DBLUE, "[BENUTZUNG]: /register [Passwort]");
else
{
if (!dini_Exists(file))
{
GetPlayerIp(playerid, playerip, sizeof(playerip));
TotalRegs = dini_Int("/Stats/Registern.cfg", "TotalREG");
TotalRegs += 1;
dini_IntSet("/Stats/Registern.cfg", "TotalREG", TotalRegs);
dini_Create(file);
dini_IntSet(file, "password", udb_hash(tmp));
dini_Set(file,"pass", tmp);
dini_IntSet(file, "level", 0);
dini_Set(file, "IP", playerip);
dini_IntSet(file, "Level", 0);
dini_IntSet(file, "Money", 30000);
dini_IntSet(file, "uid", TotalRegs);
dini_IntSet(file, "Jail", 0);
dini_IntSet(file, "Driverlicense", 0);
dini_IntSet(file, "Driverlicenselkw", 0);
dini_IntSet(file, "Driverlicenseboot", 0);
dini_IntSet(file, "Driverlicenseflug", 0);
dini_IntSet(file, "Driverlicenserad", 0);
dini_IntSet(file, "Nitroschein", 0);
dini_IntSet(file, "Waffenschein", 0);
dini_IntSet(file, "PunktInFlensburg", 0);
dini_IntSet(file, "Police", 0);
dini_IntSet(file, "Army", 0);
dini_IntSet(file, "Militaer", 0);
dini_IntSet(file, "Adac", 0);
dini_IntSet(file, "Fahrlehrer", 0);
dini_IntSet(file, "Fluglehrer", 0);
dini_IntSet(file, "Bootslehrer", 0);
dini_IntSet(file, "Sanitary", 0);
dini_IntSet(file, "SPSSF", 0);
dini_IntSet(file, "SPSLS", 0);
dini_IntSet(file, "SPSLV", 0);
dini_IntSet(file, "Medic", 0);
dini_IntSet(file, "Taxi", 0);
dini_IntSet(file, "LKW", 0);
dini_IntSet(file, "OilCompany", 0);
dini_IntSet(file, "Mafia", 0);
dini_IntSet(file, "Barkeeper", 0);
dini_IntSet(file, "Autohaus", 0);
dini_IntSet(file, "Skinid", 1);
dini_IntSet(file, "Bank", 0);
dini_IntSet(file, "BankMoney", 0);
dini_IntSet(file, "Leben", 100);
dini_IntSet(file, "Armor", 0);
dini_FloatSet(file, "Promille", 0);
dini_IntSet(file, "Handy", 0);
dini_FloatSet(file, "xcoords", -1426.3771);
dini_FloatSet(file, "ycoords", -287.6837);
dini_FloatSet(file, "zcoords", 14.1484);
format(string, sizeof(string), "%s(%i) hat sich registriert mit folgendem Passwort \"%s\"", playername, playerid, tmp);
printf(string);
format(string, sizeof(string), "Du bist nun registriert! Tippe /login [Passwort]");
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
GameTextForPlayer(playerid,"Willkommen!",4000,3);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, COLOR_RED, "Nun kommt ein kleines Tutorial");
SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
}
else
{
SendClientMessage(playerid, COLOR_RED, "Du bist schon registriert!");
}
}
return 1;
}
if(strcmp(cmd, "/login", true) == 0)
{
if(alogin[playerid] == 0)
{
new playername[32];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(file, sizeof(file), "/Accounts/%s.ini", sendername);
if(logged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "Du bist schon eingeloggt!");
return 1;
}
tmp = strtok(cmdtext, idx);
GetPlayerName(playerid, playername, sizeof(playername));
if(!strlen(tmp))
SendClientMessage(playerid, COLOR_WHITE, "[BENUTZUNG]: /login [Passwort]");
else
{
if(dini_Exists(file))
{
tmp2 = dini_Get(file, "password");
if(udb_hash(tmp) != strval(tmp2))
{
SendClientMessage(playerid,COLOR_RED, "Du hast ein falsches Passwort benutzt");
}
else
{
GetPlayerIp(playerid, playerip, sizeof(playerip));
dini_Set(file,"pass",tmp);
PlayerInfo[playerid][Level] = dini_Int(file, "level");
PlayerInfo[playerid][Money] = dini_Int(file, "Money");
PlayerInfo[playerid][xcoords] = dini_Int(file, "xcoords");
PlayerInfo[playerid][ycoords] = dini_Int(file, "ycoords");
PlayerInfo[playerid][zcoords] = dini_Int(file, "zcoords");
PlayerInfo[playerid][acoords] = dini_Int(file, "acoords");
PlayerInfo[playerid][Ip] = dini_Int(file, "IP");
dini_Set(file, "IP_NEW",playerip);
PlayerInfo[playerid][uid] = dini_Int(file, "uid");
PlayerInfo[playerid][Jail] = dini_Int(file, "Jail");
PlayerInfo[playerid][Driverlicense] = dini_Int(file, "Driverlicense");
PlayerInfo[playerid][Driverlicenselkw] = dini_Int(file, "Driverlicenselkw");
PlayerInfo[playerid][Driverlicenseboot] = dini_Int(file, "Driverlicenseboot");
PlayerInfo[playerid][Driverlicenseflug] = dini_Int(file, "Driverlicenseflug");
PlayerInfo[playerid][Driverlicenserad] = dini_Int(file, "Driverlicenserad");
PlayerInfo[playerid][Nitroschein] = dini_Int(file, "Nitroschein");
PlayerInfo[playerid][Waffenschein] = dini_Int(file, "Waffenschein");
PlayerInfo[playerid][PunktInFlensburg] = dini_Int(file, "PunktInFlensburg");
PlayerInfo[playerid][Police] = dini_Int(file, "Police");
PlayerInfo[playerid][Army] = dini_Int(file, "Army");
PlayerInfo[playerid][Militaer] = dini_Int(file, "Militaer");
PlayerInfo[playerid][Adac] = dini_Int(file, "Adac");
PlayerInfo[playerid][Fahrlehrer] = dini_Int(file, "Fahrlehrer");
PlayerInfo[playerid][Fluglehrer] = dini_Int(file, "Fluglehrer");
PlayerInfo[playerid][Bootslehrer] = dini_Int(file, "Bootslehrer");
PlayerInfo[playerid][Sanitary] = dini_Int(file, "Sanitary");
PlayerInfo[playerid][SPSSF] = dini_Int(file, "SPSSF");
PlayerInfo[playerid][SPSLV] = dini_Int(file, "SPSLV");
PlayerInfo[playerid][SPSLS] = dini_Int(file, "SPSLS");
PlayerInfo[playerid][Medic] = dini_Int(file, "Medic");
PlayerInfo[playerid][Taxi] = dini_Int(file, "Taxi");
PlayerInfo[playerid][LKW] = dini_Int(file, "LKW");
PlayerInfo[playerid][OilCompany] = dini_Int(file, "OilCompany");
PlayerInfo[playerid][Mafia] = dini_Int(file, "Mafia");
PlayerInfo[playerid][Barkeeper] = dini_Int(file, "Barkeeper");
PlayerInfo[playerid][Autohaus] = dini_Int(file, "Autohaus");
PlayerInfo[playerid][Skinid] = dini_Int(file, "Skinid");
PlayerInfo[playerid][Bank] = dini_Int(file, "Bank");
PlayerInfo[playerid][BankMoney] = dini_Int(file, "BankMoney");
PlayerInfo[playerid][Leben] = dini_Int(file, "Leben");
PlayerInfo[playerid][Armor] = dini_Int(file, "Armor");
PlayerInfo[playerid][Promille] = dini_Int(file, "Promille");
PlayerInfo[playerid][pHandy] = dini_Int(file, "Handy");
format(string, sizeof(string), "%s betritt den Server!", playername);
Team[playerid]=TEAM_BUERGER;
logged[playerid] = 1;
SpawnPlayer(playerid);
SendClientMessageToAll(COLOR_GREEN, string);
SetPlayerSkin(playerid,PlayerInfo[playerid][Skinid]);
GivePlayerMoney(playerid,PlayerInfo[playerid][Money]);
SetPlayerColor(playerid, 0xAFAFAF00);
GameTextForPlayer(playerid, "~b~Willkommen!",2000,1);
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_RED,"Du bist nicht registriert!");
}
}
}
else
{
SendClientMessage(playerid,COLOR_RED,"Du wirst automatisch eingeloggt!");
}
return 1;
}
MfG Markus