SA-MP Forums Archive
Problem with a shop command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with a shop command (/showthread.php?tid=225171)



Problem with a shop command - Amator - 13.02.2011

Hey

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;
}
Thanks to you


Re : Problem with a shop command - Amator - 13.02.2011

help please!


Re : Problem with a shop command - Amator - 13.02.2011

up!!


Re : Problem with a shop command - Amator - 14.02.2011

Someone please


Re : Problem with a shop command - Amator - 14.02.2011

I've found how to fix that, thanks for you very nice help


Re: Problem with a shop command - Anteino - 14.02.2011

Fortunately you are very patient. Thumbs up!