Laden des Skins es kommt nur CJ raus

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
  • Guten Tag,
    beim laden eines Skins wird immer nur CJ gesettet.
    Why?


    public OnPlayerSpawn(playerid)
    {
    if(IsPlayerAdmin(playerid))
    {
    new pID, msg[144];
    format(msg, sizeof(msg),"Willkommen %s, du hast dich als Admin Rank %i eingeloggt.",SpielerName(playerid),GetPVarInt(pID,"Adminlevel"));
    SendClientMessage(playerid,BLAU,msg);
    return 1;
    }
    if(Arena[playerid] == 1)
    {
    SetPlayerPos(playerid,-971.8334,1089.9342,1344.9961);
    SetPlayerInterior(playerid,10);
    SetPlayerHealth(playerid,100);
    GivePlayerWeapon(playerid,24,900);
    return 1;
    }
    else if(Arena[playerid] == 2)
    {
    SetPlayerPos(playerid,367.3092,158.1934,1014.1875);
    SetPlayerInterior(playerid,3);
    SetPlayerHealth(playerid,100);
    GivePlayerWeapon(playerid,34,900);
    return 1;
    }
    else if(Arena[playerid] == 3)
    {
    SetPlayerPos(playerid,367.3092,158.1934,1014.1875);
    SetPlayerInterior(playerid,1);
    SetPlayerHealth(playerid,100);
    GivePlayerWeapon(playerid,24,900);
    return 1;
    }
    else if(Arena[playerid] == 4)
    {
    switch(random(6))
    {
    case 0: { SetPlayerPos(playerid,2223.5076,-1148.6694,1025.7969);SetPlayerInterior(playerid,15);}
    case 1: { SetPlayerPos(playerid,2238.9226,-1154.9788,1029.7969);SetPlayerInterior(playerid,15);}
    case 2: { SetPlayerPos(playerid,2250.5847,-1165.3674,1029.7969);SetPlayerInterior(playerid,15);}
    case 3: { SetPlayerPos(playerid,2238.7441,-1165.2533,1029.7969);SetPlayerInterior(playerid,15);}
    case 4: { SetPlayerPos(playerid,2227.2576,-1182.9080,1029.8043);SetPlayerInterior(playerid,15);}
    case 5: { SetPlayerPos(playerid,2199.0776,-1193.0017,1029.7969);SetPlayerInterior(playerid,15);}
    case 6: { SetPlayerPos(playerid,2193.6851,-1146.5016,1029.7969);SetPlayerInterior(playerid,15);}
    }
    SetPlayerHealth(playerid,100);
    GivePlayerWeapon(playerid,24,900);
    GivePlayerWeapon(playerid,30,900);
    return 1;
    }
    {
    new pfad[144];
    SetPlayerSkin(playerid,dini_Int(pfad,"Skin"));
    dini_IntSet(pfad,"Skin",GetPlayerSkin(playerid));
    }
    return 1;
    }
    stock LoadAccount(playerid)
    {
    new name[MAX_PLAYER_NAME], pfad[64];
    GetPlayerName(playerid,name,sizeof(name));
    format(pfad,sizeof(pfad),"/Accounts/%s.txt",name);
    SetPlayerScore(playerid,dini_Int(pfad,"Level"));
    GivePlayerMoney(playerid,dini_Int(pfad,"Geld"));
    SetPVarInt(playerid,"Adminlevel",dini_Int(pfad,"Adminlevel"));
    SetPVarInt(playerid,"Fraktion",dini_Int(pfad,"Fraktion"));
    SetPVarInt(playerid,"Baned",dini_Int(pfad,"Baned"));
    SetPlayerSkin(playerid,dini_Int(pfad,"Skin"));
    SetPVarInt(playerid,"Tode",dini_Int(pfad,"Tode"));
    SetPVarInt(playerid,"Kills",dini_Int(pfad,"Kills"));
    if(GetPVarInt(playerid,"Baned")==1)
    {
    SendClientMessage(playerid,ROT,"Du bist vom Server gebannt.");
    Kick(playerid);
    }
    SetPVarInt(playerid,"loggedin",1);
    return 1;
    }


    stock SpielerSpeichern(playerid)
    {
    if(GetPVarInt(playerid,"loggedin")==1)
    {
    new name[MAX_PLAYER_NAME], pfad[64];
    GetPlayerName(playerid,name,sizeof(name));
    format(pfad,sizeof(pfad),"/Accounts/%s.txt",name);
    dini_IntSet(pfad,"Level",GetPlayerScore(playerid));
    dini_IntSet(pfad,"Geld",GetPlayerMoney(playerid));
    dini_IntSet(pfad,"Adminlevel",GetPVarInt(playerid,"Adminlevel"));
    dini_IntSet(pfad,"Fraktion",GetPVarInt(playerid,"Fraktion"));
    dini_IntSet(pfad,"Baned",GetPVarInt(playerid,"Baned"));
    dini_IntSet(pfad,"Skin",GetPlayerSkin(playerid));
    dini_IntSet(pfad,"timeban",GetPVarInt(playerid,"timeban"));
    dini_IntSet(pfad,"Tode",GetPVarInt(playerid,"Tode"));
    dini_IntSet(pfad,"Kills",GetPVarInt(playerid,"Kills"));
    }
    return 1;
    }


    Helft mir



    Mit Freundlichen Grüßen

  • Was fällt dir

    new pfad[144];
    SetPlayerSkin(playerid,dini_Int(pfad,"Skin"));
    dini_IntSet(pfad,"Skin",GetPlayerSkin(playerid));
    }


    im vergleich zu:
    new name[MAX_PLAYER_NAME], pfad[64];
    GetPlayerName(playerid,name,sizeof(name));
    format(pfad,sizeof(pfad),"/Accounts/%s.txt",name);


    auf ? Richtig dir fehlt der Pfad zu der Datei um somit kommt immer 0 raus und 0 ist CJ

  • Habe jetzt diesen Fehler :
    C:\Users\Patrick\Desktop\Server\gamemodes\IRP-City.pwn(191) : warning 219: local variable "name" shadows a variable at a preceding level
    C:\Users\Patrick\Desktop\Server\gamemodes\IRP-City.pwn(191) : warning 219: local variable "pfad" shadows a variable at a preceding level
    C:\Users\Patrick\Desktop\Server\gamemodes\IRP-City.pwn(252) : warning 217: loose indentation
    C:\Users\Patrick\Desktop\Server\gamemodes\IRP-City.pwn(474) : warning 202: number of arguments does not match definition
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    4 Warnings.


    public OnPlayerConnect(playerid)
    {
    new name[MAX_PLAYER_NAME], pfad[64];
    GetPlayerName(playerid,name,sizeof(name));
    format(pfad,sizeof(pfad),"/Accounts/%s.txt",name);
    if(dini_Exists(pfad))
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Dein Account wurde gefunden. Gib bitte das Passwort ein.","Login","Abbrechen");
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registrieren","Gib bitte das gewünschte Passwort ein:","Register","Abbrechen");
    }
    new string[144];
    format(string, sizeof(string),"Herzlich Willkommen auf United Deathmatch, %s",name);
    SendClientMessage(playerid,GELB,string);
    if(IsPlayerAdmin(playerid))
    {
    new pID, msg[144];
    format(msg, sizeof(msg),"Willkommen %s, du hast dich als Admin Rank %i eingeloggt.",SpielerName(playerid),GetPVarInt(pID,"Adminlevel"));
    SendClientMessage(playerid,GELB,msg);
    return 1;
    }
    Arena[playerid] = 0;
    {
    new name[MAX_PLAYER_NAME], pfad[64];
    GetPlayerName(playerid,name,sizeof(name));
    format(pfad,sizeof(pfad),"/Accounts/%s.txt",name);
    }
    return 1;
    }
    was ist falsch also bei unten new Name[MAX_PLAYER_NAME] etc.