Raised This Month: $ Target: $400
 0% 

OnWeapon_Precache error


Post New Thread Reply   
 
Thread Tools Display Modes
leonardo121
Member
Join Date: Sep 2013
Old 08-09-2017 , 10:03   Re: OnWeapon_Precache error
Reply With Quote #11

Quote:
"weapon_scout"
__________________
" In the end it doesn't even matter " - Linkin Park
leonardo121 is offline
Tripaloski
Member
Join Date: Jul 2017
Old 08-09-2017 , 10:16   Re: OnWeapon_Precache error
Reply With Quote #12

OK thank you
PHP Code:
new const Something[][] =  

    
"weapon_p228",            
    
"weapon_scout",             
    
"weapon_hegrenade",               
    
"weapon_xm1014",
    
"weapon_c4",    
    
"weapon_mac10",         
    
"weapon_aug",
    
"weapon_smokegrenade",       
    
"weapon_elite",         
    
"weapon_fiveseven",
    
"weapon_ump45",         
    
"weapon_sg550"
    
"weapon_galil",
    
"weapon_famas"
    
"weapon_usp",   
    
"weapon_glock18",    
    
"weapon_awp",  
    
"weapon_mp5navy",      
    
"weapon_m249",              
    
"weapon_m3"
    
"weapon_m4a1",      
    
"weapon_tmp",      
    
"weapon_g3sg1",
    
"weapon_flashbang",   
    
"weapon_deagle",
    
"weapon_sg552",
    
"weapon_ak47",   
    
"weapon_knife",                 
    
"weapon_p90"

Now what should I do?
Tripaloski is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-09-2017 , 10:22   Re: OnWeapon_Precache error
Reply With Quote #13

