Immernoch probleme mit spawnwaffen

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
  • On PlayerSpawn sieht so aus



    public OnPlayerSpawn(playerid)
    {
    M_OnPlayerSpawn(playerid);
    TextDrawShowForPlayer(playerid,Copyright);
    TextDrawShowForPlayer(playerid,ModeName);
    SetPlayerToTeamColor(playerid);
    TextDrawShowForPlayer(playerid, Time), TextDrawShowForPlayer(playerid, Date);
    //InitLockDoors(playerid);
    STDPlayer[playerid] = 0;
    OnDuty[playerid] = 0;
    GivePlayerWeapons(playerid);
    SetPlayerArmour(playerid,0);
    gTeam[playerid] = PlayerInfo[playerid][pTeam]; //Set the Team
    if (gTeam[playerid] == 4) //medic / criminal reset team
    {
    gTeam[playerid] = 3;
    }



    und das andere so


    stock GivePlayerWeapons(playerid)
    {
    if (PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)
    if (PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)
    if (PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
    if (PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
    if (PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
    if (PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15)
    if (PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
    if (PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17)
    if (PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18)
    if (PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19)
    if (PlayerInfo[playerid][pMember] == 20 || PlayerInfo[playerid][pLeader] == 20)
    {
    GivePlayerWeapon(playerid,3,1);
    GivePlayerWeapon(playerid,29,900);
    GivePlayerWeapon(playerid,31,900);
    GivePlayerWeapon(playerid,41,900);
    GivePlayerWeapon(playerid,22,900);
    SetPlayerArmour(playerid,100.0);
    }
    return 1;
    }


    ist das richtig?

  • was Meints du mit Spawnwaffen Meints du Wenn man beim Noob Spawn Startet oder als frak?

  • Also du gehst unter


    public SetPlayerSpawn(playerid)


    so und dann Gehste ein bissen Runter
    dann kommt Sowas hier: und das von den Ganzen Gangs halt


    if (PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) //Groove Street
    {
    SetPlayerToTeamColor(playerid);
    GivePlayerWeapon(playerid, 5,1);
    GivePlayerWeapon(playerid, 22,700);
    GivePlayerWeapon(playerid, 28,400);
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 100);
    SetPlayerPos(playerid,2529.9336,-1667.4548,15.1687);
    SetPlayerInterior(playerid,0);
    PlayerInfo[playerid][pInt] = 0;
    return 1;
    }


    und hier musste halt die Waffen IDS eigen usw


    GivePlayerWeapon(playerid, WAFFENID,MUNIZON);
    GivePlayerWeapon(playerid, WAFFENID,MUNIZON);
    GivePlayerWeapon(playerid, WAFFENID,MUNIZON);


    hofffe das es Klappt^^


    Gruß Marcel


  • if (PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)
    if (PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)
    if (PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
    if (PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
    if (PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
    if (PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15)
    if (PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
    if (PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17)
    if (PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18)
    if (PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19)
    if (PlayerInfo[playerid][pMember] == 20 || PlayerInfo[playerid][pLeader] == 20)
    Klappt natürlich nicht. Du fragst ab, ob der Spieler im Team 5 ist wenn ja dann fragst du ab ob er in Team 6 ist , dann Team 7 ... Er müsste also in allen Team gleichzeitig sein.


    if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6 ||PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7) so musst du das machen. Nicht immer mit if(... neu anfangen ^^

  • so richtig ?


    stock GivePlayerWeapons(playerid)
    {
    if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6 ||PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7 || PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13 || PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14 || PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15 || PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16 || PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17 || PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18 || PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19 || PlayerInfo[playerid][pMember] == 20 || PlayerInfo[playerid][pLeader] == 20)
    {
    GivePlayerWeapon(playerid,3,1);
    GivePlayerWeapon(playerid,29,900);
    GivePlayerWeapon(playerid,31,900);
    GivePlayerWeapon(playerid,41,900);
    GivePlayerWeapon(playerid,22,900);
    SetPlayerArmour(playerid,100.0);
    }
    return 1;
    }

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • dann kommen 6 errors


    die sehen so aus


    G:\gta sa server\gamemodes\loH.pwn(43410) : error 075: input line too long (after substitutions)
    G:\gta sa server\gamemodes\loH.pwn(43410 -- 43411) : error 029: invalid expression, assumed zero
    G:\gta sa server\gamemodes\loH.pwn(43409) : error 021: symbol already defined: "M_GivePlayerWeapon"
    G:\gta sa server\gamemodes\loH.pwn(43409 -- 43414) : fatal error 107: too many error messages on one line
    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


    4 Errors.


    /edit

  • stock GivePlayerWeapons(playerid) { switch(PlayerInfo[playerid][pLeader]) { case 5,6,7,13,14,15,16,17,18,19,20: { GivePlayerWeapon(playerid,3,1); GivePlayerWeapon(playerid,29,900); GivePlayerWeapon(playerid,31,900); GivePlayerWeapon(playerid,41,900); GivePlayerWeapon(playerid,22,900); SetPlayerArmour(playerid,100.0); } } switch(PlayerInfo[playerid][pMember]) { case 5,6,7,13,14,15,16,17,18,19,20: { GivePlayerWeapon(playerid,3,1); GivePlayerWeapon(playerid,29,900); GivePlayerWeapon(playerid,31,900); GivePlayerWeapon(playerid,41,900); GivePlayerWeapon(playerid,22,900); SetPlayerArmour(playerid,100.0); } } return 1; }





    wie würde das aussehen wenn ich mehre fraks reinmacen möchte?

  • forward blabla(playerid);


    public blabla(playerid)
    {
    if(IsPlayerConnected(playerid))
    {
    new leader = PlayerInfo[playerid][pLeader];
    new member = PlayerInfo[playerid][pMember];
    if(member==5 || member==6 || member==7 || member== 13 || member== 14 || member== 15 || member== 16 || member== 17 || member== 18 || member== 19 || member== 20)
    {
    return 1;
    }
    else if(leader==5 || leader==6 || leader==7 || leader== 13 || leader== 14 || leader== 15 || leader== 16 || leader== 17 || leader== 18 || leader== 19 || leader== 20)
    {
    return 1;
    }
    }
    return 0;
    }


    public GivePlayerWeapons(playerid);
    {
    if(blabla(playerid))
    {
    GivePlayerWeapon(playerid,3,1);
    GivePlayerWeapon(playerid,29,900);
    GivePlayerWeapon(playerid,31,900);
    GivePlayerWeapon(playerid,41,900);
    GivePlayerWeapon(playerid,22,900);
    SetPlayerArmour(playerid,100.0);
    }
    return 1;
    }