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

Logs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 09-04-2016 , 16:14   Logs
Reply With Quote #1

What can cause this error?

Code:
L 09/04/2016 - 15:59:34: Invalid player id 100
L 09/04/2016 - 15:59:34: [AMXX] Displaying debug trace (plugin "EFFx_PugMod.amxx", version "3.6")
L 09/04/2016 - 15:59:34: [AMXX] Run time error 10: native error (native "client_print")
L 09/04/2016 - 15:59:34: [AMXX]    [0] EFFx_PugMod.sma::OnCHEGrenade_Deploy_Post (line 3117)

Script:

PHP Code:

#include <amxmodx>
#include <hamsandwich>

#define isPlayer(%0)        (1 <= %0 <= gMaxPlayers)

new gMaxPlayers

new const Grenades[][] =
{
    
"weapon_smokegrenade",
    
"weapon_hegrenade",
    
"weapon_flashbang"
}

const 
XO_CBASEPLAYER 4
const m_pPlayer 41
const m_flNextPrimaryAttack 46

public plugin_init()
{
    
register_plugin("Block Nades","1.0","AlliedModders")

    for(new 
isizeof Grenades;i++)
        
g_HamBlockGrenades RegisterHam(Ham_Item_Deploy,Grenades[i], "OnCHEGrenade_Deploy_Post"true)

    
gMaxPlayers get_maxplayers()
}
public 
OnCHEGrenade_Deploy_PostpEntity )
{
    new 
id get_pdata_cbasepEntity m_pPlayer XO_CBASEPLAYER );
    if(
isPlayer(id))
    {
        
engclient_cmd(id,"lastinv")
        
client_print(idprint_center"Voce nao pode usar bombas no aquecimento!");
        
set_pdata_float(pEntitym_flNextPrimaryAttack0.0XO_CBASEPLAYER);
    }

__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 09-04-2016 at 16:19.
EFFx is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 09-04-2016 , 16:27   Re: Logs
Reply With Quote #2

Maybe client_print can't be executed in Ham_Item_Deploy event, try using set_task + your message maybe it will work.

Last edited by Freezo Begin; 09-04-2016 at 16:27.
Freezo Begin is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-04-2016 , 16:31   Re: Logs
Reply With Quote #3

Use is_user_connected native see if it still happens
__________________

Last edited by Depresie; 09-04-2016 at 16:32.
Depresie is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 09-04-2016 , 17:38   Re: Logs
Reply With Quote #4

I'll try yours versions. I'll told you guys when i get the result. Thx
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-04-2016 , 17:40   Re: Logs
Reply With Quote #5

Based on the code that you posted, that error cannot happen since isPlayer() will return false when id is 100. Regardless, you should check if the user is alive before sending "lastinv" anyways.
__________________

Last edited by fysiks; 09-04-2016 at 17:41.
fysiks is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 09-04-2016 , 17:47   Re: Logs
Reply With Quote #6

Quote:
Originally Posted by fysiks View Post
Based on the code that you posted, that error cannot happen since isPlayer() will return false when id is 100. Regardless, you should check if the user is alive before sending "lastinv" anyways.
the problem is in client_print.
Freezo Begin is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-04-2016 , 18:44   Re: Logs
Reply With Quote #7

Quote:
Originally Posted by Freezo Begin View Post
the problem is in client_print.
I know that. client_print() never gets called if isPlayer() is false. Based on the error, the value of id is 100 which is not a valid player therefore, isPlayer() will return false.

So, if you want help other than just guessing, you'll need to post the real code.
__________________

Last edited by fysiks; 09-04-2016 at 18:44.
fysiks is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-04-2016 , 18:55   Re: Logs
Reply With Quote #8

Unless I'm drunk, the script doesn't match the error.

"EFFx_PugMod.amxx", version "3.6""
"Block Nades","1.0","AlliedModders")"

So make sure you post the right code as it is, or the related part of the code around.

If the right code, that's not possible unless gMaxPlayers is somehow wrong, did you debug it?
__________________

Last edited by Arkshine; 09-04-2016 at 19:00.
Arkshine is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 09-04-2016 , 18:56   Re: Logs
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
So, if you want help other than just guessing, you'll need to post the real code.
He said he will try it, he didn't ask for a confirmation if it's will work or not.

But did you post a code?
I think the last code that you post was about 3 years ago.
Seriously stop being offensive, i know that you have knowledge/experience in pawn, but you should add codes in your reply's.

Thanks.
Freezo Begin is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-04-2016 , 20:03   Re: Logs
Reply With Quote #10

Quote:
Originally Posted by Freezo Begin View Post
He said he will try it, he didn't ask for a confirmation if it's will work or not.

But did you post a code?
I think the last code that you post was about 3 years ago.
Seriously stop being offensive, i know that you have knowledge/experience in pawn, but you should add codes in your reply's.

Thanks.
What in the world are you talking about?

How is me posting or not posting code relevant at all? How can I even post code if the code that was originally posted has nothing wrong with it? Also, people learn better in most cases if they do it themselves. I refuse to treat people like babies and doing it all for them.

Also, how was any post I made in this thread offensive?
__________________
fysiks 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 20:06.


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