SA-MP Forums Archive
Any way - 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: Any way (/showthread.php?tid=609175)



Any way - Nin9r - 09.06.2016

Hi !

I have /sellcar <playerid> <amount> to sell a car but some players when want to buy, they lie the seller to type something like /sellcar adolf 19 000 000. Then, the car will be sold just with 19$. How can I stop it? Can I detect somehow when he's typing like that?


Re: Any way - justjamie - 09.06.2016

Show us your sellcar command.

Do you have sscanf?


Re: Any way - Vince - 09.06.2016

Really, I'd just ban those asshats for exploiting the system. Use a confirmation dialog and/or set a minimum price.


Re: Any way - justjamie - 09.06.2016

Quote:
Originally Posted by Vince
Посмотреть сообщение
Really, I'd just ban those asshats for exploiting the system. Use a confirmation dialog and/or set a minimum price.
isn't it easyer to use sscanf and check for 2 inputs, if it's more, just put a error.


Re: Any way - Sjn - 09.06.2016

Quote:
Originally Posted by justjamie
Посмотреть сообщение
isn't it easyer to use sscanf and check for 2 inputs, if it's more, just put a error.
Even if there's sscanf used, problem will still be the same if the seller writes both the player name and amount. The price amount should not be desirable in this case.

I'd say, create an array to hold specific prices for the vehicle depending on their model. So, seller just have to type /sellcar <name> and the price can be fetched.