PDA

View Full Version : [Include] [INC] Gun Holder


[nl]daplayer
09/05/2009, 03:10 PM
Gun Holder
It's an include where you can put a weapon on a players back.
For example you can put a AK74 on a players back.
Test gamemode Included!

Screens
http://i42.tinypic.com/2nkqmq1.png
http://i42.tinypic.com/n20n80.png

Functions

native SetHolderWeapon(gh_playerid, gh_weapon);
native GetHolderWeapon(gh_playerid);
native RemoveHolderWeapon(gh_playerid);


Download


Include:


http://solidfiles.com/info_imgs/fqZc.jpg (http://solidfiles.com/d/fqZc)


Test Gamemode:


CompiledSource


http://solidfiles.com/info_imgs/iweD.jpg (http://solidfiles.com/d/iweD)
http://solidfiles.com/info_imgs/YQnD.jpg (http://solidfiles.com/d/YQnD)



Bugs
Some weapons don't show right, maybe i will fix it.

Weirdosport
09/05/2009, 03:39 PM
Someone asked me about this in Scripting Discussion the other day, was it you?

RenisiL
09/05/2009, 03:52 PM
Great script

NeRoSiS
09/05/2009, 04:04 PM
It was me Weirdosport :p

Great FS, gonna try it out with a katana right away xD

Luka P.
09/05/2009, 04:10 PM
Awesome,dude!

[IB]Scorcher
09/05/2009, 04:15 PM
Looks awesome.

SpiderPork
09/05/2009, 07:28 PM
Nice, the AK47 could be used for terrorists :P.

MPKaboose
09/05/2009, 07:34 PM
I always wanted to make something like this but with a parachute what supposed to be a backpack :P nice job

NeRoSiS
09/05/2009, 07:37 PM
The Katana came out pretty nice, although I won't be using this script my self, it has taught me about attaching objects, so I thank you.

Tannz0rz
10/05/2009, 02:21 AM
http://forum.sa-mp.com/index.php?topic=97999.msg622715#msg622715
I was trying to develop something of the sort. I just couldn't get it to where it would delete the weapon when you actually pulled out said weapon.



http://hosting.reloadedgaming.com/images/lpg0263zid6h4l2cjhs.png
Oh lawd

MarcoNecroX
10/05/2009, 04:14 AM
looks kinda weird =P

btw. good work

HACKHERS
10/05/2009, 08:03 AM
When I Was Type "Holder" Notthing Hapens . Should I Change Model To Model Id?

[nl]daplayer
10/05/2009, 04:33 PM
When I Was Type "Holder" Notthing Hapens . Should I Change Model To Model Id?

Did you typed /holder?, it's in the test gamemode. Not in the include


Someone asked me about this in Scripting Discussion the other day, was it you?

No, i wasn't. I asked something about the OnPlayerText, maybe you know me from that.

HACKHERS
10/05/2009, 05:46 PM
When I Was Type "Holder" Notthing Hapens . Should I Change Model To Model Id?

Did you typed /holder?, it's in the test gamemode. Not in the include


Someone asked me about this in Scripting Discussion the other day, was it you?

No, i wasn't. I asked something about the OnPlayerText, maybe you know me from that.


I Now That I'm Tried On Test GameMode

Snyper
28/05/2009, 02:31 PM
I hope you keep working on this. I'm trying to get it to work but no luck. I type /holder either as a FS or in my GM and nothing happens.

I have my .inc in the right place and the .amx in the right place.

HB
28/05/2009, 04:41 PM
Thats genious!

miokie
28/05/2009, 05:48 PM
Good job! :D

Fay-Tony
05/06/2009, 07:10 PM
it's cool for RP servers ;)

DMSOrg
07/06/2009, 10:56 PM
not bad... good for rp

Spatman
14/08/2009, 06:57 PM
So basically the object is following you? Is it smooth when you move? I think it may cause lagg if many players does /holder ?

Spatman

ziomal396
15/08/2009, 01:25 PM
So basically the object is following you? Is it smooth when you move? I think it may cause lagg if many players does /holder ?

yes, the object follows player, but if he is in vehicle, and he drives, weapon backs little bit (temporarily).

[MF]FACE
15/08/2009, 03:00 PM
Man, i love it: I searched a long time for something like this!

Great script my friend ;)

RayPoda
16/08/2009, 02:14 AM
I've tested it and I've found out that when you're standing still the weapon is in your back a bit, is there any way to move it back a bit so its on your back perfectly when standing still?

BornToLearn
16/08/2009, 02:16 AM
Great script,good job man ;)

[nl]daplayer
16/08/2009, 03:07 AM
Thx all for your comments


I've tested it and I've found out that when you're standing still the weapon is in your back a bit, is there any way to move it back a bit so its on your back perfectly when standing still?

It's diffrent for every weapon, so it's difficult to set it right for every gun.
Maybe i will update this script so the position is diffrent for every gun, to hold it smoothly

GforceNL
16/08/2009, 10:12 AM
Hi iff planted it in my Gamemode but i get this errors:

(216) : error 047: array sizes do not match, or destination array is too small
(219) : error 047: array sizes do not match, or destination array is too small

Commands:
new cmd[128];
new idx;
cmd = strtok(cmdtext, idx);
if (!strcmp(cmd, "/holder", true))
{
cmd = strtok(cmdtext, idx);
new model = strval(cmd);
SetHolderWeapon(playerid, model);
return 1;
}
if (!strcmp(cmd, "/remove", true))
{
RemoveHolderWeapon(playerid);
return 1;
}

