09.03.2012, 13:41
Hey guys i tryed in the german forum but no one know it so i try my luck here :P
When i Connect to my server then i cant login or register ;( i just can choose a team :/ can anyone help me ?
When i Connect to my server then i cant login or register ;( i just can choose a team :/ can anyone help me ?
Код:
//--------News---------------// new gTeam[MAX_PLAYERS]; new HAE[3]; //HAE = HellAngles new HAG[3]; //HAG = HolyAngles //-------Defines------------// #define TEAM_HAG 912 #define TEAM_HAE 913
Код:
#define DIALOG_LOGIN 3 #define DIALOG_REG 4
Код:
//-------Enum-------------// enum spieler_daten { name, geld, level, adminlevel, wanted, skin, Float:lastx,Float:lasty,Float:lastz, eingeloggt } new Spieler[MAX_PLAYERS][spieler_daten];
Код:
public OnGameModeInit() { HAG[0] = AddPlayerClass(285,-20.8592,30.7804,3.1172,71.2724, 23, 60, 0, 0, 0, 0); HAG[1] = AddPlayerClass(286,-20.8592,30.7804,3.1172,71.2724, 23, 60, 0, 0, 0, 0); HAG[2] = AddPlayerClass(280,-20.8592,30.7804,3.1172,71.2724, 23, 60, 0, 0, 0, 0); HAE[0] = AddPlayerClass(29,-85.6388,47.8388,3.1172,250.7907, 23, 60, 0, 0, 0, 0); HAE[1] = AddPlayerClass(57,-85.6388,47.8388,3.1172,250.7907, 23, 60, 0, 0, 0, 0); HAE[2] = AddPlayerClass(73,-85.6388,47.8388,3.1172,250.7907, 23, 60, 0, 0, 0, 0); SetGameModeText("DeathAngle"); AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); return 1; }
Код:
public OnPlayerRequestClass(playerid, classid) { if(classid >= HAG[0] && classid <= HAG[2]) { GameTextForPlayer(playerid, "HolyAngles", 3000, 4); gTeam[playerid] = TEAM_HAG; SetPlayerPos(playerid,-20.8592,30.7804,3.1172); SetPlayerFacingAngle(playerid,71.2724); SetPlayerCameraPos(playerid,-24.0514,31.6381,3.1172); SetPlayerCameraLookAt(playerid,-20.8592,30.7804,3.1172); SetPlayerColor(playerid,BLAU); } if(classid >= HAE[0] && classid <= HAE[2]) { GameTextForPlayer(playerid, "HellAngles", 3000, 4); gTeam[playerid] = TEAM_HAE; SetPlayerPos(playerid,-85.6388,47.8388,3.1172); SetPlayerFacingAngle(playerid,250.7907); SetPlayerCameraPos(playerid,-82.5270,46.4544,3.1172); SetPlayerCameraLookAt(playerid,-85.6388,47.8388,3.1172); SetPlayerColor(playerid,ROT); } return 1; }
Код:
public OnPlayerConnect(playerid) { new pname[MAX_PLAYERS],accFormat[128]; GetPlayerName(playerid,pname,sizeof pname); format(accFormat,sizeof(accFormat),"/SpielerAccounts/%s.datei",pname); if(fexist(accFormat)) { ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Dein Account wurde gefunden\nBitte Logge dich ein mit deinem\nPasswort:","Abbrechen","Weiter"); } else { ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Gib dein gewьnschtes Passwort ein.\nUm einen Account zu Erstellen\nPasswort:","Abbrechen","Weiter"); } return 1; }
Код:
public OnPlayerDisconnect(playerid, reason) { new pname[MAX_PLAYERS],accFormat[128]; GetPlayerName(playerid,pname,sizeof pname); format(accFormat,sizeof(accFormat),"/SpielerAccounts/%s.datei",pname); if(fexist(accFormat) && Spieler[playerid][eingeloggt]) { dini_IntSet(accFormat,"name",Spieler[playerid][name]); dini_IntSet(accFormat,"adminlevel",Spieler[playerid][adminlevel]); dini_IntSet(accFormat,"level",Spieler[playerid][level]); dini_IntSet(accFormat,"geld",Spieler[playerid][geld]); dini_IntSet(accFormat,"wanted",Spieler[playerid][wanted]); dini_IntSet(accFormat,"skin",Spieler[playerid][skin]); dini_FloatSet(accFormat,"lastx",Spieler[playerid][lastx]); dini_FloatSet(accFormat,"lasty",Spieler[playerid][lasty]); dini_FloatSet(accFormat,"lastz",Spieler[playerid][lastz]); } Spieler[playerid][eingeloggt] = 0; Spieler[playerid][wanted] = 0; Spieler[playerid][skin] = 0; Spieler[playerid][lastx] = (0.0); Spieler[playerid][lasty] = (0.0); Spieler[playerid][lastz] = (0.0); return 1; }
Код:
public OnPlayerSpawn(playerid) { new pname[MAX_PLAYERS],accFormat[128]; GetPlayerName(playerid,pname,sizeof pname); format(accFormat,sizeof(accFormat),"/SpielerAccounts/%s.datei",pname); if(dini_Isset(accFormat,"lastx")) { SetPlayerPos(playerid,Spieler[playerid][lastx],Spieler[playerid][lasty],Spieler[playerid][lastz]); } return 1; }
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { new pname[MAX_PLAYERS],accFormat[128]; GetPlayerName(playerid,pname,sizeof pname); format(accFormat,sizeof(accFormat),"/SpielerAccounts/%s.datei",pname); if(response) { switch(dialogid) { case DIALOG_LOGIN: { if(!strlen(inputtext)) { ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Dein Account wurde gefunden\nBitte Logge dich ein mit deinem\nPasswort:","Abbrechen","Weiter"); return SendClientMessage(playerid,0xFFFFFFFF,"Du musst dein Passwort eingeben sonst kannst du hier nicht Spielen!"); } if(strcmp(inputtext,dini_Get(accFormat,"Passwort")) == 0) { Spieler[playerid][wanted] = dini_Int(accFormat,"name"); Spieler[playerid][wanted] = dini_Int(accFormat,"level"); Spieler[playerid][wanted] = dini_Int(accFormat,"adminlevel"); Spieler[playerid][wanted] = dini_Int(accFormat,"geld"); Spieler[playerid][wanted] = dini_Int(accFormat,"wanted"); Spieler[playerid][skin] = dini_Int(accFormat,"skin"); Spieler[playerid][lastx] = dini_Float(accFormat,"lastx"); Spieler[playerid][lasty] = dini_Float(accFormat,"lasty"); Spieler[playerid][lastz] = dini_Float(accFormat,"lastz"); Spieler[playerid][eingeloggt] = 1; SendClientMessage(playerid,0xFFFFFFFF,"Du hast dich Erfolgreich Eingellogt und kannst nun weiter Spielen viel Spass :)."); } else { ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Dein Account wurde gefunden\nBitte Logge dich ein mit deinem\nPasswort:","Abbrechen","Weiter"); SendClientMessage(playerid,0xFFFFFFFF,"Das Passwort war falsch bitte geb es erneut ein!"); } } case DIALOG_REG: { if(!strlen(inputtext)) { ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Gib dein gewьnschtes Passwort ein.\nUm einen Account zu Erstellen\nPasswort:","Abbrechen","Weiter"); return SendClientMessage(playerid,0xFFFFFFFF,"Dein geдhltes Passwort ist zu KURZ!"); } dini_Create(accFormat); dini_Set(accFormat,"Passwort",inputtext); Spieler[playerid][eingeloggt] = 1; SendClientMessage(playerid,0xFFFFFFFF,"Dein Account wurde Erfolgreich angelegt und nun kannst du auf DeathAngleDM Spielen\nViel SpaЯ."); } } } else { switch(dialogid) { case DIALOG_LOGIN:ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Dein Account wurde gefunden\nBitte Logge dich ein mit deinem\nPasswort:","Abbrechen","Weiter"); case DIALOG_REG:ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Gib dein gewьnschtes Passwort ein.\nUm einen Account zu Erstellen\nPasswort:","Abbrechen","Weiter"); } } return 1; }