SA-MP Forums Archive
[Help] Problem with /buy and dialog - 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: [Help] Problem with /buy and dialog (/showthread.php?tid=293096)



[Help] Problem with /buy and dialog - xXx:FireBlade - 26.10.2011

Ok hi to all of you
I have a big problem with credit for mobile...Ok in my 24/7 i have puted a command /buy and then a dialog should start up...And everything is good and then if you want to buy credit you just enter credit it's listed there...But what i want is to set a limit like when you are buying that then you can buy max 350$ not just any number that out tipe in please help me...I hope you will soon and I'm a beginner in scripting.. Thx


Re: [Help] Problem with /buy and dialog - |_ⒾⓇⓄN_ⒹⓄG_| - 26.10.2011

post the script , that way we can edit to help u....


Re: [Help] Problem with /buy and dialog - xXx:FireBlade - 26.10.2011

I've puted this but It only says thhat You can't buy more than 350$ but you can

Код:
 {
             if(strval(inputtext) < 1) return SendClientMessage(playerid,-1,"You can't buy under than 1$ credit"),ShowPlayerDialog(playerid, 3667, DIALOG_STYLE_INPUT, "Krediti", "Type here how much credit you want to buy.", "OK", "Decline");
             if(strval(inputtext) > 350) return SendClientMessage(playerid,-1,"You can't buy more than 350$ credit"),ShowPlayerDialog(playerid, 3667, DIALOG_STYLE_INPUT, "Krediti", "Type here how much credit you want to buy.", "OK", "Decline");
         }



Re: [Help] Problem with /buy and dialog - xXx:FireBlade - 26.10.2011

Can anyone help me !


Re: [Help] Problem with /buy and dialog - ikkentim - 26.10.2011

Quote:
Originally Posted by xXx:FireBlade
Посмотреть сообщение
I've puted this but It only says thhat You can't buy more than 350$ but you can

Код:
 {
             if(strval(inputtext) < 1) return SendClientMessage(playerid,-1,"You can't buy under than 1$ credit"),ShowPlayerDialog(playerid, 3667, DIALOG_STYLE_INPUT, "Krediti", "Type here how much credit you want to buy.", "OK", "Decline");
             if(strval(inputtext) > 350) return SendClientMessage(playerid,-1,"You can't buy more than 350$ credit"),ShowPlayerDialog(playerid, 3667, DIALOG_STYLE_INPUT, "Krediti", "Type here how much credit you want to buy.", "OK", "Decline");
         }
If you enter a value of more than 350 it will say that, so what is the problem?


Re: [Help] Problem with /buy and dialog - xXx:FireBlade - 26.10.2011

The problem is that you can buy over 350 and i want to set it to max of 350!


Re: [Help] Problem with /buy and dialog - grand.Theft.Otto - 27.10.2011

Give us your /buy command please.


Re: [Help] Problem with /buy and dialog - Guest3598475934857938411 - 27.10.2011

Quote:
Originally Posted by xXx:FireBlade
Посмотреть сообщение
I've puted this but It only says thhat You can't buy more than 350$ but you can

Код:
 {
             if(strval(inputtext) < 1) return SendClientMessage(playerid,-1,"You can't buy under than 1$ credit"),ShowPlayerDialog(playerid, 3667, DIALOG_STYLE_INPUT, "Krediti", "Type here how much credit you want to buy.", "OK", "Decline");
             if(strval(inputtext) > 350) return SendClientMessage(playerid,-1,"You can't buy more than 350$ credit"),ShowPlayerDialog(playerid, 3667, DIALOG_STYLE_INPUT, "Krediti", "Type here how much credit you want to buy.", "OK", "Decline");
         }
Also suggestion: Instead of using two checks you could use one. Example:
pawn Код:
if(strval(inputtext) > 350) || (strval(inputtext) < 1) ....



Re: [Help] Problem with /buy and dialog - xXx:FireBlade - 27.10.2011

I've made it thank you!