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

problem code, crash...


Post New Thread Reply   
 
Thread Tools Display Modes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-28-2010 , 20:21   Re: problem code, crash...
Reply With Quote #21

Quote:
Originally Posted by flamin View Post
Fysiks i cannot turn debug since it constantly use amx_off to play scrim...
Well, if you do amx_off then the plugin won't be running anyways. Do you even know what you are talking about?
__________________
fysiks is online now
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 04-29-2010 , 09:58   Re: problem code, crash...
Reply With Quote #22

If it is what I am speaking fysiks...

What you want to say is to add debug the plugin, To implement amx_off plugin not pause if not that remains in operation...

No serious better do what it says wrecked? How could do so?
flamin is offline
visar1
Member
Join Date: Nov 2009
Old 04-29-2010 , 14:29   Re: problem code, crash...
Reply With Quote #23

add in plugins .ini this
cs_reset_user_model debug
yap_cs.amxx debug



and plugins efect 100 %
visar1 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-29-2010 , 17:46   Re: problem code, crash...
Reply With Quote #24

Quote:
Originally Posted by flamin View Post
If it is what I am speaking fysiks...

What you want to say is to add debug the plugin, To implement amx_off plugin not pause if not that remains in operation...

No serious better do what it says wrecked? How could do so?
Sorry but that wasn't English.
__________________
fysiks is online now
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-29-2010 , 18:21   Re: problem code, crash...
Reply With Quote #25

I bet he's using a translator.
That's why he can't take anything of what we say and turn it into code, so he asks for examples he can use to copy/paste.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-29-2010 , 19:06   Re: problem code, crash...
Reply With Quote #26

Quote:
Originally Posted by Exolent[jNr] View Post
I bet he's using a translator.
That's why he can't take anything of what we say and turn it into code, so he asks for examples he can use to copy/paste.
Yes, he is. But, his comment about amx_off makes no sense regardless.
__________________
fysiks is online now
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 04-29-2010 , 19:12   Re: problem code, crash...
Reply With Quote #27

I have added the way debug the two plugins..

And this is what has happened:

Code:
L 04/29/2010 - 12:07:50: Start of error session.
L 04/29/2010 - 12:07:50: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20100429.log")
L 04/29/2010 - 12:07:50: Invalid menu id 0(5)
L 04/29/2010 - 12:07:50: [AMXX] Displaying debug trace (plugin "yap_menu.amxx")
L 04/29/2010 - 12:07:50: [AMXX] Run time error 10: native error (native "menu_destroy")
L 04/29/2010 - 12:07:50: [AMXX]    [0] yap_menu.sma::votemap_count (line 252)
L 04/29/2010 - 12:07:50: [AMXX]    [1] yap_menu.sma::UpdateHUD (line 214)
L 04/29/2010 - 12:51:58: Start of error session.
L 04/29/2010 - 12:51:58: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20100429.log")
L 04/29/2010 - 12:51:58: Invalid menu id 0(5)
L 04/29/2010 - 12:51:58: [AMXX] Displaying debug trace (plugin "yap_menu.amxx")
L 04/29/2010 - 12:51:58: [AMXX] Run time error 10: native error (native "menu_destroy")
L 04/29/2010 - 12:51:58: [AMXX]    [0] yap_menu.sma::votemap_count (line 252)
L 04/29/2010 - 12:51:58: [AMXX]    [1] yap_menu.sma::UpdateHUD (line 214)
L 04/29/2010 - 12:53:44: Start of error session.
L 04/29/2010 - 12:53:44: Info (map "de_inferno") (file "addons/amxmodx/logs/error_20100429.log")
L 04/29/2010 - 12:53:44: [FUN] Invalid player 11
L 04/29/2010 - 12:53:44: [AMXX] Displaying debug trace (plugin "deathmatch.amxx")
L 04/29/2010 - 12:53:44: [AMXX] Run time error 10: native error (native "set_user_godmode")
L 04/29/2010 - 12:53:44: [AMXX]    [0] deathmatch.sma::stopprotect (line 129)
This is the code deathmatch:

PHP Code:
#include <amxmodx> 
#include <amxmisc> 
#include <cstrike>
#include <fun> 

