Wieso kann man hier mehr als 20 mats kaufen???
if(strcmp(cmd, "/materials1", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GOLD, "____________________________|Warenhilfe|____________________________");
SendClientMessage(playerid, COLOR_WHITE, "Benutzung: /materials [Aktion] [Anzahl]");
SendClientMessage(playerid, COLOR_WHITE, "*get [LS], *deliver [Unterschiedlich] Anzahl[Die du dabei hast]");
SendClientMessage(playerid, COLOR_GOLD,"__________________________________________________________________");
return 1;
}
if(strcmp(tmp,"get",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GOLD, "____________________________|Warenhilfe|____________________________");
SendClientMessage(playerid, COLOR_WHITE, "Benutzung: /materials [Aktion] [Anzahl]");
SendClientMessage(playerid, COLOR_WHITE, "Du hast die Anzahl vergessen");
SendClientMessage(playerid, COLOR_GOLD,"__________________________________________________________________");
return 1;
}
if(PlayerInfo[playerid][pBootsmann] >= 20)
{
}
else if(PlayerInfo[playerid][pBootsmann] <= 20)
{
new message[128];
new menge;
menge = strval(tmp);
new preis = menge*50;
if(menge < 1 || menge > 20) { SendClientMessage(playerid, COLOR_GREY, "Du kannst maximal 20 Pakete mitnehmen !"); return 1; }
GivePlayerMoney(playerid,-preis);
PlayerInfo[playerid][pBootsmann] += menge;
format(message, sizeof(message), "* Du hast %d Materials Pakete für $%d gekauft.", menge, preis);
SendClientMessage(playerid,WHITE,message);
}
}
if(strcmp(tmp,"Anzahl",true) == 0)
{
new message[128];
format(message, sizeof(message), "* Du hast %d Materials", PlayerInfo[playerid][pBootsmann]);
SendClientMessage(playerid,WHITE,message);
return 1;
}
}
}
}
Ich habe schon fast alles Probiert aber ich finde keien Lösung?