how i put more that 1 value in dialog style input
#1

hello
in game mode has a bag and current value like u got gold and u want to put it in the bag
so in game u do something and get gold , HasGold[playerid]
and
InBagGold[playerid]
so in deafult it add 1 value and if u got like 10 gold it will be anoying to every time to bring bag dialog to save golds in bag

Код:
	        if(listitem == 6) // gold
	        {
	         
			ShowPlayerDialog(playerid, PUTGOLD, DIALOG_STYLE_INPUT, "enter value of old ", "add number here", "Confirm", "Cancel");
		
				return 1;
			}
Код:
	if(dialogid == PUTGOLD) /// put gold
	{
	  if(response)
		{
		 new number;
			number = strval(HasGold[playerid]);
			if(number == 0)
				{
			       SendClientMessage(playerid,COLOR_ERROR,"u havenyt gold ");
	                return 1;
				}
				(HasGold[playerid]number --); // orginal code is HasGold[playerid] --; its dicrease ur value of gold 
				(HasPackGold[playerid]number ++); // HasPackGold[playerid] ++;         its only add one value of bag
				SendClientMessage(playerid,COLOR_LIGHTBLUE,"u put %d gold in ur bag",number);
				return 1;
			}
			}
so what i want is for example u got 8 gold when dialog input comeup and u enter number 8 and it will add all value (gold) in to bag
thanks
Reply
#2

HasGold[playerid] += number;

dude, really work on ur grammer its so bad its really hard to understand what a person wants i had to really read few times
Reply
#3

it wont add its says u dont have any gold D:
Reply
#4

oh yea.. change number = strval(HasGold[playerid]);
to
number = strval(inputtext);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)