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 liebe Brotfische,
    ich habe immernoch n großes Problem beim Skin speichern oder laden. Ich weiß nicht wo der Fehler ist.
    Wenn ich mir per /setskin einen Skin geben, mich aus und wieder einlogge ist alles ganz normal, auch der Skin ist da.
    Wenn ich im Control Panel den Server neu starte, keine Probleme.
    Wenn ich aber ID 0 bin und mich mit /spawn spawne, bekomme ich den CJ Skin obwohl er nicht im Script steht. Man bekommst eig die SkinID 78. Wenn ich aber ID 1 bin ist alles ok.
    Wenn ich den Server per /restart Befehl neu starte, bekommen alle den CJ Skin...


    Hier mal mein ACC System + /setskin Befehl usw:
    Spieler speichern

    Spoiler anzeigen


    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;


    Spieler Laden
    Spoiler anzeigen


    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][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;
    if(pInfo[playerid][Gebannt] == 1)
    {
    SendClientMessage(playerid,ADMCMD,"Lieber User, leider wurdest du von unserem Server gebannt!");
    SendClientMessage(playerid,ADMCMD,"Du kannst also ertsmal nich auf dem Sever spielen.");
    SendClientMessage(playerid,ADMCMD,"Doch wenn du unbedingt wieder bei uns spielen willst");
    SendClientMessage(playerid,ADMCMD,"gehe ins Forum (test5.am-server.de) und schreibe einen Entbann-Antrag.");
    Kick(playerid);
    }
    }


    /setskin
    Spoiler anzeigen


    ocmd:setskin(playerid,params[])
    {
    if(IsPlayerAnAdmin(playerid,3))
    {
    new pID,pSkin;
    if(sscanf(params,"ui",pID,pSkin))return SendClientMessage(playerid,COLOR_YELLOW,"Benutze: /Setskin <Spielername/ID> <SkinID>");
    {
    if(pSkin<0||pSkin>299)return SendClientMessage(playerid,COLOR_RED,"Ungültige SkinID!");
    {
    if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_RED,"Dieser Spieler ist nicht online!");
    SetPlayerSkin(pID,pSkin);
    return 1;
    }
    }
    }
    else
    {
    SendClientMessage(playerid,COLOR_RED,"Du hast nicht die nötigen Rechte für diesen Befehl!");
    return 1;
    }
    }


    /restart
    Spoiler anzeigen


    public OnGameModeExit()
    {
    for(new i=0; i<MAX_PLAYERS; i++)
    {
    SaveAllPlayerAccounts();
    }
    return 1;
    }

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

    Spoiler anzeigen
    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;
    }

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


    OnPlayerSpawn
    Spoiler anzeigen


    public OnPlayerSpawn(playerid)
    {
    switch(pInfo[playerid][Fraktion])
    {
    case 0:
    {
    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"));
    SetPlayerPos(playerid,ZIVI_SPAWN);
    SetPlayerFacingAngle(playerid,91.5039);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,COLOR_WHITE);
    SetPlayerHealth(playerid,100);
    }
    case 1:
    {
    SetPlayerSkin(playerid,pInfo[playerid][Skin]);
    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);
    }
    case 2:
    {
    SetPlayerSkin(playerid,pInfo[playerid][Skin]);
    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);
    }
    case 3:
    {
    SetPlayerSkin(playerid,pInfo[playerid][Skin]);
    SetPlayerColor(playerid,BUNDESWEHR_GREEN);
    SetPlayerHealth(playerid,100);
    }
    case 4:
    {
    SetPlayerSkin(playerid,pInfo[playerid][Skin]);
    SetPlayerColor(playerid,SANI_RED);
    SetPlayerPos(playerid,SANI_SPAWN);
    SetPlayerFacingAngle(playerid,180.9012);
    SetCameraBehindPlayer(playerid);
    SetPlayerHealth(playerid,100);
    }
    case 5:
    {
    SetPlayerSkin(playerid,pInfo[playerid][Skin]);
    SetPlayerColor(playerid,ADAC_YELLOW);
    SetPlayerPos(playerid,ADAC_SPAWN);
    SetPlayerFacingAngle(playerid,177.4293);
    SetCameraBehindPlayer(playerid);
    SetPlayerHealth(playerid,100);
    }
    case 6:
    {
    SetPlayerSkin(playerid,pInfo[playerid][Skin]);
    SetPlayerColor(playerid,N24_ORANGE);
    SetPlayerPos(playerid,N24_SPAWN);
    SetPlayerFacingAngle(playerid,359.1059);
    SetCameraBehindPlayer(playerid);
    SetPlayerHealth(playerid,100);
    }
    case 7:
    {
    SetPlayerSkin(playerid,pInfo[playerid][Skin]);
    SetPlayerPos(playerid,GOLF_SPAWN);
    SetPlayerFacingAngle(playerid,47.0345);
    GivePlayerWeapon(playerid,2,1);
    GivePlayerWeapon(playerid,24,200);
    GivePlayerWeapon(playerid,29,500);
    SetPlayerHealth(playerid,100);
    }
    case 8:
    {
    SetPlayerSkin(playerid,pInfo[playerid][Skin]);
    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;
    }


    OnPlayerRequestClass
    Spoiler anzeigen


    public OnPlayerRequestClass(playerid, classid)
    {
    switch(pInfo[playerid][Fraktion])
    {
    case 0:
    {
    SetSpawnInfo(playerid,0,pInfo[playerid][Skin],ZIVI_SPAWN,0,0,0,0,0,0,0);
    SetPlayerFacingAngle(playerid,91.50939);
    SetCameraBehindPlayer(playerid);
    SetPlayerColor(playerid,COLOR_WHITE);
    SetPlayerHealth(playerid,100);
    SpawnPlayer(playerid);
    }
    case 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);
    }
    case 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);
    }
    case 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);
    }
    case 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);
    }
    case 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);
    }
    case 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);
    }
    case 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);
    }
    case 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;
    }


    Ich weiß nicht warum alles so schlecht eingerückt ist, im Script ist alles richtig eingerückt.


    Hoffe ihr könnt mir helfen! Ich weiß echt nich mehr weiter! :S

  • doch unter OnPlayerSpawn


    @TE


    Mach mal den Skin eintrag in den enum rein beim Acc laden und dann gibst du den Skin so:


    SetPlayerSkin(playerid,SpielerInfo[playerid][Skin]);

  • Packt er die Skin id da rein?


    und hast du bei OnPlayerSpawn noch iwo nen return stehen außer das am ende?

  • sende mir mal deine TV daten dann guck ich mal eben drüber