AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Again native error (native "set_view") (https://forums.alliedmods.net/showthread.php?t=95290)

xbatista 06-22-2009 04:00

Again native error (native "set_view")
 
Whats the prob.?
PHP Code:

public event_deathmsgM()
{
    if( !(
<= read_data(2) <= g_max_clients) ) return;
    
    
g_alive[read_data(2)] = false;
 
    
g_glowtask[read_data(2)] = false;
    
    
g_Player_Item_Picked[read_data(2)] = false;
 
    
ResetItems(read_data(2)); // Here error


PHP Code:

ResetItems(client)
{
    if( !(
<= client <= g_max_clients) ) return;
    
    if( 
pev_valid(g_ent[client]) )
    {
        
engfunc(EngFunc_RemoveEntityg_ent[client]);
        
g_ent[client] = 0;
    }
            
    
set_view(client,CAMERA_NONE); // Here error


Quote:

L 06/22/2009 - 10:27:29: [ENGINE] Invalid player 22
L 06/22/2009 - 10:27:29: [AMXX] Displaying debug trace (plugin "medic_mod.amxx")
L 06/22/2009 - 10:27:29: [AMXX] Run time error 10: native error (native "set_view")
L 06/22/2009 - 10:27:29: [AMXX] [0] medic_mod.sma::ResetItems (line 608)
L 06/22/2009 - 10:27:29: [AMXX] [1] medic_mod.sma::event_deathmsgM (line 534)

Xellath 06-22-2009 04:08

Re: Again native error (native "set_view")
 
PHP Code:

new victim read_data(2);
ResetItems(victim); 

Try something like that.

xbatista 06-22-2009 04:26

Re: Again native error (native "set_view")
 
That would not help...

Xellath 06-22-2009 04:33

Re: Again native error (native "set_view")
 
PHP Code:

public event_deathmsgM() 

    new 
victim read_data(2);
 
    
g_alive[victim] = false
 
    
g_glowtask[victim] = false
 
    
g_Player_Item_Picked[victim] = false
 
    
ResetItems(victim);


PHP Code:

ResetItems(client

    if( 
pev_valid(g_ent[client]) ) 
    { 
        
engfunc(EngFunc_RemoveEntityg_ent[client]); 
        
g_ent[client] = 0
    } 
 
    
set_view(client,CAMERA_NONE);


Since this is only used on one player, we wont need to loop the players.

xbatista 06-22-2009 04:41

Re: Again native error (native "set_view")
 
Quote:

to loop the players.
I don't loop through players, I just check through players if "is player,not entity"
And this:
PHP Code:

new victim read_data(2);
     
ResetItems(victim

The same as this:
PHP Code:

ResetItems(read_data(2)) 

I think I know why return error:
PHP Code:

set_view(client,CAMERA_NONE); 

This only can run when player is alive, but I need to set_view when he died, cuz I'm running in one place of plugin 3RDPERSON camera.

Arkshine 06-22-2009 05:06

Re: Again native error (native "set_view")
 
Again, your error is because you do something on a client disconnected or not in game yet. You have to check if the player is connected or alive.


All times are GMT -4. The time now is 15:42.

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