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

Knife Models [XP System & Skills Support]


Post New Thread Reply   
 
Thread Tools Display Modes
xeloxded
Member
Join Date: Dec 2016
Old 07-03-2018 , 13:39   Re: Knife Models [XP System Support]
Reply With Quote #91

I got a bug, if you are CT then choose a custom knife and then you switch to TT, it will reset to your default CS knife but with your custom knife selected on menu

Edit: This does only happen because on Deathrun mode you only have a Knife as TT, it wont refresh, but if you give a TT a weapon it will give you your desired model.
Another suggestion is that Save selection has to be via Nick too, its useless if you are using your Rank System with Nick save.

Last edited by xeloxded; 07-03-2018 at 16:33.
xeloxded is offline
Supergirl
Member
Join Date: Jul 2016
Old 07-03-2018 , 17:32   Re: Knife Models [XP System Support]
Reply With Quote #92

Quote:
Originally Posted by xeloxded View Post
I got a bug, if you are CT then choose a custom knife and then you switch to TT, it will reset to your default CS knife but with your custom knife selected on menu

Edit: This does only happen because on Deathrun mode you only have a Knife as TT, it wont refresh, but if you give a TT a weapon it will give you your desired model.
Another suggestion is that Save selection has to be via Nick too, its useless if you are using your Rank System with Nick save.
The thing is (in my perspective): why would you want to save anything by nick? That doesn't make any sense to me. Isn't that even dangerous? I mean, anybody can join the server, pick your name and achieve the next rank or loose the current.
Supergirl is offline
xeloxded
Member
Join Date: Dec 2016
Old 07-03-2018 , 17:43   Re: Knife Models [XP System Support]
Reply With Quote #93

Quote:
Originally Posted by Supergirl View Post
The thing is (in my perspective): why would you want to save anything by nick? That doesn't make any sense to me. Isn't that even dangerous? I mean, anybody can join the server, pick your name and achieve the next rank or loose the current.

Ya, also SteamID is so easy to spoof on 2k18, IP is also risky, so yeah, it depends A LOT on each server, on my side, I have a pretty decent register system so yeah, Nick is secure for everyone.
xeloxded is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-04-2018 , 08:36   Re: Knife Models [XP System Support]
Reply With Quote #94

Quote:
Originally Posted by Supergirl View Post
Edit - Having some thoughts... why not having more than custom knives for both teams: why not having default knives for both teams (for this I mean when you enter the server instead of the "Default" knife, it will have 2 "Default" knives, one for TE and one for CT)? Is it possible to manage the plugin to do so?
Not sure how I'm going to do this, but I'll see what I can do. I feel like the plugin's code is going to get a lot complicated.

Quote:
Originally Posted by xeloxded View Post
I got a bug, if you are CT then choose a custom knife and then you switch to TT, it will reset to your default CS knife but with your custom knife selected on menu

Edit: This does only happen because on Deathrun mode you only have a Knife as TT, it wont refresh, but if you give a TT a weapon it will give you your desired model.
Yup, just tested with a plugin that removes weapons on spawn, same thing happened. This is actually a bug from the hamsandwich module, looks like the function doesn't get called quickly enough to detect that the weapon was removed. Fixed (update the .sma file).

@HamletEagle - I'm switching back to using CurWeapon instead of Ham_Deploy because of this problem. I experienced something simillar in another plugin. I'll need to use a task in order to prevent it, but that doesn't feel right, so I prefer CurWeapon.

Quote:
Originally Posted by xeloxded View Post
Another suggestion is that Save selection has to be via Nick too, its useless if you are using your Rank System with Nick save.
Better not mention that you're using a non-steam server here.
__________________

Last edited by OciXCrom; 07-04-2018 at 08:36.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Supergirl
Member
Join Date: Jul 2016
Old 07-04-2018 , 22:01   Re: Knife Models [XP System Support]
Reply With Quote #95

Quote:
Originally Posted by OciXCrom View Post
Not sure how I'm going to do this, but I'll see what I can do. I feel like the plugin's code is going to get a lot complicated.
No hurries, mate!
Supergirl is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-07-2018 , 05:55   Re: Knife Models [XP System Support]
Reply With Quote #96