Its the same Commands from your Test Gamemode

nuriel8833
16/08/2009, 07:11 PM
Good work
tanks

[nl]daplayer
17/08/2009, 10:06 PM
Good work
tanks

Thx, The next update will 10x better.


Hi iff planted it in my Gamemode but i get this errors:

(216) : error 047: array sizes do not match, or destination array is too small
(219) : error 047: array sizes do not match, or destination array is too small

Commands:
new cmd[128];
new idx;
cmd = strtok(cmdtext, idx);
if (!strcmp(cmd, "/holder", true))
{
cmd = strtok(cmdtext, idx);
new model = strval(cmd);
SetHolderWeapon(playerid, model);
return 1;
}
if (!strcmp(cmd, "/remove", true))
{
RemoveHolderWeapon(playerid);
return 1;
}

Its the same Commands from your Test Gamemode


do you got the same strtok from the gamemode?
because i edited the strok a bit, because i used it for commands, so with the default strok, 128 cells are wasted.
So copy my strtok to your gamemode rename it with strtok_command or something, and edit the thing in the holder commands

In the next update there is no need of strtok, because i will use dcmd.

XCultz
18/08/2009, 02:00 AM
sweeet

Luka P.
24/10/2009, 01:26 PM
มันคือwhat


General Rules:

* SEARCH before you ask anything, most of the questions have been asked before.
* No warez (and no-cd cracks, including any of the san andreas game files or leaked content), illegal materials or pornography.
* No racism or any other forms of discrimination.
* Don't advertise. A link to a site related to the topic is fine, spamming your home page is not. This includes advertising your servers and services. However, you are allowed to put advertisements in your signature or server advertisements.
* No SPAM. If you are adding no useful information to a topic, you are spamming.
* No double posting. There is a modify button , please use it.
* English only.
* Do not insult, curse at, tease, or make offensive comments towards other members.
* Selling scripts or linking to sites that allow people to sell scripts are not allowed.
* Don't post huge scripts. Use http://pawn.pastebin.com/ instead.
* Scripts or other programmed things released on those forums MUST include all source.
* When responding to coding questions make sure your code works first.
* If someone posts a post you think is rule-breaking in some way report it and do not reply to say so.

Signature & Avatar Rules:

* Signatures can be a maximum of 250px high.
* Images in your signature and avatar can't exceed 250KB in total size.


Disclaimer: We reserve the right to alter, add or completely rewrite these rules at any time, with or without notice.
Look At General Rules, rule number 7.

Guedes747
24/10/2009, 01:35 PM
o.O This is WIN!
Awesum' Work!

[LF]Mr.Lucci
09/04/2010, 03:03 AM
This would kick arse, does anyone have this working still??

Hip-hop
09/04/2010, 05:19 AM
Very nice for rp !

MrEnd
09/04/2010, 05:42 AM
WOW nice :M

[LF]Mr.Lucci
09/04/2010, 08:07 PM
Did you guys that posted after my 1st post, actually get this to work??????

DeadalusNetwork
09/04/2010, 08:12 PM
Similar to my but I use objects.

Bleach1
10/04/2010, 06:45 AM
Damn, its awesome :)

Aleron
10/04/2010, 07:34 AM
it seems rly cool..it funny with some weapons though(dildo).:P:P:P

KeyWay
10/04/2010, 09:24 AM
Is this like.. smooth? 8)

Norn
10/04/2010, 09:37 AM
Is this like.. smooth? 8)


It's using attachobjecttoplayer so i assume it is.

Geso
10/04/2010, 09:44 AM
Can't get this working, too bad.

[LF]Mr.Lucci
11/04/2010, 11:48 AM
Can't get this working, too bad.



I can't seem to get it to work either.. :roll:

kujox32
03/05/2010, 01:57 PM
I can't get it to work O.o

[EnergY]
03/05/2010, 02:45 PM
Oo Not bad

BigM
03/05/2010, 06:25 PM
Heh that is nice,holding ak47 on players back :)

Konda
03/05/2010, 10:57 PM
look it is good and evrything but try to get in bike or something u will find it flying in ur back!! and hmm when u do it it isnt in ur back really it is in the middile of ur body!!

xenowort
03/05/2010, 11:25 PM
Oh very good!

Konda
04/05/2010, 10:59 AM
look it is good and evrything but try to get in bike or something u will find it flying in ur back!! and hmm when u do it it isnt in ur back really it is in the middile of ur body!!
is it like that or only me see it like that?

janenaiongza
14/11/2010, 02:20 PM
thank ขอบคุณมากเลยนะครับผม

GaGlets(R)
14/11/2010, 02:46 PM
OMG someone delete this?

This is frekin copy of Double o Seven who made this, or it wasnt Double - O anyway, this is just a copy which have been re-re-re-remade or something like that. :P

Double-O-Seven
14/11/2010, 02:47 PM
He made this 1.5 years before me^^

wups
14/11/2010, 03:47 PM
Also on DOS script he is using SetPlayerHoldingObject, which is a new function.

Inframan
23/12/2010, 06:27 AM
can make this code in zcmd?

HyperZ
23/12/2010, 06:32 AM
Nice job. ;)

Rihsan
23/12/2010, 07:47 AM
omg, it's fail -.-

Naruto_Emilio
22/04/2011, 01:20 PM
Nice Include :D