Was ist hier bitte sehr falsch brauche dringend Hilfe pls help!
//============= /nehmen =================//
if(strcmp(cmd, "/nehmen", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new namen[256];
namen = strtok(cmdtext, idx);
if(!strlen(namen))
{
SendClientMessage(playerid, COLOR_GOLD, "|__________________ Befehlshilfe _________________|");
SendClientMessage(playerid, COLOR_GOLD, "Benutzung: /nehmen [Name] ([Menge])");
SendClientMessage(playerid, COLOR_GOLD, "Namen: Waffe1, Waffe2, Materialien, Drogen");
return 1;
}
if(strcmp(namen,"Waffe1", true) == 0)
{
if(PlayerInfo[playerid][pInvWeapon] != 0 && PlayerInfo[playerid][pInvAmmo] != 0)
{
new gunname[100];
GetWeaponName(PlayerInfo[playerid][pInvWeapon], gunname, sizeof(gunname));
SafeGivePlayerWeapon(playerid, PlayerInfo[playerid][pInvWeapon], PlayerInfo[playerid][pInvAmmo]);
format(string, sizeof(string), " %s aus der Tasche rausgeholt.", gunname);
SendClientMessage(playerid, COLOR_GREY, string);
PlayerInfo[playerid][pInvWeapon] = 0;
PlayerInfo[playerid][pInvAmmo] = 0;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Du hast keine Waffe in deiner Tasche!");
return 1;
}
}
else if(strcmp(namen,"Waffe2", true) == 0)
{
if(PlayerInfo[playerid][pInvWeapon2] != 0 && PlayerInfo[playerid][pInvAmmo2] != 0)
{
new gunname[100];
GetWeaponName(PlayerInfo[playerid][pInvWeapon2], gunname, sizeof(gunname));
SafeGivePlayerWeapon(playerid, PlayerInfo[playerid][pInvWeapon2], PlayerInfo[playerid][pInvAmmo2]);
format(string, sizeof(string), " %s aus der Tasche rausgeholt.", gunname);
SendClientMessage(playerid, COLOR_GREY, string);
PlayerInfo[playerid][pInvWeapon2] = 0;
PlayerInfo[playerid][pInvAmmo2] = 0;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Du hast keine Waffe in deiner Tasche!");
return 1;
}
}
else if(strcmp(namen,"Drogen", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: /nehmen Drogen [Menge]");
format(string, sizeof(string), " Du hast %d Drogen in deiner Tasche.", PlayerInfo[playerid][pInvDrugs]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
new tdrugs;
tdrugs = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: /nehmen Drogen [Menge]");
format(string, sizeof(string), " Du hast %d Drogen in deiner Tasche.", PlayerInfo[playerid][pInvDrugs]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if(tdrugs > PlayerInfo[playerid][pInvDrugs])
{
SendClientMessage(playerid, COLOR_GRAD2, "So viele Drogen hast du nicht in deiner Tasche!");
return 1;
}
PlayerInfo[playerid][pInvDrugs] -= tdrugs;
PlayerInfo[playerid][pDrugs] += tdrugs;
format(string, sizeof(string), "%d Gramm Drogen aus der Tasche genommen.", tdrugs);
SendClientMessage(playerid, COLOR_GRAD4, string);
return 1;
}
else if(strcmp(namen,"Materialien", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: /nehmen Materialien [Menge]");
format(string, sizeof(string), "Du hast %d Materialien aus der Tasche genommen.", PlayerInfo[playerid][pBoxMats]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
new matss;
matss = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: /nehmen Materialien [Menge]");
format(string, sizeof(string), " Du hast %d Materialien aus der Tasche genommen.", PlayerInfo[playerid][pBoxMats]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if(matss > PlayerInfo[playerid][pInvMats])
{
SendClientMessage(playerid, COLOR_GRAD2, "So viele Materialien hast du nicht in deiner Tasche!");
return 1;
}
if(matss + PlayerInfo[playerid][pMats] > 2000)
{
SendClientMessage(playerid, COLOR_GRAD1, "Du kannst maximal 2000 Materialien tragen.");
return 1;
}
PlayerInfo[playerid][pInvMats] -= matss;
PlayerInfo[playerid][pMats] += matss;
format(string, sizeof(string), "%d Materialien aus der Tasche genommen.", matss);
SendClientMessage(playerid, COLOR_GRAD4, string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Ungültiger Name!");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Du musst dich erst einloggen!");
}
return 1;
}