13.02.2011, 08:54
Hey ![Smiley](images/smilies/smile.png)
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!
here is my code:
Thanks to you
![Smiley](images/smilies/smile.png)
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!
here is my code:
Код:
if (strcmp("/newveh", cmdtext, true, 7) == 0) { ShowPlayerDialog(playerid,3,DIALOG_STYLE_LIST,"Vehicles shop","Free Stuntplane\n$10.000 Sea Sparrow\n$15.000 Rustler\n$20.000 Hunter\n$25.000 Hydra","Buy", "Cancel"); return 1; }
Код:
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; }
![Wink](images/smilies/wink.png)