Wie frage ich hiervon nun die Anzahl aktueller Materials ab?
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]");
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)
{
}
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);
return 1;
}
}
}
}