[FilterScript] Dynamic Dialogs: Weapons
#1

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
Reply
#2

Nice work , Keep it up...
Reply
#3

Good !
Reply
#4

Nice!
Reply
#5

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.
Reply
#6

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.
Reply
#7

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)
.
Reply
#8

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.
Reply
#9

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.
Reply
#10

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.");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)