Skin Problem

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
  • Hallo,
    ich habe schon edliche Themen darüber gelesen, doch nichts hat geholfen.
    Ich habe das Problem das mit Skin beim restart nicht geladen wird, wenn man sich normal ausloggt und sich wieder einloggt funktioniert alles.
    Auch wenn ich nen Player spawne per Befehl funtioniert das alles.
    Halt nur bei nem restart net.


    Hier mal mein Acc System mit dem restart Befehl und wie ich es beim spawnen auslesen lasse (Acc Sys. mit Enum):


    Spieler speichern:

    public OnPlayerDisconnect(playerid, reason)
    {
    new pName[MAX_PLAYER_NAME],path[200];
    GetPlayerName(playerid,pName,sizeof(pName));
    format(path,sizeof(path),"/Spieler/%s.ini",pName);
    dini_IntSet(path,"Level",GetPlayerScore(playerid));
    dini_IntSet(path,"Geld",GetPlayerMoney(playerid));
    dini_IntSet(path,"Skin",GetPlayerSkin(playerid));
    dini_IntSet(path,"Geschlecht",pInfo[playerid][Geschlecht]);
    dini_IntSet(path,"Alter",pInfo[playerid][Alter]);
    dini_IntSet(path,"Fraktion",pInfo[playerid][Fraktion]);
    dini_IntSet(path,"Leader",pInfo[playerid][Leader]);
    dini_IntSet(path,"Adminlevel",pInfo[playerid][Adminlevel]);
    dini_IntSet(path,"Gebannt",pInfo[playerid][Gebannt]);
    pInfo[playerid][Skin] = GetPlayerSkin(playerid);
    pInfo[playerid][Leader] = 0;
    pInfo[playerid][loggedin] = 0;

    new string[56];
    switch(reason)
    {
    case 0: format(string, sizeof(string), "%s hat den Server verlassen (Error)", pName);
    case 1: format(string, sizeof(string), "%s hat den Server verlassen", pName);
    case 2: format(string, sizeof(string), "%s hat den Server verlassen (Kick/ban)", pName);
    }
    SendClientMessageToAll(COLOR_GREY, string);
    return 1;
    }


    Spieler laden:

    new pw[200];
    format(pw,sizeof(pw),"%s",dini_Get(path,"Passwort"));
    if(strcmp(inputtext,pw) == 0)
    {
    pInfo[playerid][Level] = SetPlayerScore(playerid, dini_Int(path,"Level"));
    pInfo[playerid][Geld] = GivePlayerMoney(playerid, dini_Int(path,"Geld"));
    pInfo[playerid][Skin] = SetPlayerSkin(playerid, dini_Int(path,"Skin"));
    pInfo[playerid][Geschlecht] = dini_Int(path,"Geschlecht");
    pInfo[playerid][Alter] = dini_Int(path,"Alter");
    pInfo[playerid][Fraktion] = dini_Int(path,"Fraktion");
    pInfo[playerid][Leader] = dini_Int(path,"Leader");
    pInfo[playerid][Adminlevel] = dini_Int(path,"Adminlevel");
    pInfo[playerid][Gebannt] = dini_Int(path,"Gebannt");
    pInfo[playerid][loggedin] = 1;


    Spieler spawn:

    public OnPlayerSpawn(playerid)
    {
    new pName[MAX_PLAYER_NAME],path[200];
    GetPlayerName(playerid,pName,sizeof(pName));
    format(path,sizeof(path),"/Spieler/%s.ini",pName);
    SetPlayerSkin(playerid,dini_Int(path,"Skin"));
    if(pInfo[playerid][Fraktion] == 0)
    {
    SetPlayerPos(playerid,ZIVI_SPAWN);
    SetPlayerFacingAngle(playerid,91.5039);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,COLOR_WHITE);
    SetPlayerHealth(playerid,100);
    }
    if(pInfo[playerid][Fraktion] == 1)
    {
    SetPlayerPos(playerid,SFPD_SPAWN);
    SetPlayerFacingAngle(playerid,273.2344);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,SFPD_BLUE);
    GivePlayerWeapon(playerid,3,1);
    GivePlayerWeapon(playerid,17,3);
    GivePlayerWeapon(playerid,24,200);
    GivePlayerWeapon(playerid,29,500);
    GivePlayerWeapon(playerid,31,500);
    SetPlayerArmour(playerid,100);
    SetPlayerHealth(playerid,100);
    }
    if(pInfo[playerid][Fraktion] == 2)
    {
    SetPlayerPos(playerid,SEK_SPAWN);
    SetPlayerFacingAngle(playerid,269.6898);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,SEK_DARKBLUE);
    GivePlayerWeapon(playerid,3,1);
    GivePlayerWeapon(playerid,17,3);
    GivePlayerWeapon(playerid,24,200);
    GivePlayerWeapon(playerid,29,500);
    GivePlayerWeapon(playerid,31,500);
    SetPlayerArmour(playerid,100);
    SetPlayerHealth(playerid,100);
    }
    if(pInfo[playerid][Fraktion] == 3)
    {
    SetPlayerColor(playerid,BUNDESWEHR_GREEN);
    SetPlayerHealth(playerid,100);
    }
    if(pInfo[playerid][Fraktion] == 4)
    {
    SetPlayerColor(playerid,SANI_RED);
    SetPlayerPos(playerid,SANI_SPAWN);
    SetPlayerFacingAngle(playerid,180.9012);
    SetCameraBehindPlayer(playerid);
    SetPlayerHealth(playerid,100);
    }
    if(pInfo[playerid][Fraktion] == 5)
    {
    SetPlayerColor(playerid,ADAC_YELLOW);
    SetPlayerPos(playerid,ADAC_SPAWN);
    SetPlayerFacingAngle(playerid,177.4293);
    SetCameraBehindPlayer(playerid);
    SetPlayerHealth(playerid,100);
    }
    if(pInfo[playerid][Fraktion] == 6)
    {
    SetPlayerColor(playerid,N24_ORANGE);
    SetPlayerPos(playerid,N24_SPAWN);
    SetPlayerFacingAngle(playerid,359.1059);
    SetCameraBehindPlayer(playerid);
    SetPlayerHealth(playerid,100);
    }
    if(pInfo[playerid][Fraktion] == 7)
    {
    SetPlayerPos(playerid,GOLF_SPAWN);
    SetPlayerFacingAngle(playerid,47.0345);
    GivePlayerWeapon(playerid,2,1);
    GivePlayerWeapon(playerid,24,200);
    GivePlayerWeapon(playerid,29,500);
    SetPlayerHealth(playerid,100);
    }
    if(pInfo[playerid][Fraktion] == 8)
    {
    SetPlayerPos(playerid,STRIP_SPAWN);
    SetPlayerFacingAngle(playerid,180.0000);
    GivePlayerWeapon(playerid,10,1);
    GivePlayerWeapon(playerid,24,200);
    GivePlayerWeapon(playerid,29,500);
    SetPlayerHealth(playerid,100);
    }
    return 1;
    }


    Ich habe bei OnPlayerRequestClass noch:

    public OnPlayerRequestClass(playerid, classid)
    {
    if(pInfo[playerid][Fraktion] == 0)
    {
    SetSpawnInfo(playerid,0,pInfo[playerid][Skin],ZIVI_SPAWN,0,0,0,0,0,0,0);
    SetPlayerFacingAngle(playerid,91.5039);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,COLOR_WHITE);
    SetPlayerHealth(playerid,100);
    SpawnPlayer(playerid);
    }
    if(pInfo[playerid][Fraktion] == 1)
    {
    SetSpawnInfo(playerid,0,pInfo[playerid][Skin],SFPD_SPAWN,0,0,0,0,0,0,0);
    SetPlayerFacingAngle(playerid,273.2344);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,SFPD_BLUE);
    GivePlayerWeapon(playerid,3,1);
    GivePlayerWeapon(playerid,17,3);
    GivePlayerWeapon(playerid,24,200);
    GivePlayerWeapon(playerid,29,500);
    GivePlayerWeapon(playerid,31,500);
    SetPlayerArmour(playerid,100);
    SetPlayerHealth(playerid,100);
    SpawnPlayer(playerid);
    }
    if(pInfo[playerid][Fraktion] == 2)
    {
    SetSpawnInfo(playerid,0,pInfo[playerid][Skin],SEK_SPAWN,0,0,0,0,0,0,0);
    SetPlayerFacingAngle(playerid,269.6898);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,SEK_DARKBLUE);
    GivePlayerWeapon(playerid,3,1);
    GivePlayerWeapon(playerid,17,3);
    GivePlayerWeapon(playerid,24,200);
    GivePlayerWeapon(playerid,29,500);
    GivePlayerWeapon(playerid,31,500);
    SetPlayerArmour(playerid,100);
    SetPlayerHealth(playerid,100);
    SpawnPlayer(playerid);
    }
    if(pInfo[playerid][Fraktion] == 3)
    {
    SetSpawnInfo(playerid,0,pInfo[playerid][Skin],-1592.7244,715.9481,-5.2422,0,0,0,0,0,0,0);
    SetPlayerHealth(playerid,100);
    SpawnPlayer(playerid);
    }
    if(pInfo[playerid][Fraktion] == 4)
    {
    SetSpawnInfo(playerid,0,pInfo[playerid][Skin],SANI_SPAWN,0,0,0,0,0,0,0);
    SetPlayerColor(playerid,SANI_RED);
    SetPlayerFacingAngle(playerid,180.9012);
    SetCameraBehindPlayer(playerid);
    SetPlayerHealth(playerid,100);
    SpawnPlayer(playerid);
    }
    if(pInfo[playerid][Fraktion] == 5)
    {
    SetSpawnInfo(playerid,0,pInfo[playerid][Skin],ADAC_SPAWN,0,0,0,0,0,0,0);
    SetPlayerColor(playerid,ADAC_YELLOW);
    SetPlayerFacingAngle(playerid,177.4293);
    SetCameraBehindPlayer(playerid);
    SetPlayerHealth(playerid,100);
    SpawnPlayer(playerid);
    }
    if(pInfo[playerid][Fraktion] == 6)
    {
    SetSpawnInfo(playerid,0,pInfo[playerid][Skin],N24_SPAWN,0,0,0,0,0,0,0);
    SetPlayerColor(playerid,N24_ORANGE);
    SetPlayerFacingAngle(playerid,359.1059);
    SetCameraBehindPlayer(playerid);
    SetPlayerHealth(playerid,100);
    SpawnPlayer(playerid);
    }
    if(pInfo[playerid][Fraktion] == 7)
    {
    SetSpawnInfo(playerid,0,pInfo[playerid][Skin],GOLF_SPAWN,0,0,0,0,0,0,0);
    SetPlayerFacingAngle(playerid,47.0345);
    GivePlayerWeapon(playerid,2,1);
    GivePlayerWeapon(playerid,24,200);
    GivePlayerWeapon(playerid,29,500);
    SetPlayerHealth(playerid,100);
    SpawnPlayer(playerid);
    }
    if(pInfo[playerid][Fraktion] == 8)
    {
    SetSpawnInfo(playerid,0,pInfo[playerid][Skin],GOLF_SPAWN,0,0,0,0,0,0,0);
    SetPlayerFacingAngle(playerid,180.0000);
    GivePlayerWeapon(playerid,10,1);
    GivePlayerWeapon(playerid,24,200);
    GivePlayerWeapon(playerid,29,500);
    SetPlayerHealth(playerid,100);
    SpawnPlayer(playerid);
    }
    return 1;
    }


    /Restart Befehl:

    if(strcmp(cmdtext,"/restart",true)==0)
    {
    if(pInfo[playerid][Adminlevel] >= 4)
    {
    SaveAllPlayerAccounts();
    GameModeExit();
    return 1;
    }
    else
    {
    SendClientMessage(playerid,COLOR_RED,"Du hast nicht die nötigen Rechte für diesen Befehl!");
    return 1;
    }
    }


    stock SaveAccount(playerid)
    {
    new pName[MAX_PLAYER_NAME],path[200];
    GetPlayerName(playerid,pName,sizeof(pName));
    format(path,sizeof(path),"/Spieler/%s.ini",pName);
    dini_IntSet(path,"Level",GetPlayerScore(playerid));
    dini_IntSet(path,"Geld",GetPlayerMoney(playerid));
    dini_IntSet(path,"Skin",GetPlayerSkin(playerid));
    dini_IntSet(path,"Geschlecht",pInfo[playerid][Geschlecht]);
    dini_IntSet(path,"Alter",pInfo[playerid][Alter]);
    dini_IntSet(path,"Fraktion",pInfo[playerid][Fraktion]);
    dini_IntSet(path,"Leader",pInfo[playerid][Leader]);
    dini_IntSet(path,"Adminlevel",pInfo[playerid][Adminlevel]);
    dini_IntSet(path,"Gebannt",pInfo[playerid][Gebannt]);
    pInfo[playerid][loggedin] = 0;
    }


    stock SaveAllPlayerAccounts()
    {
    for(new playerid = 0; playerid < GetMaxPlayers(); playerid++)
    {
    if(IsPlayerConnected(playerid) && playerid != INVALID_PLAYER_ID)
    {
    SaveAccount(playerid);
    }
    }
    return 1;
    }


    #e: Was hinzugefügt

  • Stimmt, du hast Recht. N Denkfehler von mir. ^^
    Das Problem weiß ich dann jetzt.


    Nur:

    C:\Desktop\SanFierro - Reallife\gamemodes\sf-rl.pwn(191) : warning 202: number of arguments does not match definition
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    1 Warning.
    :S

  • In deinem Stock hast du es so definiert das es keinen Parameter braucht, also das mit der for Schleife weg und mach einfach

    public OnGameModeExit()
    {
    SaveAllPlayerAccounts();
    }

    Weil du hast ja im stock bereits eine Schleife.

    Mit unfreundlichen Grüßen
    Buschmensch

  • Jop.

    stock SaveAllPlayerAccounts()
    {
    for(new playerid = 0; playerid < GetMaxPlayers(); playerid++)
    {
    if(IsPlayerConnected(playerid) && playerid != INVALID_PLAYER_ID)
    {
    SaveAccount(playerid);
    }
    }
    return 1;
    }

    Da ist sie.
    So wie du es sagst is es ja, funtzt aber nicht...

  • if(IsPlayerConnected(playerid) && playerid != INVALID_PLAYER_ID)


    was auch immer du da mit machst.
    if(IsPlayerConnected(playerid) )
    {
    }
    reicht

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen