Raised This Month: $51 Target: $400
 12% 

[CS:GO] How can I add weapon entity in map properly ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
senecas
Senior Member
Join Date: Jun 2006
Old 02-09-2014 , 23:52   [CS:GO] How can I add weapon entity in map properly ?
Reply With Quote #1

PHP Code:
stock Add_Weapon(const Float:pos[3], const String:weapon_name[])
{
        new 
iWpn CreateEntityByName(weapon_name);
        if(
IsValidEntity(iWpn))
        {
            
DispatchKeyValue(iWpn"ammo""100");
            
DispatchSpawn(iWpn);
            
TeleportEntity(iWpnposNULL_VECTORNULL_VECTOR);
        }

above code, I can spawn weapon entity,
of course ammo, clip is no problem...
but It is not right weapon. It has no recoil effect, It is just like knife.

Does Someone know how to fix this issue ?
senecas is offline
hamilton5
Veteran Member
Join Date: Oct 2012
Location: USA
Old 02-10-2014 , 03:41   Re: [CS:GO] How can I add weapon entity in map properly ?
Reply With Quote #2

here is a css weapon spawning plugin you can look at

https://forums.alliedmods.net/showthread.php?p=944597

or csgo weapon giver plugin

https://forums.alliedmods.net/showthread.php?p=1794071

Last edited by hamilton5; 02-10-2014 at 03:42.
hamilton5 is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 02-10-2014 , 08:44   Re: [CS:GO] How can I add weapon entity in map properly ?
Reply With Quote #3

Quote:
Originally Posted by hamilton5 View Post
here is a css weapon spawning plugin you can look at

https://forums.alliedmods.net/showthread.php?p=944597

or csgo weapon giver plugin

https://forums.alliedmods.net/showthread.php?p=1794071
These plugins add the weapon to the player, they dont spawn the weapon into the map.


your code looks correct to me unless you forgot some check or anything, are you sure that the contents of String:weapon_name is valid? no typo's and contains the right weapon name. (fe "weapon_usp", not CSW_USP )

also before giving the player ammo to that weapon, i think you better add in a check to make sure the weapon is not the knife, don't know if that function would error out if it was a knife but just to be safe
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]

Last edited by striker07; 02-10-2014 at 08:44.
striker07 is offline
senecas
Senior Member
Join Date: Jun 2006
Old 02-10-2014 , 23:59   Re: [CS:GO] How can I add weapon entity in map properly ?
Reply With Quote #4

Yes, classname is correct.

model, sound, clip, ammo, bullet stuff.... everything is right except recoil effect.
If I spawn weapon_awp, I can use and equip awp.
But When I fire it, there is no recoil effect(exactly, hud punching effect thing).
so I said it is like knife.

If you want to see, Test it. simple code simple work
my Os is linux, and no matter soucemod version. all has this issue.

I wonder why nobody report this issue,
this issue have existed since halloween update.

Of course, we can avoid this issue.
hooking to recive that wrong weapon, then remove & GivePlayerItem same weapons...
but it is stupid code....
senecas is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 02-11-2014 , 00:33   Re: [CS:GO] How can I add weapon entity in map properly ?
Reply With Quote #5

Have you checked all availlable key vallues for weapon ents in datamaps and netprops dump?
There might be some keyvallues you have to set yourself? (really just guessing here, you need expertise of some1 more expierenced)
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]
striker07 is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 02-11-2014 , 13:40   Re: [CS:GO] How can I add weapon entity in map properly ?
Reply With Quote #6

IIRC this is related to not having a CEConItemView for the weapon or something. I remember reading about no recoil like effect after CECon update.
Dr!fter is offline
senecas
Senior Member
Join Date: Jun 2006
Old 02-12-2014 , 20:14   Re: [CS:GO] How can I add weapon entity in map properly ?
Reply With Quote #7

is this related to sourcemod or csgo engine ?

is there any something cool solution ?
senecas is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 02-13-2014 , 12:19   Re: [CS:GO] How can I add weapon entity in map properly ?
Reply With Quote #8

Quote:
Originally Posted by senecas View Post
is this related to sourcemod or csgo engine ?

is there any something cool solution ?
CSGO related, solution is you need an extension similar to tf2items iirc

Last edited by Dr!fter; 02-13-2014 at 12:19.
Dr!fter is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode