Hi breadfish,
habe dabei ein Problem:
if(strcmp(cmd, "/gettrash", true) == 0)
{
//new cashmade;
new tmpcar;
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] < 17 && PlayerInfo[playerid][pMember] > 17 || PlayerInfo[playerid][pLeader] < 17 && PlayerInfo[playerid][pLeader] > 17)
{
SendClientMessage(playerid, COLOR_GRAD1, " Du bist kein Mitglied der Müllabfuhr / Ordnungsamt !");
return 1;
}
tmpcar = GetPlayerVehicleID(playerid);
if(IsAMuelliCar(tmpcar))
{
GameTextForPlayer(playerid, "~r~Du bist in keinem Muellwagen", 5000, 1);
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /gettrash [nummer]");
return 1;
}
for(new i = 0; i < sizeof(BizzInfo); i++)
{
if(IsPlayerInRangeOfPoint(playerid,10, BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
{
new amount;
tmp = strtok(cmdtext, idx);
amount = strval(tmp);
new cost;
cost = BizzInfo[i][bEntranceMuell] * amount;
//printf("Found House :%d",i);
if(amount > BizzInfo[i][bMuell])
{
SendClientMessage(playerid, COLOR_RED, "Bitte verwende einen niedrigeren Wert");
return 1;
}
if(BizzInfo[i][bMuell] <= 0)
{
GameTextForPlayer(playerid, "~r~Dieses Bizz hat keinen Muell mehr", 5000, 1);
//format(string, sizeof(string), "Cash Earned %d$.", cashmade);
SendClientMessage(playerid, TEAM_COLOR_ID_15, string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
if(cost > BizzInfo[i][bTill])
{
GameTextForPlayer(playerid, "~r~Wir können uns das nicht leisten", 5000, 1);
return 1;
}
BizzInfo[i][bMuell] -= amount;
SetPVarInt(playerid, "ConsumingMoney", 1);
GivePlayerMoney(playerid,cost);
BizzInfo[i][bTill] -= cost;
format(string,sizeof(string), "Du hast dir für %d kg Müll %d$ verdient.",amount,cost);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else
{
GameTextForPlayer(playerid, "~r~To Far From A Business", 5000, 1);
return 1;
}
}
for(new i = 0; i < sizeof(SBizzInfo); i++)
{
if(PlayerToPoint(playerid, 10, SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
{
new amount;
tmp = strtok(cmdtext, idx);
amount = strval(tmp);
new cost;
cost = SBizzInfo[i][sbEntranceMuell] * amount;
//printf("Found House :%d",i);
if(amount > SBizzInfo[i][sbMuell]) {
SendClientMessage(playerid, COLOR_RED, "Bitte verwende einen niedrigeren Wert");
return 1;
}
if(SBizzInfo[i][sbMuell] <= 0)
{
GameTextForPlayer(playerid, "~r~Dieses Bizz hat keinen Müll mehr", 5000, 1);
//format(string, sizeof(string), "Cash Earned $%d.", cashmade);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
if(cost > SBizzInfo[i][sbTill])
{
GameTextForPlayer(playerid, "~r~Wir können uns das nicht leisten", 5000, 1);
return 1;
}
SBizzInfo[i][sbMuell] -= amount;
SetPVarInt(playerid, "ConsumingMoney", 1);
GivePlayerMoney(playerid,cost);
SBizzInfo[i][sbTill] -= cost;
format(string,sizeof(string), "Du hast dir für %d kg Müll $%d verdient.",amount,cost);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else
{
GameTextForPlayer(playerid, "~r~To Far From A Business", 5000, 1);
return 1;
}
}
}
GameTextForPlayer(playerid, "~r~To Far From A Business", 5000, 1);
return 1;
}