AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Precache and Warnings (https://forums.alliedmods.net/showthread.php?t=173045)

leonard19941 11-29-2011 11:51

Precache and Warnings
 
1 Attachment(s)
Hello, I have put the shark mod and the furien mod changes that so that when you're TT and put the knife to have it different, in the shark mod copil me well and without errors, but by putting it on the server when TT and I'm I put the knife is close the server with the error below image, in the furien mod as copilot with 1 errors and when I put it to test it on the server fails me or anything but it just does not change the sword of the TT, please help.:cry:

tuty 11-29-2011 12:02

Re: Precache and Warnings
 
precache_model(garras)

and set viewmodel2 :arrow: garras

leonard19941 11-29-2011 12:07

Re: Precache and Warnings
 
The pev_viewmodel2 already placed at the bottom.

tuty 11-29-2011 13:35

Re: Precache and Warnings
 
no i mean, you have a garras as a string as global garras[ ] = "models/garras.mdl";


you should use that variable in all your places when you use " "

leonard19941 11-29-2011 14:05

Re: Precache and Warnings
 
1 Attachment(s)
PHP Code:

new garras[] = "models/garras.mdl" 

PHP Code:

public plugin_init()
    
register_event("CurWeapon""CurWeapon""be","1=1"

PHP Code:

public plugin_precache()
    
precache_model("models/garras.mdl"

PHP Code:

public CurWeapon(id){
    new 
weaponID read_data(2
    if(
weaponID != CSW_KNIFE)
        return 
PLUGIN_CONTINUE
    
if(cs_get_user_team(id) == CS_TEAM_T && is_user_alive(id)){
        
set_pev(idpev_viewmodel2"models/garras.mdl")
    }
    return 
PLUGIN_CONTINUE 


Thanks, it works but I get 1 warning.

B3N4K 11-29-2011 15:47

Re: Precache and Warnings
 
You declare garras but you never use it.
PHP Code:

new garras[] = "models/garras.mdl" 

PHP Code:

precache_model(garras

PHP Code:

set_pev(idpev_viewmodel2garras

Also are you sure you want to check if CfgFile exists? And if it does it wont precache?
I havent read the whole code but i guess that should be more likely like this:
PHP Code:

public plugin_precache()
{
    if( !
ReadCfgFile() )
    {
        
log_amx("Configuration file doesn't exist !!")
    }
    
precache_model("models/garras.mdl")


Config files are supposed to exist and it is also supposed to precache that model ;)

leonard19941 11-30-2011 09:15

Re: Precache and Warnings
 
Thanks, it works but I get 1 warning in shark mod and in furien mod.

B3N4K 11-30-2011 10:03

Re: Precache and Warnings
 
Then post your warning. (warning message that contains what is wrong and number of line where this warning appears)

leonard19941 11-30-2011 11:05

Re: Precache and Warnings
 
warnings do not give you the information, you just put a warning or they give you, in my case I get a warning in the shark mod and 1 warning in the furien mod

B3N4K 11-30-2011 15:32

Re: Precache and Warnings
 
1 Attachment(s)
Warning during compilation proccess gives brief info what is wrong and line where this particular error appears. If you can't provide warning message i can't help you and i guess anybody else won't help you too.

In attachment you can find screenshot how warning messages looks like. Post screenshot of your warning message and i will try to help you with that ;)


All times are GMT -4. The time now is 08:26.

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