AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Error, need help. (https://forums.alliedmods.net/showthread.php?t=208446)

Unkolix 02-13-2013 13:31

Error, need help.
 
Ok, I've got this error in my server console:
Code:

L 02/13/2013 - 16:52:19: [FUN] Invalid player 1
L 02/13/2013 - 16:52:19: [AMXX] Displaying debug trace (plugin "VIP.amxx")
L 02/13/2013 - 16:52:19: [AMXX] Run time error 10: native error (native "give_item")
L 02/13/2013 - 16:52:19: [AMXX]    [0] VIP.sma::fwHamPlayerSpawnPost (line 334)

PHP Code:

public fwHamPlayerSpawnPost(id
{
    
VIPMenuUsed=0//Makes sure that VIP can use VIP menu
    
if( g_bCurrentMapIsInList 
    {
        return;
    }
    if(
get_user_flags(id) & ADMIN_LEVEL_H//Checks if player has flag H
    
{
        
give_item(id"weapon_hegrenade");
        
give_item(id"weapon_flashbang");
        
give_item(id"weapon_flashbang");
        
give_item(id"weapon_smokegrenade");
        
give_item(id"item_assaultsuit");
        if(
g_bHasBombSite && cs_get_user_team(id) == CS_TEAM_CT//Checks if map has bombsite and if VIP is CT
        
{
            
cs_set_user_defuse(id1); //Gives player defuser kit
        
}
    }



wickedd 02-13-2013 13:57

Re: Error, need help.
 
You forgot
PHP Code:

if( is_user_aliveid ) ) 


Unkolix 02-13-2013 14:05

Re: Error, need help.
 
Quote:

Originally Posted by wickedd (Post 1893743)
You forgot
PHP Code:

if( is_user_aliveid ) ) 


Is it possible to spawn dead? Could you explain why this error occurred?

P.S. The error seems to be gone.

wickedd 02-13-2013 14:12

Re: Error, need help.
 
Quote:

Originally Posted by Unkolix (Post 1893746)
Is it possible to spawn dead? Could you explain why this error occurred?

P.S. The error seems to be gone.

Read this.

simanovich 02-13-2013 14:24

Re: Error, need help.
 
The bast way to spawn a dead player is to use the Ham-Sandwich version (Fakemeta version is only for entity's):
PHP Code:

#include <amxmodx>
#include <hamsandwich>

<...>

public 
somefunction(client){
    if (!
is_user_alive(client) && is_user_connected(client)) 
        
ExecuteHam(Ham_CS_RoundRespawn,client);



Unkolix 02-13-2013 14:31

Re: Error, need help.
 
Ok, thanks for answers!


All times are GMT -4. The time now is 20:34.

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