[FilterScript] Weapon Shop (Using Arrays & Dialogs)
#1

This is a simple Weapon Shop Filterscript, the prices are based to the single player's Ammu Nation Prices. I already know that there are a lot of filterscript similar to this one, but I wanted to try something easy cause I am new to SAMP Scripting.
PS: As you can see there aren't any special weapons, I just added the weapons that you may purchase in Single Player from an Ammu Nation BUT you can add it easily by making a new array or you can change the ammo or the price of a weapon!

In order to use this Filterscript, you need:
sscanf2.inc
zcmd.inc

pastebin

Credits:
Zeex for creating the zcmd include,
****** for creating sscanf2 include,
and me of course for coding the code above.

Your opinion about this filterscript is appreciated, feel free to suggest me something to improve it.
Reply
#2

Nice for a beginner would like more from you
Reply
#3

Bravo, good job mate.
Reply
#4

Nice -- Much easier to add/remove items

Some notes/questions:
The 'weaponname' can be decreased to 32 ( i think ), because there isn't a weapon which name is longer than 32 cells
The 'string' in the dialogs should be reduced to ~128 ( from 2048 ).
Why's 'weaponprice' a string?
Reply
#5

Quote:
Originally Posted by Kyance
Посмотреть сообщение
Nice -- Much easier to add/remove items

Some notes/questions:
The 'weaponname' can be decreased to 32 ( i think ), because there isn't a weapon which name is longer than 32 cells
The 'string' in the dialogs should be reduced to ~128 ( from 2048 ).
Why's 'weaponprice' a string?
As you can see there is a string format, that is the reason of me adding that value but it may be reduced to 1024, if I make it 128 then the other parts of the dialog are not going to showup.

Also about the weapon price, it seems that I forget to remove the string.

Edit: I will try to make a dynamic version with the ammo and prices changable in game but most likely I will not success with the ammo but the prices only
Reply
#6

Quote:
Originally Posted by dionisak0s
Посмотреть сообщение
As you can see there is a string format, that is the reason of me adding that value but it may be reduced to 1024, if I make it 128 then the other parts of the dialog are not going to showup.

Also about the weapon price, it seems that I forget to remove the string.

Edit: I will try to make a dynamic version with the ammo and prices changable in game but most likely I will not success with the ammo but the prices only
Well, imo it should be fine with these sizes:
For Pistols - 66.
For MicroSMGs - 38
For Shotguns - 50
For Rifles - 32
For Assault Rifles - 30
For Thrown - 34


Anyways, good luck, but why do you think you'll fail with the ammo?

You set it like 'Pistols[0][weaponammo] = 50;'
And then 'GivePlayerWeapon(playerid, Pistols[0][weaponid], Pistols[0][weaponammo]);'
... or something like that xD
Reply
#7

easily coded, need to be more better
Reply
#8

Quote:
Originally Posted by Kyance
Посмотреть сообщение
Well, imo it should be fine with these sizes:
For Pistols - 66.
For MicroSMGs - 38
For Shotguns - 50
For Rifles - 32
For Assault Rifles - 30
For Thrown - 34


Anyways, good luck, but why do you think you'll fail with the ammo?

You set it like 'Pistols[0][weaponammo] = 50;'
And then 'GivePlayerWeapon(playerid, Pistols[0][weaponid], Pistols[0][weaponammo]);'
... or something like that xD
Well, numbers are included too so if there are 66 words and numbers somebody may increase the price and they must increase the string.
Reply
#9

Quote:
Originally Posted by dionisak0s
Посмотреть сообщение
Well, numbers are included too so if there are 66 words and numbers somebody may increase the price and they must increase the string.
Still -- Can be decreased to ~128
Reply
#10

Quote:
Originally Posted by dionisak0s
View Post
Well if I do it, the dialog might showup in this way:

Colt .45 - $200
Silenced Colt .4

That's just an example of how it might be.
No,

Code:
For Pistols - 66.
For MicroSMGs - 38
For Shotguns - 50
For Rifles - 32
For Assault Rifles - 30
For Thrown - 34
These are the "best" sizes (Well, approx.. might want to add like 10 for safety), 128 should be enough, or even still too much
Reply
#11

Quote:
Originally Posted by Kyance
View Post
No,

Code:
For Pistols - 66.
For MicroSMGs - 38
For Shotguns - 50
For Rifles - 32
For Assault Rifles - 30
For Thrown - 34
These are the "best" sizes (Well, approx.. might want to add like 10 for safety), 128 should be enough, or even still too much
You still can not understand me, numbers and spaces are included aswell so if a player wants a big price then he must change the string to a higher value but I will check it out later on with 128 as a string
Reply
#12

how to make the ammunations then?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)