Raised This Month: $ Target: $400
 0% 

[HELP] Interesting Run Time Error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-22-2015 , 10:06   [HELP] Interesting Run Time Error
Reply With Quote #1

Can anyone explain to me the following error?

Spoiler


PHP Code:
#include < amxmodx >
#include < amx_settings_api >
#include < cs_player_models_api >
#include < cs_weap_models_api >
#include < zp50_core >
#include < zp50_class_survivor >
#include < zp50_class_sniper >
#include < rz_vip_core >

#define _PLUGIN       "[RZ] VIP Models"
#define _VERSION            "1.1"
#define _AUTHOR          "H.RED.ZONE"

#define LIBRARY_SURVIVOR "zp50_class_survivor"
#define LIBRARY_SNIPER "zp50_class_sniper"

#define PLAYERMODEL_MAX_LENGTH 32
#define MODEL_MAX_LENGTH 64

// Cvars.
new _pCvarVipModelOn
    
,_pCvarVipKnifeOn

// Default Models.
new const models_vip_human_player[][] = { "vip" }
new const 
models_vip_human_knife[][] = { "models/v_knife.mdl" }    

// New Array.
new Array:_gModelsVipPlayer
new Array:_gKnifeVipPlayer

// Settings File.
new const RZ_SETTINGS_FILE[] = "rz_vip.ini"    
    
// This Will Be Called When Map Is Loaded.
public plugin_init( ) {
    
    
// Register Plugin.
    
register_plugin_PLUGIN_VERSION_AUTHOR )
    
    
// Cvars.
    
_pCvarVipModelOn register_cvar"rz_vip_model_on""1" )
    
_pCvarVipKnifeOn register_cvar"rz_vip_model_knife_on""1" )
}

// Precache Before Map Starts.
public plugin_precache( ) {
    
    
// Initialize Arrays.
    
_gModelsVipPlayer ArrayCreatePLAYERMODEL_MAX_LENGTH)
    
_gKnifeVipPlayer ArrayCreateMODEL_MAX_LENGTH)
    
    
// Load From External File
    
amx_load_setting_string_arrRZ_SETTINGS_FILE"Vip Model""RZ VIP MODEL"_gModelsVipPlayer )
    
amx_load_setting_string_arrRZ_SETTINGS_FILE"Knife Model""V_KNIFE VIP MODEL"_gKnifeVipPlayer )
    
    
// If It Couldn't Load From File, Use And Save Default Ones.
    
    // New Index.
    
new index
    
    
// If Array Size Of VIP Model Is Zero.
    
if ( ArraySize(_gModelsVipPlayer) == ) {
        
        
// Set Index To 0 If Index Lower Then SizeOf Model Index + 1.
        
for ( index 0index sizeof models_vip_human_playerindex++ )
        
            
// Array Push String.
            
ArrayPushString_gModelsVipPlayermodels_vip_human_player[index] )
        
        
// Save To File.
        
amx_save_setting_string_arrRZ_SETTINGS_FILE"Vip Model""RZ VIP MODEL"_gModelsVipPlayer )
    }
    
    
// If Array Size Of VIP Model Is Zero.
    
if ( ArraySize(_gKnifeVipPlayer) == ) {
        
        
// Set Index To 0 If Index Lower Then SizeOf Model Index + 1.
        
for ( index 0index sizeof models_vip_human_knifeindex++ )
        
            
// Array Push Strin
            
ArrayPushString_gKnifeVipPlayermodels_vip_human_knife[index] )
        
        
// Save To File.
        
amx_save_setting_string_arrRZ_SETTINGS_FILE"Knife Model""V_KNIFE VIP MODEL"_gKnifeVipPlayer )
    }
    
    
// Precache Models.
    
new player_model[PLAYERMODEL_MAX_LENGTH], model[MODEL_MAX_LENGTH], model_path[128]
    
    for ( 
index 0index ArraySize(_gModelsVipPlayer); index++ ) {
        
        
ArrayGetString_gModelsVipPlayerindexplayer_modelcharsmax(player_model))
        
        
formatexmodel_pathcharsmax(model_path), "models/player/%s/%s.mdl"player_modelplayer_model )
        
        
precache_modelmodel_path )
        
        
formatexmodel_pathcharsmax(model_path), "models/player/%s/%sT.mdl"player_modelplayer_model )
        
        if ( 
file_exists(model_path) ) 
            
precache_modelmodel_path )
    }
    
    for ( 
index 0index ArraySize(_gKnifeVipPlayer); index++ ) {
        
        
ArrayGetString_gKnifeVipPlayerindexmodelcharsmax(model) )
        
precache_modelmodel )
    }
}

public 
client_disconnect(id)
{
    
remove_task(id)
}

