SA-MP Forums Archive
[FilterScript] Dynamic Dialogs: Weapons - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Dynamic Dialogs: Weapons (/showthread.php?tid=541807)



Dynamic Dialogs: Weapons - Blunt - 14.10.2014

Dynamic Dialogs: Weapons
This system isn't exactly created specifically for any type of server,
its mainly created for educational purposes for other scripters to inherit a method of
dynamically changing variables in-game.

If you are going to use this script for your server, then I recommend it being a TDM/Stunt/Freeroam server


Features
• Ability to dynamically edit the prices of each weapon listed in the dialog
• Weapon purchases (shop)

Preview






Commands
Код:
Regular user: /weapons
RCON Admin user: /editweapons
Download
http://www.solidfiles.com/d/39e320ae2d/weapon.pwn
http://pastebin.com/MpUfcSgZ



Re: Dynamic Dialogs: Weapons - Rudy_ - 14.10.2014

Nice work , Keep it up...


Re: Dynamic Dialogs: Weapons - xWarrior - 14.10.2014

Good !


Re: Dynamic Dialogs: Weapons - Airblog - 14.10.2014

Nice!


Re: Dynamic Dialogs: Weapons - Lordzy - 14.10.2014

pawn Код:
if(GetPlayerMoney(playerid) != ak47) return ...
You might want to correct this, it checks if player's cash is not equal to the ak47 value.


Re: Dynamic Dialogs: Weapons - Blunt - 14.10.2014

Quote:
Originally Posted by Lordzy
Посмотреть сообщение
pawn Код:
if(GetPlayerMoney(playerid) != ak47) return ...
You might want to correct this, it checks if player's cash is not equal to the ak47 value.
And it returns a message to your client saying that you haven't got enough money for the item, the code is correct.


Re: Dynamic Dialogs: Weapons - Abagail - 16.10.2014

Quote:
Originally Posted by Blunt
Посмотреть сообщение
And it returns a message to your client saying that you haven't got enough money for the item, the code is correct.
So the money has to be exactly that of an AK-47? The correct code would be
pawn Код:
if(GetPlayerMoney(playerid) < ak47)
.


Re: Dynamic Dialogs: Weapons - Lordzy - 16.10.2014

Quote:
Originally Posted by Abagail
Посмотреть сообщение
So the money has to be exactly that of an AK-47? The correct code would be
pawn Код:
if(GetPlayerMoney(playerid) < ak47)
.
It should be >= (greater than or equal to) because your code checks if player's cash is lesser than ak47's cash.

EDIT : Nvm, I'm wrong. I had been thinking that it first checks the cash value and then execute, but the fact is that it directly returns with a message. However, '!=' isn't what you should've used.


Re: Dynamic Dialogs: Weapons - Kyance - 16.10.2014

Quote:
Originally Posted by Lordzy
Посмотреть сообщение
It should be >= (greater than or equal to) because your code checks if player's cash is lesser than ak47's cash.
I think Abagail's version is correct, since it checks if the players money is less than the AK-47s requested money, the players gets an message.

If it would be
if(GetPlayerMoney(playerid) >= ak47) ... then he'd have to remove the "return ...." and use it as an else statement under 'success' the code.


Re: Dynamic Dialogs: Weapons - SickAttack - 16.10.2014

Quote:
Originally Posted by Lordzy
Посмотреть сообщение
It should be >= (greater than or equal to) because your code checks if player's cash is lesser than ak47's cash.
You're wrong, it should be below than (<).

pawn Код:
if(GetPlayerMoney(playerid) < AK47) return SendClientMessage(playerid, 0xFFFFFFFF, "You don't have enough money to purchase an AK-47.");