public plugin_init() 

  
register_plugin("DeathMatch","1.0","flamin"
  
register_event("DeathMsg","death","a"
  
register_cvar("dm_enabled","0")
  
register_cvar("dm_protection","1")
  
register_cvar("dm_protection_time","3")
  
register_cvar("dm_killbonus","1")
  
register_cvar("dm_killbonus_amount","500")


public 
death() 

  if (
get_cvar_num("dm_enabled")==1)
  {
    new 
dead read_data(2)
    
set_task(0.1,"live",dead)
    new 
murderer read_data(1)
    if (
get_cvar_num("dm_killbonus")==&& murderer!=dead)
    {
      new 
money cs_get_user_money(murderer)
      new 
money2 money get_cvar_num("dm_killbonus_amount")
      
cs_set_user_money(murderer,money2,1)
      if (
money2 >= 300)
      {
        
money2 money2 300
        cs_set_user_money
(murderer,money2,0)
      } else {
    
cs_set_user_money(murderer,0,0)
      }
    }
  }
}

public 
live(dead)
{
  
spawn(dead)
  if (
get_cvar_num("dm_protection")==1)
  {
    
set_user_godmode(dead,1)
    new 
Float:protect get_cvar_float("dm_protection_time")
    
set_task(protect,"stopprotect",dead)
  }
  if (
get_user_team(dead)==1
  { 
    
give_item(dead,"weapon_knife"
    
give_item(dead,"weapon_glock18"
    
give_item(dead,"ammo_9mm"
    
give_item(dead,"ammo_9mm"
  } 
  else 
  { 
    
give_item(dead,"weapon_knife"
    
give_item(dead,"weapon_usp"
    
give_item(dead,"ammo_45acp"
    
give_item(dead,"ammo_45acp"
  } 
}

public 
stopprotect(dead)
{
  
set_user_godmode(dead)

And this code yap_menu:

PHP Code:
public try_load_votemap_menu()
{
    
// Rukia: Get our maps.ini
    
static filename[64]
    
get_configsdirfilename63 )
    
formatfilename63"%s/maps.ini"filename )

    
// Rukia: Otherwise, just use mapcycle
    
if(file_exists(filename)) 
    {
        
load_votemap_menu(filename)
        if(
pug_votemap_count != 0) return;
    }

    
copy(filename,63,"mapcycle.txt")
    
load_votemap_menu(filename)
}

public 
load_votemap_menu(filename[])
{
    new 
szText256 ] , iFile;
    
    
iFile fopenfilename "rb" );
    
    
pug_votemap_count 0;
    
    while( ( 
pug_votemap_count VoteMaps ) && !feofiFile ) && fgetsiFile szText charsmaxszText ) ) )
    {
        
trimszText );
        
        if( ( ( 
szText] == '^0' ) || ( szText] == '/' ) || ( szText] == ';' ) ) || !is_map_validszText ) ) 
            continue;

        
copypug_votemap_namepug_votemap_count ] , charsmaxpug_votemap_name[] ) , szText );

        
g_iMapVotespug_votemap_count ][ MapIndex ] = pug_votemap_count++;

        
menu_additempug_votemap_menu szText )
    }
    
    
fcloseiFile );
}

public 
cmd_votemap(id,level,cid)
{
    if (!
cmd_access(idlevelcid1) ) return PLUGIN_HANDLED;
    
    
votemap_start()
    return 
PLUGIN_HANDLED;
}

public 
votemap_start()
{
    if(
pug_voting) { set_task(get_pcvar_float(pug_cvar_vote_time),"votemap_start",100 pug_votemap_menu); return; }

    
pug_voting 1;
    
arrayset(pug_voted,0,33)

    
arrayset(pug_votemap_votes,0,pug_votemap_count)
    
pug_display_menu_all(pug_votemap_menu)

    
client_print(0,print_chat,"",pug_headerLANG_PLAYER"PUG_VOTE_START""PUG map");
    
console_print(0,"%s %L",pug_headerLANG_PLAYER"PUG_VOTE_START""PUG map");
    
set_task(get_pcvar_float(pug_cvar_vote_time),"votemap_end",100 pug_votemap_menu)

    
UpdateHUD();
        
set_task1.0 "UpdateHUD" TaskMapHUD "a" VoteTime );
}

public 
votemap_end()
{
    
pug_cancel_menu()

    
pug_voting 0;
    
remove_task 100 pug_votemap_menu )

    if(
votemap_count()) voteteam_start();
}

