Im triyng to make a shop command. With this, the players will be able to buy a new car. ut Ive got a problem with my system. Pawno doesn't give any error but ingame, when I go in this shop, items have no effects, niothing happens!
Код:
switch(dialogid)
{
case 1:
{
if(!response)
{
SendClientMessage(playerid, red, "You have left the shop");
return 1;
}
switch(listitem)
{
case 0:
{
new Float:X,Float:Y,Float:Z,Float:A;
new car;
GetPlayerPos(playerid,X,Y,Z);
car = CreateVehicle(513,X,Y,Z,A,3,6, 300);
PutPlayerInVehicle(playerid,car,0); // StuntPlane -- Free
}
case 1:
{
if(GetPlayerMoney(playerid) >= 10000)
{
new Float:X,Float:Y,Float:Z,Float:A;
new car;
GetPlayerPos(playerid,X,Y,Z);
car = CreateVehicle(447,X,Y,Z,A,3,6, 300);
PutPlayerInVehicle(playerid,car,0); // SeaSparrow -- $10.000
}
else
{
SendClientMessage(playerid, red, "You don't have enough cash to buy this vehicle!");
}
}
case 2:
{
if(GetPlayerMoney(playerid) >= 15000)
{
new Float:X,Float:Y,Float:Z,Float:A;
new car;
GetPlayerPos(playerid,X,Y,Z);
car = CreateVehicle(476,X,Y,Z,A,3,6, 300);
PutPlayerInVehicle(playerid,car,0); // Rustler -- $15.000
}
else
{
SendClientMessage(playerid, red, "You don't have enough cash to buy this vehicle!");
}
}
case 3:
{
if(GetPlayerMoney(playerid) >= 20000)
{
new Float:X,Float:Y,Float:Z,Float:A;
new car;
GetPlayerPos(playerid,X,Y,Z);
car = CreateVehicle(425,X,Y,Z,A,3,6, 300);
PutPlayerInVehicle(playerid,car,0); // Hunter -- $20.000
}
else
{
SendClientMessage(playerid, red, "You don't have enough cash to buy this vehicle!");
}
}
case 4:
{
if(GetPlayerMoney(playerid) >= 25000)
{
new Float:X,Float:Y,Float:Z,Float:A;
new car;
GetPlayerPos(playerid,X,Y,Z);
car = CreateVehicle(520,X,Y,Z,A,3,6, 300);
PutPlayerInVehicle(playerid,car,0); // Hydra -- $25.000
}
else
{
SendClientMessage(playerid, red, "You don't have enough cash to buy this vehicle!");
}
}
}
}
}
return 1;
}
Fortunately you are very patient. Thumbs up!