PHP Code:
for(new isizeof Somethingi++)
{
    
//your previous code here

And instead of szWeaponName you will use Something[i].
__________________

Last edited by HamletEagle; 08-09-2017 at 10:22.
HamletEagle is offline
leonardo121
Member
Join Date: Sep 2013
Old 08-09-2017 , 10:27   Re: OnWeapon_Precache error
Reply With Quote #14

Quote:
Originally Posted by HamletEagle View Post
PHP Code:
for(new isizeof Somethingi++)
{
    
//your previous code here

And instead of szWeaponName you will use Something[i].
simple as that
__________________
" In the end it doesn't even matter " - Linkin Park
leonardo121 is offline
Tripaloski
Member
Join Date: Jul 2017
Old 08-09-2017 , 10:41   Re: OnWeapon_Precache error
Reply With Quote #15

PHP Code:
public plugin_precache()
{
    for(new 
isizeof Somethingi++)
    {
        
get_weaponname(iWeaponIdSomethingcharsmax(Something))
        
        
g_hPrecacheHook[iWeaponId] = RegisterHam(Ham_PrecacheSomething"OnWeapon_Precache")
        
g_hPrecacheHook_Post[iWeaponId] = RegisterHam(Ham_PrecacheSomething"OnWeapon_Precache_Post"true)
    }

Like this?
Failed to compile
PHP Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2013 ITB CompuPhaseAMX Mod X Team

Error
Argument type mismatch (argument 1on line 116
Error
: Array must be indexed (variable "iWeaponId"on line 118
Error
: Array must be indexed (variable "iWeaponId"on line 119

3 Errors
.
Could not locate output file C:\Users\Utilizador\Desktop\Plugins\NoCustumeSkins.amx (compile failed). 
Tripaloski is offline
leonardo121
Member
Join Date: Sep 2013
Old 08-09-2017 , 10:50   Re: OnWeapon_Precache error
Reply With Quote #16

Quote:
Originally Posted by Tripaloski View Post
PHP Code:
public plugin_precache()
{
    for(new 
isizeof Somethingi++)
    {
        
get_weaponname(iWeaponIdSomethingcharsmax(Something))
        
        
g_hPrecacheHook[iWeaponId] = RegisterHam(Ham_PrecacheSomething"OnWeapon_Precache")
        
g_hPrecacheHook_Post[iWeaponId] = RegisterHam(Ham_PrecacheSomething"OnWeapon_Precache_Post"true)
    }

Like this?
Failed to compile
PHP Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2013 ITB CompuPhaseAMX Mod X Team

Error
Argument type mismatch (argument 1on line 116
Error
: Array must be indexed (variable "iWeaponId"on line 118
Error
: Array must be indexed (variable "iWeaponId"on line 119

3 Errors
.
Could not locate output file C:\Users\Utilizador\Desktop\Plugins\NoCustumeSkins.amx (compile failed). 
PHP Code:
public plugin_precache() 

    for(new 
isizeof Somethingi++) 
    { 
        
get_weaponname(iWeaponIdSomething[i], charsmax(Something)) 
         
        
g_hPrecacheHook[iWeaponId] = RegisterHam(Ham_PrecacheSomething[i], "OnWeapon_Precache"
        
g_hPrecacheHook_Post[iWeaponId] = RegisterHam(Ham_PrecacheSomething[i], "OnWeapon_Precache_Post"true
    } 

Quote:
Originally Posted by HamletEagle View Post
PHP Code:
for(new isizeof Somethingi++)
{
    
//your previous code here

And instead of szWeaponName you will use Something[i].
__________________
" In the end it doesn't even matter " - Linkin Park

Last edited by leonardo121; 08-09-2017 at 10:51.
leonardo121 is offline
Tripaloski
Member
Join Date: Jul 2017
Old 08-09-2017 , 10:58   Re: OnWeapon_Precache error
Reply With Quote #17

PHP Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2013 ITB CompuPhaseAMX Mod X Team

Error
Undefined symbol "iWeaponId" on line 115
Warning
Expression has no effect on line 115
Warning
Expression has no effect on line 115
Error
Expected token";"but found ")" on line 115
Error
Invalid expressionassumed zero on line 115
Error
Too many error messages on one line on line 115

Compilation aborted
.
4 Errors.
Could not locate output file C:\Users\Utilizador\Desktop\Plugins\NoCustumeSkins.amx (compile failed). 
Tripaloski is offline
Tripaloski
Member
Join Date: Jul 2017
Old 08-09-2017 , 10:59   Re: OnWeapon_Precache error
Reply With Quote #18

If I send the complete plugin you get it working correctly?
Tripaloski is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-09-2017 , 11:24   Re: OnWeapon_Precache error
Reply With Quote #19

No, we won't. You are in scripting HELP section, not "do it for me" section. You have to actually do it based on what people tell you.

Code from #16 is good, remove get_weaponname(iWeaponId, Something[i], charsmax(Something)) . Try to understand why you are doing something, then things will be much more clear. If you can't figure out, then ask and we will explain. You did the constant with all the weapon in order to replace get_weaponname, because it's not working in plugin_precache, so why would you still use that native?
__________________

Last edited by HamletEagle; 08-09-2017 at 11:27.
HamletEagle is offline
Tripaloski
Member
Join Date: Jul 2017
Old 08-09-2017 , 11:36   Re: OnWeapon_Precache error
Reply With Quote #20

I understand little of this.
If you remove the get_weaponname(iWeaponId, Something[i], charsmax(Something)) have error compiling.

PHP Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2013 ITB CompuPhaseAMX Mod X Team

Error
Undefined symbol "iWeaponId" on line 111
Error
Undefined symbol "iWeaponId" on line 112

2 Errors
.
Could not locate output file C:\Users\Utilizador\Desktop\Plugins\NoCustumeSkins.amx (compile failed). 
PHP Code:
public plugin_precache() 

    for(new 
isizeof Somethingi++) 
    { 
        
//get_weaponname(iWeaponId, Something[i], charsmax(Something)) 
         
        
g_hPrecacheHook[iWeaponId] = RegisterHam(Ham_PrecacheSomething[i], "OnWeapon_Precache"
        
g_hPrecacheHook_Post[iWeaponId] = RegisterHam(Ham_PrecacheSomething[i], "OnWeapon_Precache_Post"true
    } 

Tripaloski 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 16:16.


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