Guten Abend,
ich sitze gerade an meinem /cheackweapon Befehl habe jedoch ein Problem, mit dem auslesen der Waffen, hier mal der Code.
ocmd:acheckgun(playerid,params[])
{
new pID,string[64],index = 0;
if(!isPlayerAnAdmin(playerid,3))return SendClientMessage(playerid,COLOR_GRAU,"Diesen Befehl darfst du nicht benutzen.");
if(sscanf(params,"u",pID))return SendClientMessage(playerid,COLOR_WEIS,"Benutzung: /acheckgun [ID/Teilname]");
if(!IsPlayerConnected(pID))return SendClientMessage(playerid,COLOR_WEIS,"Der angegebene Spieler ist nicht online.");
if(IsPlayerNPC(pID))return SendClientMessage(playerid,COLOR_WEIS,"Du kannst einen NPC nicht auf Waffen überprüfen lassen.");
new waffe,muni;
format(string,sizeof(string),"[_____Waffen von %s_____]",SpielerName(pID));
SendClientMessage(playerid,COLOR_BLAU,string);
for(new i=0;i<13;i++)
{
GetPlayerWeaponData(pID,i,waffe,muni);
if(waffe != 0)
{
format(string,sizeof(string)," %i: %s %i Munition",i,SpielerWaffenName(waffe),muni);
SendClientMessage(playerid,COLOR_GRAU,string);
index++;
}
}
if(index == 0)return SendClientMessage(playerid,COLOR_GRAU,"Der Spieler hat keine Waffen.");
return 1;
}
stock SpielerWaffenName(waffenid)
{
new string[64];
format(string,sizeof(string),"%s",WeaponName[waffenid]); //ANDEREN RESTLICHEN ERRRORS
return string;
}
OnGameModeInIt
new WeaponName[][] =
{
"Faust","Schlagring","Golfschläger","Schlagstock","Messer","Baseballschläger","Schaufel","Billiard-Cue","Katana","Kettensäge",
"Dildo","Vibrator","Vibrator","Dildo","Blumen","Stock","Granate","Tränengas","Molotow Coctail","NONE","NONE","NONE",
"9mm Pistole","SDPistole","Deagle","Shotgun","Sawn-Off Shotgun","Combat Shotgun","Micro Uzi","MP5","AK47","M4","Tec9",
"Rifle","Sniper","RPG","Raketenwerfer","Flammenwerfer","Minigun","Rucksackbomben","Detonator","Sprühdose","Feuerlöscher",
"Kamera","Nachtsichtgerät","Infrarotsichtgerät","Fallschirm","Fake Pistole","Fahrzeug","Rotor","Explosion","Selbstmord","Fall in den Tod"
}; /ERROR 1
Error 1: C:\Users\Marlon\Desktop\Selfmade\pawno\hgjh.pwn(113) : warning 204: symbol is assigned a value that is never used: "WeaponName"
Andere restliche Errors: C:\Users\Marlon\Desktop\Selfmade\pawno\hgjh.pwn(957) : error 017: undefined symbol "WeaponName"
C:\Users\Marlon\Desktop\Selfmade\pawno\hgjh.pwn(957) : warning 215: expression has no effect
C:\Users\Marlon\Desktop\Selfmade\pawno\hgjh.pwn(957) : error 001: expected token: ";", but found "]"
C:\Users\Marlon\Desktop\Selfmade\pawno\hgjh.pwn(957) : error 029: invalid expression, assumed zero
C:\Users\Marlon\Desktop\Selfmade\pawno\hgjh.pwn(957) : fatal error 107: too many error messages on one line