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
  • public GivePlayerWeapons(playerid)
    {
    //SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1); // 1 ist das level 1 999 ds nur wen du es willst ;)


    if (PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
    {
    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;
    }


    Viel Glück ;)


    //Edit was ausgeklammert

  • dann kommt das



    G:\gta sa server\gamemodes\loH.pwn(43290) : warning 235: public function lacks forward declaration (symbol "GivePlayerWeapons")
    G:\gta sa server\gamemodes\loH.pwn(43308) : error 030: compound statement not closed at the end of file (started at line 43292)
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    1 Error.

  • es muss GivePlayerWeapon heißen
    nicht GivePlayerWeapons

  • Das ist ne eigene Funktion und kann daher auch GivePlayerWeapons heißen.


    stock GivePlayerWeapons(playerid)
    {
    //SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1); // 1 ist das level 1 999 ds nur wen du es willst ;)


    if (PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
    {
    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;
    }

  • Da wäre das Problem das er GF verwendet... Ich würd einfach OnPlayerSpawn das Team abfragen und dann Waffen geben (so wie die 1. Antwort es zeigt)
    edit: klar du kannst natrülich noch mehr Teams zur Abfrage hinzufügen. Ist ja nur ein Beispiel

  • forward GivePlayerWeapons(playerid);


    public GivePlayerWeapons(playerid)
    {
    SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1); // 1 ist das level 1 999


    if (PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
    {
    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;
    }


    sorry habe vergessen das forward einzutragen :D jetzt müsste es gehen kannst aber auch unter OnPlayerSpawn machen so


    GivePlayerWeapon(playerid,29,900);//das wer jetzt z.B eine M4 31 ist die id 900 die muni


    MFG Hoffe ich konnte helfen

  • Keine Errors ich eghe ingame sind aber net drin



    stock GivePlayerWeapons(playerid)
    {
    if (PlayerInfo[playerid][pMember] == 5,6,7,13,14,15,16,17,18,19,20 || PlayerInfo[playerid][pLeader] == 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;
    }

  • darfst kein komma musst
    so fortfahren
    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



    usw...

  • oder mit switch:



    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;
    }
    oder so ähnlich ^^

  • jetzt siehts so aus


    die sachen sind trotzdem net drin






    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;
    }



    wenns falsch is pls einmal richtig mit allen ids posten danke