Dauerhaft CJ Skin
- Vincenzo.
- Geschlossen
- Erledigt
-
-
Hast du ein eigenes Script oder ein bereits erstelltes ?
-
-
Ich Scripte über Dini
-
Ist erstmal irrelevant, speicherst und liest du den skin aus? Wenn ja zeilen poaten.
-
stock Login(playerid,password[]){
if(IsPlayerNPC(playerid)) return 1;
new Player[64];
format(Player,sizeof(Player),"/Accounts/%s.cfg",PlayerName(playerid));
if(!fexist(Player)) return 1;
DM[playerid][8] = 1;
if(!strcmp(dini_Get(Player,"passwort"),password,true)){
LoggedIn[playerid] = 1;
SpawnPlayer(playerid);
ClearChat(playerid);
format(PlayerInfo[playerid][pPass],128,dini_Get(Player,"Passwort"));
PlayerInfo[playerid][pLevel] = dini_Int(Player,"Level");
PlayerInfo[playerid][pAdminLevel] = dini_Int(Player,"Adminlevel");
PlayerInfo[playerid][pCash] = dini_Int(Player,"Cash");
PlayerInfo[playerid][pKills] = dini_Int(Player,"Kills");
PlayerInfo[playerid][pDeaths] = dini_Int(Player,"Deaths");
PlayerInfo[playerid][pKD] = dini_Int(Player,"KD");
PlayerInfo[playerid][pSkin] = dini_Int(Player,"Skin");
PlayerInfo[playerid][pPremium] = dini_Int(Player,"Premium");
PlayerInfo[playerid][pSpielSekunden] = dini_Int(Player,"Spielsekunden");stock SavePlayer(playerid){
if(LoggedIn[playerid] == 1){
new Player[64];
if(IsPlayerNPC(playerid)) return 1;
format(Player,sizeof(Player),"Accounts/%s.cfg",PlayerName(playerid));
dini_Set(Player,"Passwort",PlayerInfo[playerid][pPass]);
dini_IntSet(Player,"Level",PlayerInfo[playerid][pLevel]);
dini_IntSet(Player,"Adminlevel",PlayerInfo[playerid][pAdminLevel]);
dini_IntSet(Player,"Cash",PlayerInfo[playerid][pCash]);
dini_IntSet(Player,"Kills",PlayerInfo[playerid][pKills]);
dini_IntSet(Player,"Deaths",PlayerInfo[playerid][pDeaths]);
dini_IntSet(Player,"KD",PlayerInfo[playerid][pKD]);
dini_IntSet(Player,"Skin",PlayerInfo[playerid][pSkin]);
dini_IntSet(Player,"Premium",PlayerInfo[playerid][pPremium]);
dini_IntSet(Player,"Spielsekunden",PlayerInfo[playerid][pSpielSekunden]);
}
return 1;
}stock Register(playerid,password[]){
new Player[64];
if(IsPlayerNPC(playerid)) return 1;
format(Player,sizeof(Player),"Accounts/%s.cfg",PlayerName(playerid));
dini_Create(Player);
dini_Set(Player,"Passwort",password);
dini_IntSet(Player,"Adminlevel",0);
dini_IntSet(Player,"Level",1);
dini_IntSet(Player,"Cash",0);
dini_IntSet(Player,"Kills",0);
dini_IntSet(Player,"Deaths",0);
dini_IntSet(Player,"KD",0);
dini_IntSet(Player,"Skin",101);
dini_IntSet(Player,"Premium",0);
dini_IntSet(Player,"Spielsekunden",0);
return 1;
} -
Setze das SpawnPlayer unter die ganzen dini_Ints und füge bei OnPlayerSpawn das hier ein:
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]); -
Setze das SpawnPlayer unter die ganzen dini_Ints und füge bei OnPlayerSpawn das hier ein:
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);Habe ich bereits getan.
-
Poste bitte nochmal deine aktuelle Login Funktion, und den Befehl mit dem du den Skin änderst.
-
stock Login(playerid,password[]){
if(IsPlayerNPC(playerid)) return 1;
new Player[64];
format(Player,sizeof(Player),"/Accounts/%s.cfg",PlayerName(playerid));
if(!fexist(Player)) return 1;
DM[playerid][8] = 1;
if(!strcmp(dini_Get(Player,"passwort"),password,true)){
LoggedIn[playerid] = 1;
ClearChat(playerid);
format(PlayerInfo[playerid][pPass],128,dini_Get(Player,"Passwort"));
PlayerInfo[playerid][pLevel] = dini_Int(Player,"Level");
PlayerInfo[playerid][pAdminLevel] = dini_Int(Player,"Adminlevel");
PlayerInfo[playerid][pCash] = dini_Int(Player,"Cash");
PlayerInfo[playerid][pKills] = dini_Int(Player,"Kills");
PlayerInfo[playerid][pDeaths] = dini_Int(Player,"Deaths");
PlayerInfo[playerid][pKD] = dini_Int(Player,"KD");
PlayerInfo[playerid][pSkin] = dini_Int(Player,"Skin");
PlayerInfo[playerid][pPremium] = dini_Int(Player,"Premium");
PlayerInfo[playerid][pSpielSekunden] = dini_Int(Player,"Spielsekunden");
SendClientMessage(playerid,COLOR_WHITE,"SERVER: Du hast dich erfolgreich eingeloggt!");
SendClientMessage(playerid,COLOR_WHITE,"SERVER: Deinen Skin kannst du mit /skinauswahl ändern!");
DM[playerid][8] = 1;
}else{
ResetPlayer(playerid);
SendClientMessage(playerid,COLOR_RED,"Du hast ein falsches Passwort eingegeben");
new text[256];
format(text,sizeof(text),"{FFFFFF}Herzlich Willkommen zurück auf LS-RP - Deathmatch, {00B700}%s {FFFFFF}!\nBitte gib unten in das Eingabefeld dein Accountpasswort ein,\num dich einzuloggen. Anschließend werden deine Accountdaten geladen.",PlayerName(playerid));
ShowPlayerDialog(playerid,dialog_login,DIALOG_STYLE_PASSWORD,"LS-RP - Deathmatch: Authenfifizierung",text,"Login","Schließen");
}
SpawnPlayer(playerid);
return 1;
}if(!strcmp("/skinauswahl",cmdtext,true)){
SkinSelection[playerid] = 1;
PlayerInfo[playerid][pSkin] = 0;
ForceClassSelection(playerid);
SetPlayerHealth(playerid,0);
return 1; -
-
Poste bitte dein OnPlayerRequestSpawn - Callback.
-
public OnPlayerRequestClass(playerid, classid){
if(PlayerInfo[playerid][pSkin] == 0){
SetPlayerVirtualWorld(playerid,playerid+1);
SetPlayerPos(playerid, 218.3037,-98.4747,1005.2578);
SetPlayerFacingAngle(playerid,118.6603);
SetPlayerInterior(playerid,15);
SetPlayerCameraPos(playerid, 216.3459,-100.0261,1005.5578);
SetPlayerCameraLookAt(playerid, 218.3037,-98.4747,1005.2578);
return 1;
}else{
SetTimerEx("PlayerSpawn",1,false,"i",playerid);
}
return 1;
} -
Füge dort, jeweils vor
return 1;
das hier ein:
PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid); -
Füge dort, jeweils vor
return 1;
das hier ein:
PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);Nun ist es aber so, das nach jedem Login die Skinauswahl kommt.
-
Oh ich sehe grade, du hast das falsche Callback gepostet.
Poste bitte das OnPlayerRequestSpawn Callback, und mache die Änderungen des letzten Posts Rückgangig. -
Habs nun danke. Habe aber einen neuen Fehler entdeckt.
Das Passwort wird in der .cfg nicht gespeichert, und man kann sich mit irgend einem Passwort einloggen. -
if(!strcmp(dini_Get(Player,"passwort"),password,true)){
zu:
if(!strcmp(dini_Get(Player,"Passwort"),password,true)){Und beim Register das hier einfügen:
format(PlayerInfo[playerid][pPass],128,password); -
breadfish.de
Hat das Thema geschlossen.