Weapon Shop (Using Arrays & Dialogs) -
dionisak0s - 09.02.2015
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.
Re: Weapon Shop (Using Arrays & Dialogs) -
daniscape - 09.02.2015
Nice for a beginner

would like more from you
Re: Weapon Shop (Using Arrays & Dialogs) -
Alex Magaсa - 09.02.2015
Bravo, good job mate.
Re: Weapon Shop (Using Arrays & Dialogs) -
Kyance - 10.02.2015
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?
Re: Weapon Shop (Using Arrays & Dialogs) -
dionisak0s - 10.02.2015
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
Re: Weapon Shop (Using Arrays & Dialogs) -
Kyance - 10.02.2015
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
Re: Weapon Shop (Using Arrays & Dialogs) -
Rog - 10.02.2015
easily coded, need to be more better
Re: Weapon Shop (Using Arrays & Dialogs) -
dionisak0s - 10.02.2015
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.
Re: Weapon Shop (Using Arrays & Dialogs) -
Kyance - 11.02.2015
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
Re: Weapon Shop (Using Arrays & Dialogs) -
Kyance - 11.02.2015
Quote:
Originally Posted by dionisak0s
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
Re: Weapon Shop (Using Arrays & Dialogs) -
dionisak0s - 16.02.2015
Quote:
Originally Posted by Kyance
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
Re: Weapon Shop (Using Arrays & Dialogs) -
Rix70 - 31.01.2017
how to make the ammunations then?