Teams mit gTeam erstellen [UPDATED]

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
  • Nabend
    nö das ist Classid 1 :cursing:
    es fängt von 0 an und dann aufwärt´s 0,1,2,3....


    Mfg:Tigerkiller

  • Zitat

    Sorry das ich diesen Thread ausgrabe aber habe da ein Problem.


    Bei mir werden die Skins beim Skin auswahlmenü nicht angezeigt.

    hab das selbe problem kann mir bitte jemand helfen :D

  • hm... :wacko: ich bekomms irgendwie nicht hin kann mir mal einer nen scriptbeispiel posten, mit dem man die Skins bei der Auswahl sieht (( ich möchte eine art TDM machen deshalb^^ )). Bei mir kommt nach dem einloggen halt die leiste unten zum auswählen nur man sieht den skin nicht, den man auswählen kann

  • Unter OnPlayerRequestClass(playerid, classid)


    SetPlayerInterior(playerid, 0); // Ich weis nicht ob das notwendig ist aber ich habs mitdrin.
    SetPlayerPos(playerid, x, y, z); // Wo der spieler sich befinden soll.
    SetPlayerCameraPos(playerid, x, y, z); // Die Position der Kamera
    SetPlayerCameraLookAt(playerid, x, y, z); // Wohin die Kamera hingucken soll.

  • Hab ein Problem:


    Ich wollte ein Team erstellen, wo nur Admins rein können.
    Die "nicht Admins" können die Skins noch sehen, aber unter anderen Teams.
    Wenn sie auf einen Admin Skinn drücken, kommen sie in der Admin Base an...



    public OnPlayerRequestClass(playerid, classid)
    {
    PlayerInfo[playerid][pModel] = classid;
    SetPlayerClass(playerid, classid);
    PlayerPlaySound(playerid, 1068, 0.0, 0.0, 0.0 );
    switch(classid)
    {
    case 0..2:
    {
    SetPlayerPos(playerid, 2498.2249,-1644.6326,18.8751);
    SetPlayerCameraPos(playerid, 2498.2676,-1640.1935,18.6116);
    SetPlayerCameraLookAt(playerid, 2498.2249,-1644.6326,18.8751);
    SetPlayerFacingAngle(playerid, 0.0);
    GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~Grove Street Families", 3000, 3);
    ApplyAnimation(playerid,"LOWRIDER", "RAP_B_Loop",4.0,1,1,1,1,1);
    }
    case 3..5:
    {
    SetPlayerPos(playerid, 1979.8929,-1143.1704,25.9858);
    SetPlayerCameraPos(playerid, 1975.8948,-1145.9689,25.9895);
    SetPlayerCameraLookAt(playerid, 1979.8929,-1143.1704,25.9858);
    SetPlayerFacingAngle(playerid, 120.0);
    GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~p~Rolling Height Ballas", 3000, 3);
    ApplyAnimation(playerid,"GHANDS", "gsign2LH",4.0,1,1,1,1,1);
    }
    case 6..8:
    {
    SetPlayerPos(playerid, 2654.5081,-1063.5448,69.5937);
    SetPlayerCameraPos(playerid, 2658.3940,-1060.7126,69.5209);
    SetPlayerCameraLookAt(playerid, 2654.5081,-1063.5448,69.5937);
    SetPlayerFacingAngle(playerid, 300.0);
    GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Los Santos Vagos", 3000, 3);
    ApplyAnimation(playerid,"RIOT", "RIOT_CHANT",4.0,1,1,1,1,1);
    }
    case 9..11:
    {
    SetPlayerPos(playerid, 1810.5295,-2103.0408,13.5469);
    SetPlayerCameraPos(playerid, 1814.3398,-2100.5222,13.5469);
    SetPlayerCameraLookAt(playerid, 1810.5295,-2103.0408,13.5469);
    SetPlayerFacingAngle(playerid, 300.0);
    GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~b~Varrio Los Aztecas", 3000, 3);
    ApplyAnimation(playerid,"RIOT", "RIOT_ANGRY",4.0,1,1,1,1,1);
    }
    case 12..15:
    {
    SetPlayerPos(playerid, 1022.6276,-1122.8153,23.8710);
    SetPlayerCameraPos(playerid, 1022.6276,-1126.8105,23.8696);
    SetPlayerCameraLookAt(playerid, 1022.6276,-1122.8153,23.8710);
    SetPlayerFacingAngle(playerid, 180.0);
    GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~i~Black Hand Triads", 3000, 3);
    ApplyAnimation(playerid,"GHANDS", "gsign2LH",4.0,1,1,1,1,1);
    }
    case 16..20:
    {
    SetPlayerPos(playerid, 1191.2260,-1653.1935,13.9201);
    SetPlayerCameraPos(playerid, 1191.2260,-1656.7068,13.8446);
    SetPlayerCameraLookAt(playerid, 1191.2260,-1653.1935,13.9201);
    SetPlayerFacingAngle(playerid, 180.0);
    GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~Japanese Yakuza", 3000, 3);
    ApplyAnimation(playerid,"RIOT", "RIOT_CHANT",4.0,1,1,1,1,1);
    }
    case 21..25:
    {
    SetPlayerPos(playerid, 425.3501,-1757.3633,8.2564);
    SetPlayerCameraPos(playerid, 425.7744,-1762.9508,7.9428);
    SetPlayerCameraLookAt(playerid, 425.3501,-1757.3633,8.2564);
    SetPlayerFacingAngle(playerid, 180.0);
    GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~b~Long Beach Cripz", 3000, 3);
    ApplyAnimation(playerid,"RIOT", "RIOT_ANGRY",4.0,1,1,1,1,1);
    }
    case 26..30:
    {
    SetPlayerPos(playerid, 1552.0837,-1675.6193,16.1346);
    SetPlayerCameraPos(playerid, 1550.3044,-1675.3883,15.3475);
    SetPlayerCameraLookAt(playerid, 1552.0837,-1675.6193,16.1346);
    SetPlayerFacingAngle(playerid, 90.0);
    GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~b~Cops", 3000, 3);
    ApplyAnimation(playerid,"RIOT", "RIOT_ANGRY",4.0,1,1,1,1,1);
    }
    case 31:
    {
    SetPlayerPos(playerid, -77.8206,-1581.9557,5.5262);
    SetPlayerCameraPos(playerid, -75.7435,-1583.7396,5.3207);
    SetPlayerCameraLookAt(playerid, -77.8206,-1581.9557,5.5262);
    SetPlayerFacingAngle(playerid, 225.0);
    GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~Punks", 3000, 3);
    ApplyAnimation(playerid,"RIOT", "RIOT_ANGRY",4.0,1,1,1,1,1);
    }
    case 32..38:
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
    SetPlayerPos(playerid, 2282.4131,2423.6523,3.4766);
    SetPlayerCameraPos(playerid, 2281.9563,2428.1431,3.2734);
    SetPlayerCameraLookAt(playerid, 2282.4131,2423.6523,3.4766);
    SetPlayerFacingAngle(playerid, 270.0);
    GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~Admins", 3000, 3);
    ApplyAnimation(playerid,"RIOT", "RIOT_ANGRY",4.0,1,1,1,1,1);
    }
    case 39..41:
    {
    SetPlayerPos(playerid, 1722.3364,-1627.7446,20.2129);
    SetPlayerCameraPos(playerid, 1721.9354,-1630.9755,20.2144);
    SetPlayerCameraLookAt(playerid, 1722.3364,-1627.7446,20.2129);
    SetPlayerFacingAngle(playerid, 180.0);
    GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~o~News", 3000, 3);
    ApplyAnimation(playerid,"RIOT", "RIOT_ANGRY",4.0,1,1,1,1,1);
    }
    case 42:
    {
    SetPlayerPos(playerid, 2750.0056,-2453.5347,16.6562);
    SetPlayerCameraPos(playerid, 2747.1689,-2453.4302,16.6562);
    SetPlayerCameraLookAt(playerid, 2750.0056,-2453.5347,16.6562);
    SetPlayerFacingAngle(playerid, 90.0);
    GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Army", 3000, 3);
    ApplyAnimation(playerid,"RIOT", "RIOT_ANGRY",4.0,1,1,1,1,1);
    }
    case 43:
    {
    SetPlayerPos(playerid, 1278.5372,-810.2500,88.3151);
    SetPlayerCameraPos(playerid, 1278.9152,-800.3507,88.3151);
    SetPlayerCameraLookAt(playerid, 1278.5372,-810.2500,88.3151);
    SetPlayerFacingAngle(playerid, 0.0);
    GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~b~FBI", 3000, 3);
    ApplyAnimation(playerid,"RIOT", "RIOT_ANGRY",4.0,1,1,1,1,1);
    }
    }
    return 1;
    }
    //==============================================================================
    SetPlayerClass(playerid, classid)
    {
    switch(classid)
    {
    case 0..2: { gTeam[playerid] = TEAM_GROVE; SetPlayerTeam(playerid, TEAM_GROVE); }
    case 3..5: { gTeam[playerid] = TEAM_BALLAS; SetPlayerTeam(playerid, TEAM_BALLAS); }
    case 6..8: { gTeam[playerid] = TEAM_VAGOS; SetPlayerTeam(playerid, TEAM_VAGOS); }
    case 9..11: { gTeam[playerid] = TEAM_AZTECAS; SetPlayerTeam(playerid, TEAM_AZTECAS); }
    case 12..15: { gTeam[playerid] = TEAM_TRIADS; SetPlayerTeam(playerid, TEAM_TRIADS); }
    case 16..20: { gTeam[playerid] = TEAM_YAKUZA; SetPlayerTeam(playerid, TEAM_YAKUZA); }
    case 21..25: { gTeam[playerid] = TEAM_CRIPZ; SetPlayerTeam(playerid, TEAM_CRIPZ); }
    case 26..30: { gTeam[playerid] = TEAM_COP; SetPlayerTeam(playerid, TEAM_COP); }
    case 31: { gTeam[playerid] = TEAM_PUNK; SetPlayerTeam(playerid, TEAM_PUNK); }
    case 32..38: { gTeam[playerid] = TEAM_ADMIN; SetPlayerTeam(playerid, TEAM_ADMIN); }
    case 39..41: { gTeam[playerid] = TEAM_NEWS; SetPlayerTeam(playerid, TEAM_NEWS); }
    case 42: { gTeam[playerid] = TEAM_ARMY; SetPlayerTeam(playerid, TEAM_ARMY); }
    case 43: { gTeam[playerid] = TEAM_FBI; SetPlayerTeam(playerid, TEAM_FBI); }


    }
    }


    könnt ihr den Fehler finden?


    MfG Thomas3000

  • so?
    case 32..38:
    {
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
    SetPlayerPos(playerid, 2282.4131,2423.6523,3.4766);
    SetPlayerCameraPos(playerid, 2281.9563,2428.1431,3.2734);
    SetPlayerCameraLookAt(playerid, 2282.4131,2423.6523,3.4766);
    SetPlayerFacingAngle(playerid, 270.0);
    GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~Admins", 3000, 3);
    ApplyAnimation(playerid,"RIOT", "RIOT_ANGRY",4.0,1,1,1,1,1);
    }
    }

    526C4Hj.png Mit freundlichen Grüßen,
    Noneatme

  • Ich verstehe das mit dem Skin nicht ganz ..
    Bzw. den Schritt , mit dem Case.


    Ich weiß nicht , wie ich das dann einfügen kann , kann mir bitte jemand ein Beispiel mit LSPD machen ?
    Also , mit Spawn Position , Skin etc.


    Währe für mich sehr hilfreich , da ich mit gTeams noch nie gearbeitet habe.

  • // --------- NEW's -------------
    new gTeam[MAX_PLAYERS];


    // --------- Define's -----------
    #define LSPD 0
    #define doof 1
    #define schlau 2
    #define weisnicht 3
    #define zivi 4


    // --------- GameModeInit -----
    public OnGameModeInit()
    {
    AddPlayerClass(skinID,x, y, z, angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo) // Skin 1
    AddPlayerClass(skinID,x, y, z, angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo) // Skin 2
    AddPlayerClass(skinID,x, y, z, angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo) // Skin 3
    AddPlayerClass(skinID,x, y, z, angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo) // Skin 4
    AddPlayerClass(skinID,x, y, z, angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo) // Skin 5
    AddPlayerClass(skinID,x, y, z, angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo) // Skin 6
    AddPlayerClass(skinID,x, y, z, angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo) // Skin 7
    AddPlayerClass(skinID,x, y, z, angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo) // Skin 8
    return 1;
    }


    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, x, y, z); // Spieler Position
    SetPlayerCameraPos(playerid, x, y, z); // Kamera Position (Nicht an der stelle wo der Spieler ist)
    SetPlayerCameraLookAt(playerid, x, y, z); // Wohin die cam gucken soll


    switch(classid)
    {
    case 1,2,3,4: gTeam[playerid] = LSPD; // skin 1 bis 4 wird Team LSPD zugeteilt
    case 5: gTeam[playerid] = doof; // Skin 5 wird team doof zugeteilt
    case 6: gTeam[playerid] = schlau; // Skin 6 wird team schlau zugeteilt
    case 7: gTeam[playerid] = weisnicht; // Skin 7 wird team weisnicht zugeteilt
    default: gTeam[playerid] = zivi; // Alle übrigen skins werden den zivi's zugeteilt
    }
    return 1;
    }


    Hoffe jetzt weist du es ^^

  • Jo Danke ,


    also ist das , dass wenn man mit den Pfeilen auswählt ?
    Dann kommt , wenn man einmal auf den Pfeil geklickt hat und dann den 1. Skin auswählt , den man wie bestimmen kann ?
    Also , dass sind doch nicht die Skin Id's , oder Irre ich mich da O.o ?



    Ich blicke gerade garnicht mehr durch.
    Was davon ist nochmal Facing Angle , was brauche ich für SetPlayerPos etc. ?
    AddPlayerClass(0,1287.0403,-1239.4668,13.5901,91.2594,0,0,0,0,0,0);

    Einmal editiert, zuletzt von Act!on ()