Skin wechsel mit Tasten wie?

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
  • So kurz und knapp


    man kommt in ein auswahl und mann kan nur wegseln mit KEY_FIRE vorwärts und mit KEY_CROUCH zurück wie mache ich das


    So sieht das bei mir aus: if(SelectChar[playerid] == 255)
    {
    if(newkeys == KEY_FIRE)
    {
    switch (SelectCharID[playerid])
    {
    case 1: // Member
    {
    if(gTeam[playerid] == TEAM_Member || pDaten[playerid][Team] == 0 || pDaten[playerid][leader] == 0)
    {
    if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, Member[0][0]); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = Member[0][0]; }
    else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, Member[1][0]); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = Member[1][0]; }
    ....(habs nur hier gelöscht)
    else if(SelectCharPlace[playerid] == 198) { SetPlayerSkin(playerid, Member[197][0]); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = Member[197][0]; }
    }
    }
    case 2: // Cops
    {
    if(gTeam[playerid] == TEAM_Cop || pDaten[playerid][Team] == 1 || pDaten[playerid][leader] == 1)
    {
    if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, Cop[0][0]); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = Cop[0][0]; }
    else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, Cop[1][0]); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = Cop[1][0]; }
    else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, Cop[2][0]); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = Cop[2][0]; }
    else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, Cop[3][0]); SelectCharPlace[playerid] = 5; ChosenSkin[playerid] = Cop[3][0]; }
    else if(SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid, Cop[4][0]); SelectCharPlace[playerid] = 6; ChosenSkin[playerid] = Cop[4][0]; }
    else if(SelectCharPlace[playerid] == 6) { SetPlayerSkin(playerid, Cop[5][0]); SelectCharPlace[playerid] = 7; ChosenSkin[playerid] = Cop[5][0]; }
    else if(SelectCharPlace[playerid] == 7) { SetPlayerSkin(playerid, Cop[6][0]); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = Cop[6][0]; }
    }
    }
    case 3: // Medic
    {
    if(gTeam[playerid] == TEAM_Medic || pDaten[playerid][Team] == 2 || pDaten[playerid][leader] == 2)
    {
    if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, Medic[0][0]); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = Medic[0][0]; }
    else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, Medic[1][0]); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = Medic[1][0]; }
    else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, Medic[2][0]); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = Medic[2][0]; }
    }
    }
    case 4: // Feuerwehr
    {
    if(gTeam[playerid] == TEAM_Feuerwehr || pDaten[playerid][Team] == 3 || pDaten[playerid][leader] == 3)
    {
    if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, Feuerwehr[0][0]); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = Feuerwehr[0][0]; }
    else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, Feuerwehr[1][0]); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = Feuerwehr[1][0]; }
    else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, Feuerwehr[2][0]); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = Feuerwehr[2][0]; }
    }
    }
    case 5: //OAmt
    {
    if(gTeam[playerid] == TEAM_OAmt || pDaten[playerid][Team] == 4 || pDaten[playerid][leader] == 4)
    {
    if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, OAmt[0][0]); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = OAmt[0][0]; }
    else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, OAmt[1][0]); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = OAmt[1][0]; }
    else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, OAmt[2][0]); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = OAmt[2][0]; }
    }
    }
    case 6: //Ballas
    {
    if(gTeam[playerid] == TEAM_Ballas || pDaten[playerid][Team] == 5 || pDaten[playerid][leader] == 5)
    {
    if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, Ballas[0][0]); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = Ballas[0][0]; }
    else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, Ballas[1][0]); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = Ballas[1][0]; }
    else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, Ballas[2][0]); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = Ballas[2][0]; }
    else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, Ballas[3][0]); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = Ballas[3][0]; }
    }
    }
    case 7: //Swat
    {
    if(gTeam[playerid] == TEAM_Swat || pDaten[playerid][Team] == 6 || pDaten[playerid][leader] == 6)
    {
    if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, Swat[0][0]); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = Swat[0][0]; }
    }
    }
    case 8: //FBI
    {
    if(gTeam[playerid] == TEAM_FBI || pDaten[playerid][Team] == 7 || pDaten[playerid][leader] == 7)
    {
    if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, FBI[0][0]); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = FBI[0][0]; }
    }
    }
    case 9: //Yakuza
    {
    if(gTeam[playerid] == TEAM_Yakuza || pDaten[playerid][Team] == 8 || pDaten[playerid][leader] == 8)
    {
    if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, Yakuza[0][0]); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = Yakuza[0][0]; }
    else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, Yakuza[1][0]); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = Yakuza[1][0]; }
    else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, Yakuza[2][0]); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = Yakuza[2][0]; }
    else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, Yakuza[3][0]); SelectCharPlace[playerid] = 5; ChosenSkin[playerid] = Yakuza[3][0]; }
    else if(SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid, Yakuza[4][0]); SelectCharPlace[playerid] = 6; ChosenSkin[playerid] = Yakuza[4][0]; }
    else if(SelectCharPlace[playerid] == 6) { SetPlayerSkin(playerid, Yakuza[5][0]); SelectCharPlace[playerid] = 7; ChosenSkin[playerid] = Yakuza[5][0]; }
    else if(SelectCharPlace[playerid] == 7) { SetPlayerSkin(playerid, Yakuza[6][0]); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = Yakuza[6][0]; }
    }
    }
    case 10: //Army
    {
    if(gTeam[playerid] == TEAM_Army || pDaten[playerid][Team] == 9 || pDaten[playerid][leader] == 9)
    {
    if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, Army[0][0]); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = Army[0][0]; }
    }
    }
    case 11: //Fahrschule
    {
    if(gTeam[playerid] == TEAM_Fahrschule || pDaten[playerid][Team] == 10 || pDaten[playerid][leader] == 10)
    {
    if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, Fahrschule[0][0]); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = Fahrschule[0][0]; }
    else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, Fahrschule[1][0]); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = Fahrschule[1][0]; }
    else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, Fahrschule[2][0]); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = Fahrschule[2][0]; }
    else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, Fahrschule[3][0]); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = Fahrschule[3][0]; }
    }
    }
    case 12: //Grove
    {
    if(gTeam[playerid] == TEAM_Grove || pDaten[playerid][Team] == 11 || pDaten[playerid][leader] == 11)
    {
    if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, Grove[0][0]); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = Grove[0][0]; }
    else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, Grove[1][0]); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = Grove[1][0]; }
    else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, Grove[2][0]); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = Grove[2][0]; }
    else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, Grove[3][0]); SelectCharPlace[playerid] = 5; ChosenSkin[playerid] = Grove[3][0]; }
    else if(SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid, Grove[4][0]); SelectCharPlace[playerid] = 6; ChosenSkin[playerid] = Grove[4][0]; }
    else if(SelectCharPlace[playerid] == 6) { SetPlayerSkin(playerid, Grove[5][0]); SelectCharPlace[playerid] = 7; ChosenSkin[playerid] = Grove[5][0]; }
    else if(SelectCharPlace[playerid] == 7) { SetPlayerSkin(playerid, Grove[6][0]); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = Grove[6][0]; }
    }
    }
    case 13: //Vagos
    {
    if(gTeam[playerid] == TEAM_Vagos || pDaten[playerid][Team] == 12 || pDaten[playerid][leader] == 12)
    {
    if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, Vagos[0][0]); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = Vagos[0][0]; }
    else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, Vagos[1][0]); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = Vagos[1][0]; }
    else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, Vagos[2][0]); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = Vagos[2][0]; }
    else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, Vagos[3][0]); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = Vagos[3][0]; }
    }
    }
    case 14: //Aztecas
    {
    if(gTeam[playerid] == TEAM_Aztecas || pDaten[playerid][Team] == 13 || pDaten[playerid][leader] == 13)
    {
    if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, Aztecas[0][0]); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = Aztecas[0][0]; }
    else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, Aztecas[1][0]); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = Aztecas[1][0]; }
    else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, Aztecas[2][0]); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = Aztecas[2][0]; }
    else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, Aztecas[3][0]); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = Aztecas[3][0]; }
    }
    }
    case 15: //Rifa
    {
    if(gTeam[playerid] == TEAM_Rifa || pDaten[playerid][Team] == 14 || pDaten[playerid][leader] == 14)
    {
    if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, Rifa[0][0]); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = Rifa[0][0]; }
    else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, Rifa[1][0]); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = Rifa[1][0]; }
    else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, Rifa[2][0]); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = Rifa[2][0]; }
    else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, Rifa[3][0]); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = Rifa[3][0]; }
    }
    }
    }
    return 0;
    }
    else if(newkeys == KEY_ACTION)
    {
    if(ChangePos2[playerid][1] == 1)
    {
    SetPlayerInterior(playerid, ChangePos2[playerid][0]);
    SetPlayerPos(playerid, ChangePos[playerid][0],ChangePos[playerid][1],ChangePos[playerid][2]);
    ChangePos2[playerid][1] = 0;
    return 0;
    }
    pDaten[playerid][Skin] = ChosenSkin[playerid];
    SetSpawnInfo(playerid, pDaten[playerid][Team], pDaten[playerid][Skin],0.0,0.0,0.0,0,0,0,0,0,0,0);
    gTeam[playerid] = pDaten[playerid][Team];
    SetPlayerToTeamColor(playerid);
    SpawnPlayer(playerid);
    SelectCharPlace[playerid] = 0;
    SelectCharID[playerid] = 0;
    SelectChar[playerid] = 0;
    UnFreezePlayer(playerid);
    return 0;
    }
    else
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Benutze 'Enter'um zu bestätigen.");
    return 0;
    }
    }
    Bei mir klappt das irgend wie nicht. Wenn man KEY_FIRE oder KEY_ACTION macht kommt immer die zeile im spiel SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Benutze 'Enter'um zu bestätigen."); wieso.


    Wenn eienr ne andere Variante hat wie ich da smach emit tasten bitte sagen oder ein tut gibt

    3 Mal editiert, zuletzt von HoneyKing () aus folgendem Grund: was dazu gefügt


  • #define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
    #define RELEASED(%0) \
    (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
    #define HOLDING(%0) \
    ((newkeys & (%0)) == (%0))



    für das oben im Script ein, dann kannst du verwenden zum Beispiel



    if(PRESSED(KEY_FIRE))
    {


  • keiner eine lösung wieso e rimmer das hier macht
    else
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Benutze 'Enter'um zu bestätigen.");
    return 0;
    }

    edit ab da scheitert der code habe das mit print geprüft
    switch (SelectCharID[playerid])
    {
    case 1: // Member
    {
    print("4wwww");

    Einmal editiert, zuletzt von HoneyKing () aus folgendem Grund: noch was dazu gegeben