how i put more that 1 value in dialog style input - 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)
+--- Thread: how i put more that 1 value in dialog style input (
/showthread.php?tid=423694)
how i put more that 1 value in dialog style input -
omidi - 18.03.2013
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
Re: how i put more that 1 value in dialog style input -
mastermax7777 - 18.03.2013
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
Re: how i put more that 1 value in dialog style input -
omidi - 18.03.2013
it wont add its says u dont have any gold D:
Re: how i put more that 1 value in dialog style input -
mastermax7777 - 19.03.2013
oh yea.. change number = strval(HasGold[playerid]);
to
number = strval(inputtext);