Problem mit Skinauswahl (Fraktionen

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
  • new LVPDSkins[] = {163,164,282,283,288,194};


    if(IsPlayerInFrac(playerid,3))
    {
    if(Skin < LVPDSkins[5])
    {
    for(new ias=0; ias<sizeof(LVPDSkins); ias++)
    {
    if(Skin != LVPDSkins[ias])continue;
    SetPlayerSkin(playerid, LVPDSkins[ias]);
    }
    return 1;
    }
    if(Skin == LVPDSkins[5])
    {
    SetPlayerSkin(playerid, LVPDSkins[0]);
    return 1;
    }
    }



    else if(IsPlayerInFrac(playerid,3))
    {
    SetPlayerSkin(playerid, LVPDSkins[0]);
    return 1;
    }




    Ich kann nicht weiter schalten warum? Bei jeder anderen Fraktion geht das :(

    • Offizieller Beitrag

    Bei jeder anderen Fraktion funktioniert das? Dann könntest du mal den Code von dem gezeigten Beispiel mit den anderen Fraktionen vergleichen und nach Unterschieden absuchen. Optional kannst du den Code auch hier posten und wir schauen uns das alle mal gemeinsam an.


  • if(newkeys & KEY_SECONDARY_ATTACK )
    {
    if(ChooseSkin[playerid] == 1)
    {
    new skin = GetPlayerSkin(playerid);
    PlayerInfo[playerid][pModel] = skin;
    PlayerInfo[playerid][pChar] = skin;
    ChooseSkin[playerid] = 0;
    SpawnPlayer(playerid);
    TogglePlayerControllable(playerid,1);
    SetPlayerVirtualWorld(playerid,0);
    return 1;
    }
    }



    new ChooseSkin[MAX_PLAYERS];
    new GroveSkins[] = {105,106,107,269,271,65};
    new SFRifaSkins[] = {114,115,116,173,174,175,184,273,195,298};
    new RMafiaSkins[] = {111,112,113,124,125,126,127,272,40}; //9 //6
    new YakuzaSkins[] = {122,123,186,203,204,228,169,224}; //12 //6
    new LCMSkins[] = {46,47,48,98,195,223,214}; //17 //5
    new HitmanSkins[55] = {2,3,6,7,14,15,18,19,20,21,22,23,24,25,26,29,38,45,66,72,73,97,101,134,137,142,180,210,217,220,230,10,11,39,41,54,55,69,77,88,89,90,93,141,190,192,199,211,243,251}; //19 //5
    new BallasSkins[] = {102,103,104,293,13}; //21 //4
    new NewsSkins[] = {60,170,188,227,240,250,56,226}; //22 //4
    new ZiviSkins[] = {12,141,230,137,2,1,3,7,14,18,20,19,21,22,23,26,25,37,45,59,72,73,101,134,136,142,180,182,210,217,220,221,222,239}; //0 //10
    new LSPDSkins[] = {163,164,265,266,267,280,281,282,283,284,288,194,93}; //1 //7
    new FBISkins[] = {165,166,286,294,194,93};
    new OamtSkins[] = {8,50,71,233}; //2 //5
    new MedicSkins[] = {70,274,275,276,193}; //4 //3
    new TerrorSkins[] = {12,141,230,137,2,1,3,7,14,18,20,19,21,22,23,26,25,37,45,59,72,73,101,134,136,142,180,182,210,217,220,221,222,239};
    new LVPDSkins[] = {163,164,282,283,288,194};



    if(strcmp(cmd,"/einvite",true) == 0)
    {
    tmp = strtok(cmdtext,idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "BENUTZUNG: /einladung [annehmen/ablehnen]");
    return 1;
    }
    if(Eingeladen[playerid] == 0)
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du wurdest in keine Fraktion eingeladen!");
    return 1;
    }
    if(strcmp(tmp,"annehmen",true) == 0)
    {
    if(Eingeladen[playerid] == 1) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ChosenSkin[playerid] = 280; SetPlayerSkin(playerid, 280); }
    else if(Eingeladen[playerid] == 2) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ChosenSkin[playerid] = 280; SetPlayerSkin(playerid, 280); }
    else if(Eingeladen[playerid] == 3) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ChosenSkin[playerid] = 287; SetPlayerSkin(playerid, 287); }
    else if(Eingeladen[playerid] == 4) { PlayerInfo[playerid][pTeam] = 1; gTeam[playerid] = 1; ChosenSkin[playerid] = 70; SetPlayerSkin(playerid, 70); }
    else if(Eingeladen[playerid] == 5) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ChosenSkin[playerid] = 258; SetPlayerSkin(playerid, 120); }
    else if(Eingeladen[playerid] == 6) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ChosenSkin[playerid] = 294; SetPlayerSkin(playerid, 294); }
    else if(Eingeladen[playerid] == 7) { PlayerInfo[playerid][pTeam] = 7; gTeam[playerid] = 7; ChosenSkin[playerid] = 164; SetPlayerSkin(playerid, 164); }
    else if(Eingeladen[playerid] == 8) { PlayerInfo[playerid][pTeam] = 8; gTeam[playerid] = 8; ChosenSkin[playerid] = 250; SetPlayerSkin(playerid, 250); }
    else if(Eingeladen[playerid] == 9) { PlayerInfo[playerid][pTeam] = 9; gTeam[playerid] = 9; ChosenSkin[playerid] = 187; SetPlayerSkin(playerid, 187); }
    else if(Eingeladen[playerid] == 10) { PlayerInfo[playerid][pTeam] = 10; gTeam[playerid] = 10; ChosenSkin[playerid] = 255; SetPlayerSkin(playerid, 255); }
    else if(Eingeladen[playerid] == 11) { PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; ChosenSkin[playerid] = 240; SetPlayerSkin(playerid, 240); }
    else if(Eingeladen[playerid] == 12) { PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; ChosenSkin[playerid] = 118; SetPlayerSkin(playerid, 118); }//Fuegos
    else if(Eingeladen[playerid] == 13) { PlayerInfo[playerid][pTeam] = 13; gTeam[playerid] = 13; ChosenSkin[playerid] = 105; SetPlayerSkin(playerid, 105); }//Grove
    else if(Eingeladen[playerid] == 14) { PlayerInfo[playerid][pTeam] = 14; gTeam[playerid] = 14; ChosenSkin[playerid] = 102; SetPlayerSkin(playerid, 102); }//Ballas
    else if(Eingeladen[playerid] == 15) { PlayerInfo[playerid][pTeam] = 15; gTeam[playerid] = 15; ChosenSkin[playerid] = 185; SetPlayerSkin(playerid, 185); }//Street Racer
    else if(Eingeladen[playerid] == 16) { PlayerInfo[playerid][pTeam] = 16; gTeam[playerid] = 16; ChosenSkin[playerid] = 108; SetPlayerSkin(playerid, 108); }//Los Santos Vagos
    else if(Eingeladen[playerid] == 17) { PlayerInfo[playerid][pTeam] = 17; gTeam[playerid] = 17; ChosenSkin[playerid] = 114; SetPlayerSkin(playerid, 114); }//Varios Los Aztecas
    else if(Eingeladen[playerid] == 18) { PlayerInfo[playerid][pTeam] = 18; gTeam[playerid] = 18; ChosenSkin[playerid] = 173; SetPlayerSkin(playerid, 173); }//Los Santos Rifa
    else if(Eingeladen[playerid] == 19) { PlayerInfo[playerid][pTeam] = 19; gTeam[playerid] = 19; ChosenSkin[playerid] = 234; SetPlayerSkin(playerid, 234); }//West Coust Customs
    else if(Eingeladen[playerid] == 20) { PlayerInfo[playerid][pTeam] = 20; gTeam[playerid] = 20; ChosenSkin[playerid] = 220; SetPlayerSkin(playerid, 220); }
    else if(Eingeladen[playerid] == 21) { PlayerInfo[playerid][pTeam] = 21; gTeam[playerid] = 21; ChosenSkin[playerid] = 28; SetPlayerSkin(playerid, 28); } else if(Eingeladen[playerid] == 22) { PlayerInfo[playerid][pTeam] = 22; gTeam[playerid] = 22; ChosenSkin[playerid] = 274; SetPlayerSkin(playerid, 274); }
    else if(Eingeladen[playerid] == 23) { PlayerInfo[playerid][pTeam] = 23; gTeam[playerid] = 23; ChosenSkin[playerid] = 133; SetPlayerSkin(playerid, 133); }
    else if(Eingeladen[playerid] == 24) { PlayerInfo[playerid][pTeam] = 24; gTeam[playerid] = 24; ChosenSkin[playerid] = 255; SetPlayerSkin(playerid, 255); }
    else { return 1; }
    GetPlayerName(playerid,sendername,sizeof(sendername));
    PlayerInfo[playerid][pMember] = Eingeladen[playerid];
    PlayerInfo[playerid][pRank] = 1;
    format(string,sizeof(string)," %s hat die Einladung in die Fraktion %s angenommen!",sendername,Fracs[Eingeladen[playerid]-1]);
    for(new i=0; i<MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(PlayerInfo[i][pLeader] == Eingeladen[playerid])
    {
    SendClientMessage(i,COLOR_LIGHTBLUE,string);
    }
    }
    }
    ChooseSkin[playerid] = 1;
    SetPlayerPos(playerid,438.4619,-1749.7987,8.9587);
    SetPlayerFacingAngle(playerid, 225.8304);
    SetPlayerCameraPos(playerid, 442.4785,-1753.8348,10.1118);
    SetPlayerCameraLookAt(playerid, 438.4619,-1749.7987,8.9587);
    TogglePlayerControllable(playerid,0);
    SetPlayerInterior(playerid,0);
    SetPlayerVirtualWorld(playerid,playerid);
    SendClientMessage(playerid, COLOR_YELLOW, "========== [Skinauswahl] ==========");
    SendClientMessage(playerid, COLOR_WHITE, "Drücke Shift um zum Nächsten Skin zu wechseln.");
    SendClientMessage(playerid, COLOR_WHITE, "Drücke F oder ENTER um den Gewählten Skin zu benutzen.");
    if(IsPlayerInFrac(playerid,5))
    {
    SetPlayerSkin(playerid, LCMSkins[0]);
    return 1;
    }
    else if(IsPlayerInFrac(playerid,6))
    {
    SetPlayerSkin(playerid, YakuzaSkins[0]);
    return 1;
    }
    else if(IsPlayerInFrac(playerid,8))
    {
    SetPlayerSkin(playerid, HitmanSkins[0]);
    return 1;
    }
    else if(IsPlayerInFrac(playerid,9))
    {
    SetPlayerSkin(playerid, NewsSkins[0]);
    return 1;
    }
    else if(IsPlayerInFrac(playerid,13))
    {
    SetPlayerSkin(playerid, GroveSkins[0]);
    return 1;
    }
    else if(IsPlayerInFrac(playerid,14))
    {
    SetPlayerSkin(playerid, BallasSkins[0]);
    return 1;
    }
    else if(IsPlayerInFrac(playerid,18))
    {
    SetPlayerSkin(playerid, SFRifaSkins[0]);
    return 1;
    }
    else if(IsPlayerInFrac(playerid,23))
    {
    SetPlayerSkin(playerid, RMafiaSkins[0]);
    return 1;
    }
    else if(IsPlayerInFrac(playerid,1))
    {
    SetPlayerSkin(playerid, LSPDSkins[0]);
    return 1;
    }
    else if(IsPlayerInFrac(playerid,2))
    {
    SetPlayerSkin(playerid, FBISkins[0]);
    }
    else if(IsPlayerInFrac(playerid,3))
    {
    SetPlayerSkin(playerid, LVPDSkins[0]);
    return 1;
    }
    else if(IsPlayerInFrac(playerid,4))
    {
    SetPlayerSkin(playerid, MedicSkins[0]);
    return 1;
    }
    else if(IsPlayerInFrac(playerid,24))
    {
    SetPlayerSkin(playerid, OamtSkins[0]);
    return 1;
    }
    else
    {
    SetPlayerSkin(playerid, ZiviSkins[0]);
    return 1;
    }
    }
    else if(strcmp(tmp,"ablehnen",true) == 0)
    {
    format(string,sizeof(string)," %s hat die Einladung in die Fraktion %s abgelehnt!",sendername,Fracs[Eingeladen[playerid]-1]);
    for(new i=0; i<MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(PlayerInfo[i][pLeader] == Eingeladen[playerid])
    {
    SendClientMessage(i,COLOR_LIGHTBLUE,string);
    }
    }
    }
    Eingeladen[playerid] = 0;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: /einladung [annehmen/ablehnen]");
    }
    return 1;
    }