Heyho meine brotfische ich habe eine dringende Frage hat ein Freund ein Neues Loginsystem gescriptet und nun möchte ich wissen was ich aus meinem alten Script entfernen muss und was drin bleiben soll . Danke
Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!
Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
-
-
Den Code vom alten Loginsystem :D, ohne Code können wir dir auch nichts sagen
-
Was genau muss ich da rauskopieren ?
Ich weiss BoonFrage aber ich bin nunmal noch am lernen .
-
wie sollen wir dir ohne code antworten? wir wissen ja nicht mal ob dein login ueber mysql oder sonst was lauft aber schau mal unter "public OnPlayerConnect" nach und "public OnPlayerDisconnect" und "public OnPlayerRequestSpawn(Class)"
-
Ich würde einfach das alte drinne lassen und das von deinem Kolegen mehr oder weniger integrieren damit du das Alte nicht rausnehmen musst!
Dadurch kannst du dein ganzes Script in die Pfanne kloppen!
Also falls du vorher /login und /register hattest,mach daraus Dialoge...z.b
#define Login 0
#define Register 1Da wo abgefragt wird ob der Spieler einen Account hat:
Wenn der Spieler registriert ist:
ShowPlayerDialog(playerid,Login,DIALOG_STYLE_INPUT,"Login","Blablabla","Einloggen","Abbrechen");Wenn nicht
ShowPlayerDialog(playerid,Register,DIALOG_STYLE_INPUT,"Register","Blablabla","Regiser","Abbrechen");Und dann einfach die PW-Abfrage von deinem Kolegen einbauen und mit den Dialoge in Verbindung setzen!
Funktioniert nur wenn dein Kolege Dialoge verwendet! -
Hab jetzt mal die 3 Sachen rauskopiert hoffe das hilft .
Sind die sachen vom neuen script vom allten weiter unten .
MySQL : Nein .
public OnPlayerConnect(playerid)
{
SetPlayerColor(playerid, COLOR_GREY);
if(IsPlayerNPC(playerid))
{
gPlayerAccount[playerid] = 1;
gPlayerLogged[playerid] = 1;
return 1;
}
else
{
SetPlayerCameraPos(playerid, -2668.5005, 1420.0167, 912.4063);
SetPlayerCameraLookAt(playerid, -2666.1284, 1423.0178, 912.4063);
new string[256]; format(string, sizeof(string), "|- %s betretet den Server -|",ReadName(playerid));
SendClientMessageToAll(COLOR_GREY, string);
ServerLog(string);
PlayerInfo[playerid][pKills] = 0; PlayerInfo[playerid][pDeaths] = 0;
PlayerInfo[playerid][pCash] = 0; PlayerInfo[playerid][pBank] = 0;
PlayerInfo[playerid][pTeam] = 0; PlayerInfo[playerid][pLeader] = 0;
PlayerInfo[playerid][pMember] = 0; PlayerInfo[playerid][pRank] = 0;
PlayerInfo[playerid][pAdmin] = 0; PlayerInfo[playerid][pSupporter] = 0;
PlayerInfo[playerid][pSkin] = 0; PlayerInfo[playerid][pFSkin] = 0;
PlayerInfo[playerid][pLevel] = 0; PlayerInfo[playerid][pKnastzeit] = 0;
PlayerInfo[playerid][pKnast] = 0; PlayerInfo[playerid][pJailed] = 0;
PlayerInfo[playerid][pJPoints] = 0; PlayerInfo[playerid][pWanteds] = 0;
PlayerInfo[playerid][pDrogen] = 0; PlayerInfo[playerid][pMaterials] = 0;
PlayerInfo[playerid][pNummer] = 0; PlayerInfo[playerid][pBuch] = 0;
PlayerInfo[playerid][pAutoLiz] = 0; PlayerInfo[playerid][pBikeLiz] = 0;
PlayerInfo[playerid][pFlugLiz] = 0; PlayerInfo[playerid][pWaffLiz] = 0;
PlayerInfo[playerid][pAnglLiz] = 0; PlayerInfo[playerid][pBootLiz] = 0;
PlayerInfo[playerid][pLKWLiz] = 0; PlayerInfo[playerid][pKopfgeld] = 0;
PlayerInfo[playerid][pOpfer] = 999; PlayerInfo[playerid][pAuftrag] = 0;
PlayerInfo[playerid][pMacher] = 999; PlayerInfo[playerid][pKey] = 1;
PlayerInfo[playerid][pCarID] = -1; Woof[playerid] = -1; WooX[playerid] = -1;
SetPlayerCameraPos(playerid, -2668.5005, 1420.0167, 912.4063);
SetPlayerCameraLookAt(playerid, -2666.1284, 1423.0178, 912.4063);
new mat[256]; format(mat, sizeof(mat),"/User/%s.cer",ReadName(playerid));
if(!fexist(mat))
{
gPlayerAccount[playerid] = 0;
GivePlayerMoney(playerid, (START_CASH/2));
PlayerInfo[playerid][pBank] = START_BANK;
PlayerInfo[playerid][pTeam] = 1;
PlayerInfo[playerid][pLeader] = 0;
PlayerInfo[playerid][pMember] = 0;
PlayerInfo[playerid][pRank] = 0;
PlayerInfo[playerid][pAdmin] = 0;
PlayerInfo[playerid][pSupporter] = 0;
PlayerInfo[playerid][pSkin] = 0;
PlayerInfo[playerid][pFSkin] = 0;
PlayerInfo[playerid][pLevel] = 1;
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_YELLOW2, "*::* Du hast noch keinen Account. Bitte fülle folgendes aus: *::*");
new s[128];
format(s,sizeof(s),"Wilkommen %s!\n\nTippe hier dein Passwort rein:",ReadName(playerid));
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Register Fenster",s,"Registrieren","Abbrechen");
}
else
{
gPlayerAccount[playerid] = 1;
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_YELLOW2, "*::* Du hast bereits einen Account. Bitte tippe dein Passwort rein: *::*");
new s[128];
format(s,sizeof(s),"Wilkommen %s!\n\nTippe hier dein Passwort rein:",ReadName(playerid));
ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"Login Fenster",s,"Einloggen","Abbrechen");
format(mat, sizeof(mat),"/Autos/%s.carinfo",ReadName(playerid));
if(dini_Exists(mat))
{
LoadPlayerVehicle(playerid);
}
}
SetPlayerMapIcon(playerid, 0, gPickKoords[10][0], gPickKoords[10][1], gPickKoords[10][2], 10, 0);
}
return 1;
}public OnPlayerDisconnect(playerid, reason)
{
new string[256];
format(string, sizeof(string), "|- %s verlässt den Server -|",ReadName(playerid));
SendClientMessageToAll(COLOR_GREY, string);
OnPlayerUpdate(playerid);
gPlayerLogged[playerid] = 0;
if(PlayerInfo[playerid][pCarID] > 0)
{
SavePlayerVehicle(playerid);
DestroyVehicle(PlayerInfo[playerid][pCarID]);
}
return 1;
}public OnPlayerRequestSpawn(playerid)
{
if(gPlayerLogged[playerid] == 0)
{
return 0;
}
GangZoneShowForPlayer(playerid, Rathaus, 0xFFFFFF96);
return 1;
}ALT ! :
public OnPlayerConnect(playerid)
{
PlayerInfo[playerid][pAdmin] = 0;
PlayerInfo[playerid][pGunLic] = 0;
new playrname[MAX_PLAYER_NAME];
PlayerMoney[playerid] = 0;
GetPlayerName(playerid, playrname, sizeof(playrname));
player[playerid][calling] = false;
player[playerid][caller] = 255;
GivePlayerMoney(playerid, 500);
#if Save==0
do
{
player[playerid][number] = 1000 + random(8999);
}
while(NumberUsed(playerid));
#else
new file[20];
GetPlayerName(playerid, file, 16);
format(file, sizeof(file), "%s.txt", file);
if (fexist(file))
{
new File:ftw = fopen(file, io_read);
new tmp[5];
fread(ftw, tmp);
player[playerid][number] = strval(tmp);
fclose(ftw);
}
else
{
do
{
player[playerid][number] = 1000 + random(8999);
}
while(NumberUsed(playerid));
new File:handle1 = fopen(file, io_write);
new tmp[6];
format(tmp, 5, "%d", player[playerid][number]);
fwrite(handle1, tmp);
fclose(handle1);
new File:handle2;
if (!fexist("Benutze_nummern.txt"))
{
format(tmp, 7, "%d", player[playerid][number]);
handle2 = fopen("Benutze_nummern.txt", io_write);
fwrite(handle2, tmp);
fclose(handle2);
}
else
{
format(tmp, 7, "\r\n%d", player[playerid][number]);
handle2 = fopen("Benutze_nummern.txt", io_append);
fwrite(handle2, tmp);
fclose(handle2);
}
}TextDrawShowForAll(Textdraw0);
TextDrawShowForAll(url);
new Text:homepage;
homepage = TextDrawCreate(5.0, 431.0, "~w~In Arbeit /");
TextDrawShowForAll(homepage);
new LOL[128];
new pname[MAX_PLAYER_NAME];
new stringAA[100];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringAA, sizeof(stringAA), "%s hat den Server betreten!", pname);
SendClientMessageToAll(0xAAAAAAAA, stringAA);
new spielername[MAX_PLAYER_NAME];
new connect[128];
PlayerInfo[playerid][pCarLic] = 0;
PlayerInfo[playerid][pFlyLic] = 0;
PlayerInfo[playerid][pBoatLic] = 0;
PlayerInfo[playerid][pFishLic] = 0;
GetPlayerName(playerid, spielername, sizeof(spielername));
format(connect, sizeof(connect), "%s.cer", spielername);
if(fexist(connect))
{
gPlayerAccount[playerid] = 1;
SendClientMessage(playerid, COLOR_YELLOW, "Herzliche willkommen auf den Server!");
SendClientMessage(playerid, COLOR_YELLOW, "|________FORUM________|");
SendClientMessage(playerid, COLOR_YELLOW, "In Arbeit :D");
SendClientMessage(playerid, COLOR_YELLOW, "|___________/login___________|");
ShowPlayerDialog(playerid,Login,DIALOG_STYLE_INPUT,"Login","Blablabla","Einloggen","Abbrechen");
return 1;
}
else
{
gPlayerAccount[playerid] = 0;
SendClientMessage(playerid, COLOR_YELLOW, "|___________Wilkommen___________|");
SendClientMessage(playerid, COLOR_YELLOW, "Herzlich willkommen auf den Server!");
SendClientMessage(playerid, COLOR_YELLOW, "|___________/register___________|");
ShowPlayerDialog(playerid,Register,DIALOG_STYLE_INPUT,"Register","Blablabla","Regiser","Abbrechen");
}
gTeam[playerid] =dini_Int(LOL,"gTeam");
/* BankLogged[playerid]=false;*/
IsInTR[playerid] = 0;
keyy[playerid] = 0;
return 1;
} -
breadfish.de
Hat das Thema geschlossen.