[FilterScript] Weapon Holdster script [0.3c]
#1

Hey everyone!
I've decided to make an weapon holdster script for SA:MP version 0.3c.

Info
You can have 3 weapons. An "Throw Weapon", an "Melee Weapon" and an "Big Weapon".
The "Throw Weapon" is an weapon that you can throw away :P (stuff like grenade's).
The "Melee Weapon" is a weapon like an knife, or an handpistol. The "Big Weapon" is... a big weapon
You have all the weapons on your body when you're NOT using it. When you're using the weapon, it will be removed from your body. So you're getting it... (sorry for my bad English man).
CURRENT VERSION: 2.0

Screens
Gonna re-make them soon

Download
Link down! I'll reupload it ASAP

Installation
Just copy all the files to your SA:MP server folder.
It contains the following folders+folders:
Code:
filterscripts/
filterscripts/RPWepHoldster.amx
filterscripts/RPWepHoldster.pwn

pawno/
pawno/include/
pawno/include/a_samp.inc
pawno/include/dini.inc

scriptfiles/
scriptfiles/RP_Kwarde/
scriptfiles/RP_Kwarde/WP_Holdster/
All the player's information will be saved into 'scriptfiles/RP_Kwarde/WP_Holdster/' with the name: "{PLAYERNAME}.whsinf"

Other
* It is better if you copy content of the code into your gamemode.
* I didn't include an buyweapon command. You need to make this yourself
* THIS WILL ONLY WORK IN SAMP 0.3c AND HIGHER!

Credits
* Dracoblue : Dini include [www.dracoblue.net]
* Slice : Hold Studio filterscript [https://sampforum.blast.hk/showthread.php?tid=182317]
* Kwarde (me) : The script itself


Go and enjoy it (if you like the script).

- Kevin
Reply
#2

Nice job. I'll use it for my server.
Reply
#3

Didn't worked for me... I've tried as FS and in my code... nothing happend, only the file was created. but the hold is not working =(
Reply
#4

Line 11 and 12 of the script:
Quote:

You can't buy weapons in this script. You need to make that yourself!
You can put this in your GM, for example.

Have you done that? because it worked fine for me
Whatever I'm gonna make soon three functions: SetMelee(playerid, meleeweapon, meleeammo);. SetThrow(playerid, throwweapon, throwammo); and SetBig(playerid, bigweapon, bigammo);

and @leeroy:
Okay - with or without credits? you don't need to it, but don't add credits for yourself!

- Kevin
Reply
#5

doesnt work?
Reply
#6

Yeah, i've added one cmd that give me weapons. Check my cmd:
pawn Code:
if(strcmp(cmd, "/guns", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            GetPlayerName(playerid, sendername, sizeof(sendername));
            if(PlayerInfo[playerid][pAdmin] >= 2)
            {
                format(string, sizeof(string), "You've got guns.", sendername);
                GivePlayerWeapon(playerid, 24, 93);
                GivePlayerWeapon(playerid, 29, 532);
                GivePlayerWeapon(playerid, 31, 456);
            }
            else
            {
            SendClientMessage(playerid, COLOR_GRAD1, "   You can't use that cmd!");
            }
        }
        return 1;
    }
Reply
#7

if i set my skin a grandpa will have the holded weapons above no?
Reply
#8

Quote:
Originally Posted by Gavibro
View Post
if i set my skin a grandpa will have the holded weapons above no?
what?
Reply
#9

Ej Matheuzino. It's almost good. But you need also to set the strings. Sorry man I forgot that all to say. Whatever in my real life I've got a job. I'm busy with that. I'll TRY to make a mini gamemode with examples. But er, here's an example of a better command :P

pawn Code:
if(!strcmp(cmdtext, "/guns", true))
{
    ResetPlayerWeapons(playerid);
    pWepHolster[playerid][pThrowW] = 16;
    pWepHolster[playerid][pMeleeW] = 24;
    pWepHolster[playerid][pBigW] = 31;
    pWepHolster[playerid][pThrowA] = 4;
    pWepHolster[playerid][pMeleeA] = 350;
    pWepHolster[playerid][pBigA] = 1500;
    GivePlayerWeapon(playerid, 16, 4);
    GivePlayerWeapon(playerid, 24, 350);
    GivePlayerWeapon(playerid, 31, 1500);
    SetPlayerArmedWeapon(playerid);
    return 1;
}
And now listen up. After using that command (if you've added it), you have to do this: You have to loop through all your weapons. You have 'unarmed' (fists). Then press 'NEXT WEAPON' button. Repeat this untill you have unarmed again. You'll have the weapons on your body

And I think now. Maybe it's automatic too, with this command . Just try it out (I don't have much time 'cuz of my real-life job and the accu of my notebook is almost empty :P)

- Kevin

p.s.
Sunday, I'll make a mini gamemode, so you can use this script on a WORKING way, with extra functions!
Thanks for waiting, in advance.
Reply
#10

Quote:
Originally Posted by Kwarde
View Post
pawn Code:
if(!strcmp(cmdtext, "/guns", true))
{
    ResetPlayerWeapons(playerid);
    pWepHolster[playerid][pThrowW] = 16;
    pWepHolster[playerid][pMeleeW] = 24;
    pWepHolster[playerid][pBigW] = 31;
    pWepHolster[playerid][pThrowA] = 4;
    pWepHolster[playerid][pMeleeA] = 350;
    pWepHolster[playerid][pBigA] = 1500;
    GivePlayerWeapon(playerid, 16, 4);
    GivePlayerWeapon(playerid, 24, 350);
    GivePlayerWeapon(playerid, 31, 1500);
    SetPlayerArmedWeapon(playerid);
    return 1;
}
Help me! where can i put that code? and line?
Thanks
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)