Wie kann man spawnwaffen für bestimmte fraktionen einfügen kann pls jemand vorschreiben danke
MfG
Wie kann man spawnwaffen für bestimmte fraktionen einfügen kann pls jemand vorschreiben danke
MfG
OnPlayerSpawn
if(gTeam[playerid] == TEAM_COPS)
{
GivePlayerWeapon(playerid,24,5);
}
hast du gf?
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
ich habe loh wo muss ich es im gamemod einfügen?
Das mit public GivePlayerWeapons(playerid)
Ganz unten ins Script
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.
ein public musst do forwarden.
sprich forward GivePlayerWeapons(playerid); ganz oben im Script machen.
es muss GivePlayerWeapon heißen
nicht GivePlayerWeapons
dann kommt das
G:\gta sa server\gamemodes\loH.pwn(43309) : error 030: compound statement not closed at the end of file (started at line 43293)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
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;
}
Danke !!!!!
es funkitonier kann man auch bei pmember mehrere eintragen ?
oder nur eine?
Warum so kompliziert? hast du irgendwo add PlayerClass?
AddPlayerClass(playerClass[i], 1958.3783, 1343.1572, 15.3746, 269.1425, 0/*waffe*/, 0/*munni*/, 0/*waffe*/, 0/*munni*/, 4/*waffe*/, 0/*munni*/);
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 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
Du musst natürlich bei OnPlayerSpawn die Funktion aufrufen. Einfach GivePlayerWeapons(playerid); einfügen
edît: schreibfehler