Ich wüsste nicht wo der Fehler ist, aber da.
if(strcmp(cmd, "/buy", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (!PlayerToPoint(100, playerid,-30.875, -88.9609, 1004.53))//centerpoint 24-7
{
SendClientMessage(playerid, COLOR_GRAD2, " Du bist nicht im 24/7 !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /buy [item number]");
SendClientMessage(playerid, COLOR_GREEN, "|_______ 24-7 _______|");
SendClientMessage(playerid, COLOR_GRAD1, "| 1: Cell Phone $500 2: Scratch Card $7500");
SendClientMessage(playerid, COLOR_GRAD2, "| 3: Phone Book $5000 4: Dice $500");
SendClientMessage(playerid, COLOR_GRAD3, "| 5: Vehicle Key $5000 6: Vehicle Lock $10000");
SendClientMessage(playerid, COLOR_GRAD4, "| 7: Speedometer $5000 8: Condom $50");
SendClientMessage(playerid, COLOR_GRAD5, "| 9: CD-Player $2500 10: Chicken $10 ");
SendClientMessage(playerid, COLOR_GRAD5, "| 11: Hamburger $10 12: Frozen Pizza $10");
return 1;
}
new item = strval(tmp);
if(SBizzInfo[9][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Verkauft", 5000, 1);
return 1;
}
if (item == 1 && GetPlayerMoney(playerid) > 500)
{
if(PlayerInfo[playerid][pTraderPerk] > 0)
{
new skill = 500 / 100;
new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
new payout = 500 - price;
format(string, sizeof(string), "~r~-$%d", payout);
GameTextForPlayer(playerid, string, 5000, 1);
PlayerMoney[playerid] -= payout;
SBizzInfo[9][sbTill] += payout;
ExtortionSBiz(9, payout);
}
else
{
format(string, sizeof(string), "~r~-$%d", 500);
GameTextForPlayer(playerid, string, 5000, 1);
PlayerMoney[playerid] -= 500;
SBizzInfo[9][sbTill] += 500;
ExtortionSBiz(9, 500);
}
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new randphone = 1000 + random(8999);//minimum 1000 max 9999
PlayerInfo[playerid][pPnumber] = randphone;
format(string, sizeof(string), " Du hast ein Handy mit der Nummer %d bekommen", randphone);
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_GRAD5, "Vergisst du sie kannst du sie unter /Check nachschauen");
SendClientMessage(playerid, COLOR_WHITE, "Server: Mit /Help siehst du alle Befehle.");
return 1;
}