SA-MP Forums Archive
Script question - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Script question (/showthread.php?tid=287405)



Script question - Tye Huntley - 03.10.2011

Hey,

I have a houseupgrade command, but when I do it in game it does not work.

Код:
	}
	if(strcmp(cmd, "/houseupgrade", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(PlayerInfo[playerid][pHouseAccepted] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   You don't own a house!");
	            return 1;
	        }
		    else
		    {
			    ShowPlayerDialog(playerid,UPGRADEMENU1,DIALOG_STYLE_LIST,string,"House Interior Upgrade\nHouse Car Upgrade\nHouse Nametag Upgrade\nHouse Miscellaneous Upgrade","Proceed","Cancel");
			    return 1;
			}
		}
	 	return 1;
	}
That is my code, could someone please tell me why it does not work.


Re: Script question - TheLazySloth - 03.10.2011

ShowPlayerDialog(playerid,UPGRADEMENU1,DIALOG_STYL E_LIST,string,"House Interior Upgrade\nHouse Car Upgrade\nHouse Nametag Upgrade\nHouse Miscellaneous Upgrade","Proceed","Cancel");

1. What is the string?
2. Can you post the code under the callback OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])

Also this is the wrong section, next time post in the Script Discussion forum.


Re: Script question - Tye Huntley - 03.10.2011

Код:
}
	if(dialogid == UPGRADEMENU1) //UpgradeHouse main menu
	{
	    if(response)
	    {
	        switch(listitem)
	        {
	            case 0:
	            {
                    DisplayDialogForPlayer(playerid, 59);
	            }
	            case 1:
	            {
	                ShowPlayerDialog(playerid,UPGRADEMENU3,DIALOG_STYLE_LIST,"Car Upgrade","Clover		$40,000\nMower		$12,000\nTractor		$20,000\nFaggio		$15000\nWayfarer	$20,000\nBF-400		$55000\nFreeway	$45,000\nQuad		$40,000\nSentinel	$45,000\nStretch		$50,000\nVoodoo		$45,000\nTaxi		$45,000\nCabbie		$40,000\nPremier	$46,000\nWashington	$55000\nBuffalo		$50,000\nBanshee	$900,000\nHotknife	$13,0000\nRomero	$38,000\nAdmiral		$39000\nNext","Proceed","Cancel");
	            }
	            case 2:
	            {
	                ShowPlayerDialog(playerid,UPGRADEMENU5,DIALOG_STYLE_INPUT,"Nametag Upgrade","You can adjust the nametag of your house depending on what you want to roleplay\nhere are some nametag examples: House, Shack, Apartment, Mansion.","Confirm","Cancel");
	            }
	            case 3:
	            {
	                ShowPlayerDialog(playerid,UPGRADEMENU6,DIALOG_STYLE_LIST,"Miscellaneous Upgrade","Alarm System		$50,000\nNitrous Oxide (2x)	$10,000\nNitrous Oxide (6x)	$25,000\nCustom License Plate	$35,000\nVehicle Lock		$15,000","Proceed","Cancel");
	            }
	        }
			return 1;
		}
	}
Where do I find the string? I am not super advanced in scripting and dont know all the terms I just edit.


Re: Script question - TheLazySloth - 03.10.2011

K that looks fine... unless those dialogs arnt working...

Okay so for the first dialog replace string with "House Upgrades" and your script may work.

Since string doesn't appear to be anything...


Re: Script question - Tye Huntley - 03.10.2011

Can you show me when I change
Код:
ShowPlayerDialog(playerid,UPGRADEMENU1,DIALOG_STYLE_LIST,string
into
Код:
ShowPlayerDialog(playerid,UPGRADEMENU1,DIALOG_STYLE_LIST,HouseUpgrades
or
Код:
ShowPlayerDialog(playerid,UPGRADEMENU1,DIALOG_STYLE_LIST,House Upgrades
It does not compiles properly.


Re: Script question - GrimR - 03.10.2011

The code you posted in OP doesn't do anything except send messages...


Re: Script question - TheLazySloth - 03.10.2011

ShowPlayerDialog(playerid,UPGRADEMENU1,DIALOG_STYL E_LIST,"House Upgrades","House Interior Upgrade\nHouse Car Upgrade\nHouse Nametag Upgrade\nHouse Miscellaneous Upgrade","Proceed","Cancel");

Note: On this forum for some reason it added an unneeded space between the L and the E in DIALOG_STYLE_LIST, you may want to fix that after copy&pasting.

@GrimR What?


Re: Script question - GrimR - 03.10.2011

Referring to orignal post by original poster, it's obvious it doesn't actually do much lol.


Re: Script question - TheLazySloth - 03.10.2011

@GrimR Actually it is acting like a directory, it gives the players options to choose from to be more organized instead of having one big list...


Re: Script question - Tye Huntley - 03.10.2011

Its like an SIUMENU for a diolog to change clothes this one just allows you to pick waht catagory you wwant whether it be vehicles, misc ect.