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

problem code, crash...


Post New Thread Reply   
 
Thread Tools Display Modes
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 04-29-2010 , 20:39   Re: problem code, crash...
Reply With Quote #31

I have been trying to modify it in various forms, but i do not have yielded results

How could then change?
flamin is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 04-29-2010 , 20:49   Re: problem code, crash...
Reply With Quote #32

It seems to me like you want to set godmode on someone because of something. Well, why the last code you posted it not working, might be because:
1. You have the ID of a play who is already dead.
2. You are checking if a dead player is alive.
3. You are setting godmode on a play who is dead, if the player is alive.

Do you even know anything about pawn?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 04-29-2010 , 20:55   Re: problem code, crash...
Reply With Quote #33

Quote:
Originally Posted by Jelle View Post
It seems to me like you want to set godmode on someone because of something. Well, why the last code you posted it not working, might be because:
1. You have the ID of a play who is already dead.
2. You are checking if a dead player is alive.
3. You are setting godmode on a play who is dead, if the player is alive.

Do you even know anything about pawn?
That and he's not even using the correct index. He's using id when he should be using dead.
__________________
[ 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 , 21:03   Re: problem code, crash...
Reply With Quote #34

Not much of pawn and wrecked knows...

How could then placed wrecked?
flamin is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-29-2010 , 22:28   Re: problem code, crash...
Reply With Quote #35

Quote:
Originally Posted by flamin View Post
How could then placed wrecked?
Wow. It's the simplest thing in the world and you still can't do it.
__________________
fysiks is offline
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 04-29-2010 , 22:38   Re: problem code, crash...
Reply With Quote #36

Quote:
Originally Posted by flamin
How could then placed wrecked?
Wow. It's the simplest thing in the world and you still can't do it.
In truth i am confused, A friend modified the code of this way and has told me that should function... It has not been tested

PHP Code:
public live(id)
{
    
spawnid )
    
    if ( 
get_pcvar_numg_pProtection ) == )
    {
        
set_user_godmode(id,1)
        new 
Float:protect get_pcvar_floatg_pProtectionTime )
        
set_task(protect,"stopprotect",id)
    }
    
    if ( 
get_user_teamid ) == 
    { 
        
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)
{
    if(!
is_user_alive(id))
        
set_user_godmode(id)

The problem i solve as soon as possible because this causing the player always this died after that kill

Fysiks to close the thread you can help me?
flamin is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-03-2010 , 20:04   Re: problem code, crash...
Reply With Quote #37

?
PHP Code:
public live(id)
{
    
spawnid );
    
    if ( 
get_pcvar_numg_pProtection ) == )
    {
        
client_printid print_chat "protection started" );
        
        new 
Float:fProtectTime get_pcvar_floatg_pProtectionTime );
        
        
set_user_godmodeid );
        
set_taskfProtectTime "stopprotect"id );
    }
    
    if ( 
Teams:get_user_teamid ) == 
    { 
        
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_printid print_chat "protection ended" );
    
    if( 
is_user_aliveid ) )
        
set_user_godmodeid );

__________________
Bugsy is offline
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 05-03-2010 , 20:19   Re: problem code, crash...
Reply With Quote #38

Thanks, I am going to prove

You can look out for in this problem with the vote of maps?

http://forums.alliedmods.net/showpos...4&postcount=27

Last edited by flamin; 05-03-2010 at 20:22.
flamin is offline
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 05-03-2010 , 21:00   Re: problem code, crash...
Reply With Quote #39

This is the error that is causing the vote on maps:

Code:
L 05/03/2010 - 20:26:27: Start of error session.
L 05/03/2010 - 20:26:27: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20100503.log")
L 05/03/2010 - 20:26:27: Invalid menu id 0(5)
L 05/03/2010 - 20:26:27: [AMXX] Displaying debug trace (plugin "yap_menu.amxx")
L 05/03/2010 - 20:26:27: [AMXX] Run time error 10: native error (native "menu_destroy")
L 05/03/2010 - 20:26:27: [AMXX]    [0] yap_menu.sma::votemap_count (line 259)
L 05/03/2010 - 20:26:27: [AMXX]    [1] yap_menu.sma::UpdateHUD (line 221)
And this is the code:

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 "rt" );
    
    
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()
{
    new 
iPlayers32 ];

    
get_playersiPlayers g_iNumPlayers );

    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)

    for ( new 
g_iNumPlayers i++ )
            
menu_displayiPlayers] , 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 ] );
    }
}

votemap_count()
{
    new 
iMostVotes iWinner = -1;

    
menu_destroy pug_votemap_menu );
    
    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 chosen 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)

    
message_beginMSG_ALL SVC_INTERMISSION )
    
message_end()

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


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

public 
SortMapselem1[] , elem2[] )
{
    if( 
elem1] > elem2] ) 
        return -
1;
    else if( 
elem1] < elem2] )
        return 
1;
    
    return 
0;

As i can fix it?
flamin is offline
Old 05-03-2010, 21:08
wrecked_
This message has been deleted by wrecked_. Reason: Not even worht it
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 05-04-2010 , 21:24   Re: problem code, crash...
Reply With Quote #40

Quote:
Originally Posted by Bugsy View Post
?
PHP Code:
public live(id)
{
    
spawnid );
    
    if ( 
get_pcvar_numg_pProtection ) == )
    {
        
client_printid print_chat "protection started" );
        
        new 
Float:fProtectTime get_pcvar_floatg_pProtectionTime );
        
        
set_user_godmodeid );
        
set_taskfProtectTime "stopprotect"id );
    }
    
    if ( 
Teams:get_user_teamid ) == 
    { 
        
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_printid print_chat "protection ended" );
    
    if( 
is_user_aliveid ) )
        
set_user_godmodeid );

Bugsy although place as i dijistes continues to give these errors...

Code:
L 05/04/2010 - 19:12:25: [FUN] Invalid player 10
L 05/04/2010 - 19:12:25: [AMXX] Displaying debug trace (plugin "deathmatch.amxx")
L 05/04/2010 - 19:12:25: [AMXX] Run time error 10: native error (native "set_user_godmode")
L 05/04/2010 - 19:12:25: [AMXX]    [0] deathmatch.sma::stopprotect (line 117)
There is another way to create a protection spawn by just 3 seconds?
flamin 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 19:17.


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