Spieler Skin laden Problem

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Spieler Skin laden Problem

    Heyho Leute,

    ich habe folgendes Problem: Ich will, dass wenn sich der Spieler einloggt seinen Skin bekommt der zuvor beim ausloggen gespeichert wurde.
    Leider klappt das nicht ganz, gespeichert wird der Skin zwar, aber wenn der Spieler dann spawnt bekommt er immer den Skin mit ID1...

    Spieler Speichern:
    Spoiler anzeigen
    [pwn]
    stock SavePlayerData(playerid)
    {
    new pName[MAX_PLAYER_NAME], path[200];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(path, 200, "/Accounts/%s.ini", pName);
    dini_IntSet(path, "pLevel", GetPlayerScore(playerid));
    dini_IntSet(path, "pMoney", GetPlayerMoney(playerid));
    dini_IntSet(path, "pSkin", GetPlayerSkin(playerid));
    dini_IntSet(path, "pGender", pData[playerid][pGender]);
    dini_IntSet(path, "pAge", pData[playerid][pAge]);
    dini_IntSet(path, "pFaction", pData[playerid][pFaction]);
    dini_IntSet(path, "pFaction_Rank", pData[playerid][pFaction_Rank]);
    dini_IntSet(path, "pFaction_Leader", pData[playerid][pFaction_Leader]);
    dini_IntSet(path, "pAdmin_Rank", pData[playerid][pAdmin_Rank]);
    dini_IntSet(path, "pLicense_Car", pData[playerid][pLicense_Car]);
    dini_IntSet(path, "pLicense_Bike", pData[playerid][pLicense_Bike]);
    dini_IntSet(path, "pLicense_Truck", pData[playerid][pLicense_Truck]);
    dini_IntSet(path, "pLicense_Boat", pData[playerid][pLicense_Boat]);
    dini_IntSet(path, "pLicense_Fish", pData[playerid][pLicense_Fish]);
    dini_IntSet(path, "pLicense_Airplane", pData[playerid][pLicense_Airplane]);
    dini_IntSet(path, "pLicense_Weapon", pData[playerid][pLicense_Weapon]);
    dini_IntSet(path, "pBanned", pData[playerid][pBanned]);
    pData[playerid][pADuty] = 0;
    pData[playerid][pLoggedin] = 0;
    }
    [/pwn]


    Spieler Laden:
    Spoiler anzeigen
    [pwn]
    stock LoadPlayerData(playerid)
    {
    new pName[MAX_PLAYER_NAME], path[200];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(path, 200, "/Accounts/%s.ini", pName);
    pData[playerid][pLevel] = SetPlayerScore(playerid, dini_Int(path, "pLevel"));
    pData[playerid][pMoney] = GivePlayerMoney(playerid, dini_Int(path, "pMoney"));
    pData[playerid][pSkin] = SetPlayerSkin(playerid, dini_Int(path, "pSkin"));
    pData[playerid][pGender] = dini_Int(path, "pGender");
    pData[playerid][pAge] = dini_Int(path, "pAge");
    pData[playerid][pFaction] = dini_Int(path, "pFaction");
    pData[playerid][pFaction_Rank] = dini_Int(path, "pFaction_Rank");
    pData[playerid][pFaction_Leader] = dini_Int(path, "pFaction_Leader");
    pData[playerid][pAdmin_Rank] = dini_Int(path, "pAdmin_Rank");
    pData[playerid][pLicense_Car] = dini_Int(path, "pLicense_Car");
    pData[playerid][pLicense_Bike] = dini_Int(path, "pLicense_Bike");
    pData[playerid][pLicense_Truck] = dini_Int(path, "pLicense_Truck");
    pData[playerid][pLicense_Boat] = dini_Int(path, "pLicense_Boat");
    pData[playerid][pLicense_Fish] = dini_Int(path, "pLicense_Fish");
    pData[playerid][pLicense_Airplane] = dini_Int(path, "pLicense_Airplane");
    pData[playerid][pLicense_Weapon] = dini_Int(path, "pLicense_Weapon");
    pData[playerid][pBanned] = dini_Int(path, "pBanned");
    pData[playerid][pLoggedin] = 1;
    if(pData[playerid][pBanned] == 1)
    {
    Dialog_Banned;
    Kick(playerid);
    }
    /*if(pData[playerid][pAdmin_Rank] >= 1)
    {
    strins(pName, "[jRP]", 0);
    SetPlayerName(playerid, pName);
    }*/
    SpawnPlayer(playerid);
    }
    [/pwn]


    Spieler fordert eine Klasse an:
    Spoiler anzeigen
    [pwn]
    public OnPlayerRequestClass(playerid, classid)
    {
    switch(pData[playerid][pFaction])
    {
    case 0:
    {
    SetSpawnInfo(playerid, 0, pData[playerid][pSkin], Spawn_Civilian, 0, 0, 0, 0, 0, 0, 0);
    SetPlayerColor(playerid, Color_Civilian);
    }
    case 1:
    {
    SetSpawnInfo(playerid, 0, pData[playerid][pSkin], Spawn_LSPD, 0, 0, 0, 0, 0, 0, 0);
    SetPlayerColor(playerid, Color_LSPD);
    }
    case 2:
    {
    SetSpawnInfo(playerid, 0, pData[playerid][pSkin], Spawn_FBI, 0, 0, 0, 0, 0, 0, 0);
    SetPlayerColor(playerid, Color_FBI);
    }
    case 3:
    {
    SetSpawnInfo(playerid, 0, pData[playerid][pSkin], Spawn_Medic, 0, 0, 0, 0, 0, 0, 0);
    SetPlayerColor(playerid, Color_Medic);
    }
    case 4:
    {
    SetSpawnInfo(playerid, 0, pData[playerid][pSkin], Spawn_TownService, 0, 0, 0, 0, 0, 0, 0);
    SetPlayerColor(playerid, Color_TownService);
    }
    case 5:
    {
    SetSpawnInfo(playerid, 0, pData[playerid][pSkin], Spawn_SanNews, 0, 0, 0, 0, 0, 0, 0);
    SetPlayerColor(playerid, Color_SanNews);
    }
    case 6:
    {
    SetSpawnInfo(playerid, 0, pData[playerid][pSkin], Spawn_Grove, 0, 0, 0, 0, 0, 0, 0);
    SetPlayerColor(playerid, Color_Grove);
    }
    case 7:
    {
    SetSpawnInfo(playerid, 0, pData[playerid][pSkin], Spawn_Ballas, 0, 0, 0, 0, 0, 0, 0);
    SetPlayerColor(playerid, Color_Ballas);
    }
    case 8:
    {
    SetSpawnInfo(playerid, 0, pData[playerid][pSkin], Spawn_Vagos, 0, 0, 0, 0, 0, 0, 0);
    SetPlayerColor(playerid, Color_Vagos);
    }
    case 9:
    {
    SetSpawnInfo(playerid, 0, pData[playerid][pSkin], Spawn_Vagos, 0, 0, 0, 0, 0, 0, 0);
    SetPlayerColor(playerid, Color_Vagos);
    }
    }
    return 1;
    }
    [/pwn]


    Spieler spawnt:
    Spoiler anzeigen
    [pwn]
    public OnPlayerSpawn(playerid)
    {
    if(pData[playerid][pLoggedin] == 0)
    {
    SendClientMessage(playerid, Color_Error, "Du musst dich vor dem spawnen einloggen!");
    Kick(playerid);
    }
    return 1;
    }
    [/pwn]

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von Jay_Carnivora ()