Raised This Month: $19 Target: $400
 4% 

Solved Fixing knife disappear per new round


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nG_getwreck
Senior Member
Join Date: Oct 2020
Location: Philippines from South K
Old 02-25-2021 , 10:16   Fixing knife disappear per new round
Reply With Quote #1

Hello, I want to fix this problem where every new round, i always lost my knife.

I'm using OciXCrom knife models plugin.

The problem occurs after being zombie and turn to new round.

Well, I did try doing this:
PHP Code:
register_logevent("newround()"2"1=Round_Start")

public 
newround(id) {

crxknives_get_attribute_int(idATTRIBUTE_BONUS_XPg_Had_DualKatana[id])


But I got an errors:
PHP Code:
[AMXXRun time error 10native error (native "TrieKeyExists")
[
AMXX]    [0crxknife_models.amxx::_crxknives_get_attribute_int (line 837)
 
Unhandled dynamic native error
[AMXXDisplaying debug trace (plugin "knife_example.amxx"version "1.7")
[
AMXXRun time error 10native error (native "crxknives_get_attribute_int")
[
AMXX] [0knife_example.sma::Event_NewRound (line 192
PS:
PHP Code:
public zp_fw_core_infect_post(id)
{
    
g_Had_exampleknife[id] = 0

This thing is needed, but this is where the problem came from.
__________________
My Steam:

Last edited by nG_getwreck; 02-25-2021 at 14:00.
nG_getwreck is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-25-2021 , 13:20   Re: Fixing knife disappear per new round
Reply With Quote #2

I didn't understand a thing. Please explain better what you're trying to do and show more code.

Round start is a global event. There is no "id" in there. You're trying to retrieve an attribute from client index 0, which is invalid.
If you want to use that code on round start, you need to loop all players.
__________________


Dear admins. If somehow you managed to read this, plz fix.

Last edited by OciXCrom; 02-25-2021 at 13:21.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
nG_getwreck
Senior Member
Join Date: Oct 2020
Location: Philippines from South K
Old 02-25-2021 , 13:58   Re: Fixing knife disappear per new round
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
I didn't understand a thing. Please explain better what you're trying to do and show more code.

Round start is a global event. There is no "id" in there. You're trying to retrieve an attribute from client index 0, which is invalid.
If you want to use that code on round start, you need to loop all players.
Ok, so those errors is throwed because i loop maxplayers wrong. Anyway thanks, and problem solved. yeah it's hard to understand.
__________________
My Steam:
nG_getwreck is offline
Reply


Thread Tools
Display Modes

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 21:57.


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