public 
votemap_handleid menu item )
{
    if ( 
item )
        return 
PLUGIN_CONTINUE;
    
    static 
szName33 ];
    
    
get_user_nameid szName charsmaxszName ) );
    
    
g_iMapVotesitem ][ MapVotes ]++;
    
g_iVoteCount++;
    
    
client_printprint_chat "" szName pug_votemap_nameitem ] );

    
pug_voted[id] = 1;
    if(
pug_should_stopvote() ) votemap_end()
    
    return 
PLUGIN_HANDLED;
}

public 
UpdateHUD()
{    
    static 
iDisplayCount = -1;
    
    if ( ++
iDisplayCount == VoteTime )
    {
        
votemap_count();
    }
    else
    {
        static 
szHUDVoteMaps 40 ] , iPos iPos2;
        static 
g_iMapVotesTempVoteMaps ][ MapInfo ];
        
        
iPos copyszHUD charsmaxszHUD ) , "Map votes:" );
        
        
szHUDiPos++ ] = EOS;
        
iPos2 iPos;
        
        if ( 
g_iVoteCount )
        {
            
g_iMapVotesTemp g_iMapVotes;
            
SortCustom2Dg_iMapVotesTemp VoteMaps "SortMaps" );
        
            for ( new 
pug_votemap_count i++ )
                if ( 
g_iMapVotesTemp][ MapVotes ] )
                    
iPos += formatexszHUDiPos ] , charsmaxszHUD ) - iPos "%s - %d vote%s^n" pug_votemap_nameg_iMapVotesTemp][ MapIndex ] ] ,  g_iMapVotesTemp][ MapVotes ] , ( g_iMapVotesTemp][ MapVotes ] != ) ? "s" "" );
        }
        else
        {
            
iPos += copyszHUDiPos ] , charsmaxszHUD ) - iPos "<no votes>^n" );
        }
        
        
set_hudmessage255 ,0.76 0.10 6.0 1.1 );
        
ShowSyncHudMsgg_iSyncHUDObj] , szHUD );
        
        
set_hudmessage255 255 255 ,  0.76 0.13 6.0 1.1 );
        
ShowSyncHudMsgg_iSyncHUDObj] , szHUDiPos2 ] );
    }
}

public 
votemap_count()
{
    new 
iMostVotes iWinner = -1;

    
menu_destroy pug_votemap_menu );

    
message_beginMSG_ALL SVC_INTERMISSION )
    
message_end()
    
    for ( new 
pug_votemap_count i++ )
    {
        if ( 
g_iMapVotes][ MapVotes ] > iMostVotes )
        {
            
iMostVotes g_iMapVotes][ MapVotes ];
            
iWinner i;
        }
    }
    
    if ( 
iWinner == -)
    {
        
iWinner randompug_votemap_count );
        
client_printprint_chat "[ESVE Pug] %s has been choosen randomly." pug_votemap_nameiWinner ] );
    }
    else
    {
        
client_printprint_chat "[ESVE Pug] Cambiando map a %s..." pug_votemap_nameiWinner ] , iMostVotes , ( iMostVotes != ) ? "s" "" );
    }

    
pug_voting 0;
    
votemap_noswitch 1;
    
set_pcvar_num(pug_cvar_votemap_e,0)

    
set_task(3.0,"pug_votemap_change",iWinner)
    return 
PLUGIN_CONTINUE


public 
pug_votemap_change(iWinner)
{
    
server_cmd("changelevel %s",pug_votemap_name[iWinner]);

How could solve the problems?
flamin is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 04-29-2010 , 20:21   Re: problem code, crash...
Reply With Quote #28

Quote:
Originally Posted by wrecked_ View Post
Check if the user is alive before using set_user_godmode. For the first one, I'd recommend checking if the menu exists first...
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 04-29-2010 , 20:27   Re: problem code, crash...
Reply With Quote #29

wrecked I tested with this, but has not worked:

PHP Code:
public stopprotect(dead)
{
    if( 
is_user_aliveid ) )
          
set_user_godmode(dead)

flamin is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-29-2010 , 20:35   Re: problem code, crash...
Reply With Quote #30

Quote:
Originally Posted by flamin View Post
wrecked I tested with this, but has not worked:

PHP Code:
public stopprotect(dead)
{
    if( 
is_user_aliveid ) )
          
set_user_godmode(dead)

Because you don't know how to code.
__________________
fysiks is online now
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 15:13.


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