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

problem code, crash...


Post New Thread Reply   
 
Thread Tools Display Modes
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-04-2010 , 22:14   Re: problem code, crash...
Reply With Quote #41

The 3 seconds part is based on g_pProtection's cvar.
This should fix your set_user_godmode issue.
Code:
public live(id) {     spawn( id );         if ( get_pcvar_num( g_pProtection ) == 1 && is_user_alive( id ) )     {         client_print( id , print_chat , "protection started" );                 new Float:fProtectTime = get_pcvar_float( g_pProtectionTime );                 set_user_godmode( id , 1 );         set_task( fProtectTime , "stopprotect", id );     }         if ( Teams:get_user_team( id ) == 1 )     {         give_item(id,"weapon_knife")         give_item(id,"weapon_glock18")         give_item(id,"ammo_9mm")         give_item(id,"ammo_9mm")     }     else     {         give_item(id,"weapon_knife")         give_item(id,"weapon_usp")         give_item(id,"ammo_45acp")         give_item(id,"ammo_45acp")     } } public stopprotect(id) {     client_print( id , print_chat , "protection ended" );         if( is_user_alive( id ) )         set_user_godmode( id , 0 ); }
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 05-04-2010 , 22:21   Re: problem code, crash...
Reply With Quote #42

Ok thanks wrecked. I am going to prove the code

How could solve the problem before?
flamin is offline
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 05-05-2010 , 00:42   Re: problem code, crash...
Reply With Quote #43

Wrecked the code this bad :S

Remains the same error:

Code:
L 05/04/2010 - 23:08:24: [FUN] Invalid player 11
L 05/04/2010 - 23:08:24: [AMXX] Displaying debug trace (plugin "deathmatch.amxx")
L 05/04/2010 - 23:08:24: [AMXX] Run time error 10: native error (native "set_user_godmode")
L 05/04/2010 - 23:08:24: [AMXX]    [0] deathmatch.sma::stopprotect (line 117)
L 05/04/2010 - 23:44:37: [FUN] Invalid player 7
L 05/04/2010 - 23:44:37: [AMXX] Displaying debug trace (plugin "deathmatch.amxx")
L 05/04/2010 - 23:44:37: [AMXX] Run time error 10: native error (native "set_user_godmode")
L 05/04/2010 - 23:44:37: [AMXX]    [0] deathmatch.sma::stopprotect (line 117)

This is the complete code:

PHP Code:
#include <amxmodx> 
#include <cstrike>
#include <fun> 
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#include <engine>

#define MONEYGIVEN  16000

public plugin_init() 

  
register_plugin("DeathMatch","1.0","PsychO"
  
register_event("DeathMsg","death","a"
  
register_cvar("dm_enabled","0")
  
register_cvar("dm_protection","1")
  
register_cvar("dm_protection_time","3")
  
register_event("StatusIcon","GotBomb","be","1=1","1=2","2=c4")
  
RegisterHam(Ham_Spawn ,"player","HAM_Spawn_Post",1)


public 
death() 

  if (
get_cvar_num("dm_enabled")==1)
  {
    new 
id read_data(2)
    
set_task(0.1,"live",id)
  }
}

public 
live(id)
{
  
spawn(id);

  if ( 
get_cvar_num("dm_protection")==&& is_user_aliveid ) )
  {

    new 
Float:fProtectTime get_cvar_float("dm_protection_time")

    
set_user_godmodeid);
    
set_taskfProtectTime "stopprotect"id );
  }
}

public 
stopprotect(id)
{
    if( 
is_user_aliveid ) )
      
set_user_godmodeid);
}

public 
HAM_Spawn_Postid )
{
    if( 
is_user_aliveid ) )
        
cs_set_user_moneyidMONEYGIVEN )
}

public 
GotBomb(idEntity
{
    if (
get_cvar_num("dm_enabled")==1)
        
fm_strip_user_gunidCSW_C4 )


You can help me?
flamin is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-05-2010 , 00:45   Re: problem code, crash...
Reply With Quote #44

Quote:
Originally Posted by flamin View Post
This is the complete code:
Liar. That code is only ~60 lines long.

EDIT: Hi, wrecked_.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-05-2010 , 00:46   Re: problem code, crash...
Reply With Quote #45

That's not your full code. The error is occurring on line 117, while you have provided me with the first 61 lines of your plugin.

EDIT: Damn, Exolent.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 05-05-2010 , 00:47   Re: problem code, crash...
Reply With Quote #46

I am not lying that is the complete code if you want can attach the sma file
flamin is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-05-2010 , 00:47   Re: problem code, crash...
Reply With Quote #47

Do it.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-05-2010 , 00:47   Re: problem code, crash...
Reply With Quote #48

Then you need to recompile it and install it to your server.
Because there is no way that the code you provided is causing that error.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 05-05-2010 , 00:49   Re: problem code, crash...
Reply With Quote #49

It may be a mistake in amx to say that this in the line 117?
Attached Files
File Type: sma Get Plugin or Get Source (deathmach.sma - 315 views - 1.2 KB)
flamin is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-05-2010 , 00:50   Re: problem code, crash...
Reply With Quote #50

Quote:
Originally Posted by flamin View Post
It may be a mistake in amx to say that this in the line 117?
Nope. Either recompile and install it again or post the .sma so we can see if it was your fault or your fault in a different way.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ 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 02:36.


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