Hallo
Ich habe etwas in meinem Shop eingefügt, aber irgendwas überschneidet sich da und ich find den Fehler nicht
Der Befehl:
if (strcmp("/buy", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 1, 1575.2797,-1620.1421,13.5469))
{
ShowPlayerDialog(playerid, DIALOG_SHOP , DIALOG_STYLE_LIST, "Shop", "Schutzweste (800,00$)\nMedipack (1500,00$)\nM4 (1500,00$)\nSMG (1200,00$)\nDeagle (1000,00$)\nSchrotflinte (1000,00$)\nSniper (1500,00$)\nAusrüstung (500$)", "Kaufen", "Abbrechen");
....
Der Shop:
//Polizei Shop
if(dialogid == DIALOG_SHOP )
{
if(response == 0)
{
return 1;
}
if(response == 1)
{
if(listitem == 0)
{
if(GetPlayerMoney(playerid) < 800) return SendClientMessage(playerid, ROT,"Du hast nicht genug Geld!");
}
else
{
SendClientMessage(playerid,0x7AA4A6FF,"Du hast dir eine Schutzweste gekauft!");
GivePlayerMoney(playerid,-800);
return 1;
}
if(listitem == 1)
{
if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, ROT,"Du hast nicht genug Geld!");
if(GetPVarInt(playerid,"Medipack") == 1)
{
SendClientMessage(playerid,0xFF3400FF,"Du hast bereits ein Medipack!");
}
else
{
if(GetPVarInt(playerid,"Medipack") == 0)
SendClientMessage(playerid,GRÜN,"Du hast dir ein Medipack gekauft.Du kannst es mit /heal benutzen.");
SetPVarInt(playerid, "Medipack",1);
GivePlayerMoney(playerid,-1500);
}
return 1;
}
if(listitem == 2)
{
if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, ROT,"Du hast nicht genug Geld!");
}
else
{
SendClientMessage(playerid,0x7AA4A6FF,"Du hast dir eine M4 gekauft!");
GivePlayerWeapon(playerid,31,2000);
GivePlayerMoney(playerid,-1500);
return 1;
}
if(listitem == 3)
{
if(GetPlayerMoney(playerid) < 1200) return SendClientMessage(playerid, ROT,"Du hast nicht genug Geld!");
}
else
{
SendClientMessage(playerid,0x7AA4A6FF,"Du hast dir eine SMG gekauft!");
GivePlayerWeapon(playerid,29,2000);
GivePlayerMoney(playerid,-1200);
return 1;
}
if(listitem == 4)
{
if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, ROT,"Du hast nicht genug Geld!");
}
else
{
SendClientMessage(playerid,0x7AA4A6FF,"Du hast dir eine Deagle gekauft!");
GivePlayerWeapon(playerid,24,2000);
GivePlayerMoney(playerid,-1000);
return 1;
}
if(listitem == 5)
{
if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, ROT,"Du hast nicht genug Geld!");
}
else
{
SendClientMessage(playerid,0x7AA4A6FF,"Du hast dir eine Schrotflinte gekauft!");
GivePlayerWeapon(playerid,25,2000);
GivePlayerMoney(playerid,-1000);
return 1;
}
if(listitem ==6)
{
if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, ROT,"Du hast nicht genug Geld!");
}
else
{
SendClientMessage(playerid,0x7AA4A6FF,"Du hast dir eine Sniper gekauft!");
GivePlayerWeapon(playerid,34,2000);
GivePlayerMoney(playerid,-1500);
return 1;
}
if(listitem == 7)
{
if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, ROT,"Du hast nicht genug Geld!");
}
else
{
SendClientMessage(playerid,0x7AA4A6FF,"Du hast dir ein Equipment gekauft.");
SetPlayerAttachedObject(playerid,1,19142,1,0.1,0.05,0.0,0.0,0.0,0.0);//Armour
SetPlayerAttachedObject(playerid,2,19141,2,0.11,0.0,0.0,0.0,0.0,0.0);//Cask
SetPlayerAttachedObject(playerid,3,18637,13,0.35,0.0,0.0,0.0,0.0,180.0);//Shield
SetPlayerAttachedObject(playerid,4,18642,7,0.1,0.0,-0.11,0.0,-90.0,90.0);//tazer
GivePlayerMoney(playerid,-500);
return 1;
}
}
}