Quote:
Yup, just tested with a plugin that removes weapons on spawn, same thing happened. This is actually a bug from the hamsandwich module, looks like the function doesn't get called quickly enough to detect that the weapon was removed. Fixed (update the .sma file).

@HamletEagle - I'm switching back to using CurWeapon instead of Ham_Deploy because of this problem. I experienced something simillar in another plugin. I'll need to use a task in order to prevent it, but that doesn't feel right, so I prefer CurWeapon.
What bug are you talking about? Can you post a simple plugin that reproduces the said bug?
Also know that hamsandwich module can't have bugs, it just hooks functions from the game dll.
__________________

Last edited by HamletEagle; 07-07-2018 at 06:44.
HamletEagle is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-07-2018 , 08:07   Re: Knife Models [XP System Support]
Reply With Quote #97

Actually, I just tested it again and I think the problem is from fakemeta, not hamsandwich. Here's the code that won't work:

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <hamsandwich>

#if !defined m_pPlayer
    #define m_pPlayer 41
#endif

#define V_MODEL "models/iplaydr/v_knife20.mdl"
#define P_MODEL "models/iplaydr/p_knife20.mdl"

public plugin_init()
{
    
register_plugin("PluginName""1.0""OciXCrom")
    
RegisterHam(Ham_Spawn"player""OnPlayerSpawn"1)
    
RegisterHam(Ham_Item_Deploy"weapon_knife""OnKnifeDeploy"1)
    
//register_event("CurWeapon", "OnKnifeDeploy", "be", "1=1", "2=29")
}

public 
plugin_precache()
{
    
precache_model(V_MODEL)
    
precache_model(P_MODEL)
}

public 
OnPlayerSpawn(id)
{
    if(
is_user_alive(id))
    {
        
strip_user_weapons(id)
        
give_item(id"weapon_knife")
    }
}    

public 
OnKnifeDeploy(iEnt)
{
    new 
id pev(iEntpev_owner)
    
//new id = get_pdata_cbase(iEnt, 41, 5)
    
client_print(0print_chat"id is %i"id)
    
set_pev(idpev_viewmodel2V_MODEL)
    
set_pev(idpev_weaponmodel2P_MODEL)

This happens only if the weapons are removed on spawn.
The same code will work without problems if we use the CurWeapon event instead.

With the testing I just did, I found that using pev(iEnt, pev_owner) to get the player's id returns 0 which is why the models isn't set. It returns the correct id however if the weapons aren't removed on spawn.

Getting the id with get_pdata_cbase(iEnt, 41, 5) returns the correct value and the model is set.
__________________

Last edited by OciXCrom; 07-07-2018 at 08:13.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-07-2018 , 13:29   Re: Knife Models [XP System Support]
Reply With Quote #98

Then there is no bug. pev_owner is not set at that point, this is why you must use m_pPlayer offset to retrieve the player index.
So please switch back to ItemDeploy and use m_pPlayer instead of pev_owner.
__________________
HamletEagle is offline
Old 07-07-2018, 13:48
OciXCrom
This message has been deleted by OciXCrom.
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-07-2018 , 15:06   Re: Knife Models [XP System Support]
Reply With Quote #99

Quote:
Originally Posted by HamletEagle View Post
Then there is no bug. pev_owner is not set at that point, this is why you must use m_pPlayer offset to retrieve the player index.
So please switch back to ItemDeploy and use m_pPlayer instead of pev_owner.
Done.

PS: if you want to have a look and approve this one as well, since it uses pretty much the same code.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
CzechPeter
New Member
Join Date: Jul 2018
Old 07-11-2018 , 12:17   Re: Knife Models [XP System Support]
Reply With Quote #100

Code:
"L 07/11/2018 - 18:15:16: [AMXX] Run time error 10: native error (native "clamp")
L 07/11/2018 - 18:15:16: [AMXX]    [0] yb983cxt.sma.p::use_vault (line 677)
L 07/11/2018 - 18:15:16: [AMXX]    [1] yb983cxt.sma.p::ReadData (line 452)
L 07/11/2018 - 18:15:16: [AMXX] Displaying debug trace (plugin "crx_ranksystem.amxx", version "unknown)"
Please help
CzechPeter 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 00:55.


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