// Cure Post.
public zp_fw_core_cure_post(idattacker) {
    
    
// Skip For Survivor
    
if (LibraryExists(LIBRARY_SURVIVORLibType_Library) && zp_class_survivor_get(id))
        return;
    if (
LibraryExists(LIBRARY_SNIPERLibType_Library) && zp_class_sniper_get(id))
        return;
    
    if( 
rz_is_user_vip(id) || rz_is_user_god(id) ) 
    {
    
        
set_task(0.1"_VipModelsSet",id)
    }
}

public 
_VipModelsSet(id) {
    
    if(!
is_user_alive(id) || zp_core_is_zombie(id))
        return
    
    
// Apply Vip Human Player Model.
    
if ( get_pcvar_num(_pCvarVipModelOn) ) {
        
        
// Player Model.
        
new player_model[PLAYERMODEL_MAX_LENGTH]
        
        
// Get Array.
        
ArrayGetString_gModelsVipPlayerrandom_num(0ArraySize(_gModelsVipPlayer) - 1), player_modelcharsmax(player_model))
        
        
cs_set_player_model(idplayer_model)
    }
    
    
// Apply Vip Knife Model.
    
if ( get_pcvar_num(_pCvarVipKnifeOn) ) 
    {
        
        
// Knife Model.
        
new model[MODEL_MAX_LENGTH]
        
        
// Get Array.
        
ArrayGetString_gKnifeVipPlayerrandom_num(0ArraySize(_gKnifeVipPlayer) - 1), modelcharsmax(model) )
        
        
cs_set_player_view_modelidCSW_KNIFEmodel )
    }

Depresie is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 09-24-2015 , 13:26   Re: [HELP] Interesting Run Time Error
Reply With Quote #2

Nothing calls the function _VipModelsSet
redivcram is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 10-02-2015 , 11:45   Re: [HELP] Interesting Run Time Error
Reply With Quote #3

Quote:
Originally Posted by redivcram View Post
Nothing calls the function _VipModelsSet
more like the function doesn't exist / is called via a task so the compiler didn't detect it during compilation
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 10-02-2015 , 12:46   Re: [HELP] Interesting Run Time Error
Reply With Quote #4

Then

PHP Code:
    if( rz_is_user_vip(id) || rz_is_user_god(id) ) 
    {
    
        
set_task(0.1"_VipModelsSet",id)
    } 


PHP Code:
    if( rz_is_user_vip(id) || rz_is_user_god(id) ) 
    {
    
        
_VipModelsSet(id)
    } 
Could've thought of that earlier lol
redivcram is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 10-08-2015 , 04:42   Re: [HELP] Interesting Run Time Error
Reply With Quote #5

@redivcram
from what i know it is needed a delay to set models

i also observed that there is an empty line above the set_task, i just deleted it, now im waiting to see if the error will happen again =/ but i dont know, it is the first time i got that error in months
Depresie is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 10-08-2015 , 04:51   Re: [HELP] Interesting Run Time Error
Reply With Quote #6

Silly suggestion:
- Try to rename _VipModelsSet to something else without _ symbol. Eg: FnVipModelSet
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 10-08-2015 , 04:57   Re: [HELP] Interesting Run Time Error
Reply With Quote #7

i will try and your suggestion yokomo, i also have more functions including that symbol in the beginning
i have to review and rewrite + optimize all my entire addons soon, thanks for the suggestion, it doesn't matter if it is silly or not, it's good to take in count even this
Depresie is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 10-08-2015 , 06:21   Re: [HELP] Interesting Run Time Error
Reply With Quote #8

Still... using set_task is for calling a function after an amount of delay, but use it this way since is the same thing but more sure.
Or the error couldve simply blamed the underline

Edit: Didnt see that post sry... but yeah you know what to do

Last edited by redivcram; 10-08-2015 at 06:23.
redivcram is offline
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 10-09-2015 , 08:32   Re: [HELP] Interesting Run Time Error
Reply With Quote #9

I am not much into Zombie related plugins .. but this is what i noticed..

You are using
PHP Code:
cs_set_player_model() 
&
PHP Code:
ArrayGetString() 
where's cstrike.inc and cellarray.inc included ?
__________________
You keep bringing ANTICHRISTUS down .. He will rise again and kick asses !

#RespectList ANTICHRISTUS fysiks Bugsy

Most Common Errors You Can Encounter Every Now and Then

Last edited by devilicioux; 10-09-2015 at 08:34.
devilicioux is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-09-2015 , 11:31   Re: [HELP] Interesting Run Time Error
Reply With Quote #10

Quote:
Originally Posted by devilicioux View Post
I am not much into Zombie related plugins .. but this is what i noticed..

You are using
PHP Code:
cs_set_player_model() 
&
PHP Code:
ArrayGetString() 
where's cstrike.inc and cellarray.inc included ?
cellarray is included when you include amxmodx, check the inc file.
__________________
HamletEagle is offline
Reply


Thread Tools
Display Modes

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 22:09.


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