AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help with a plugin (https://forums.alliedmods.net/showthread.php?t=187321)

sasukebr 06-11-2012 21:07

Help with a plugin
 
1 Attachment(s)
Hello friends here I am in need of a helping of you when I type / box to enable the glove does not show edited excuse me anything for my bad English

Liverwiz 06-11-2012 21:09

Re: Help with a plugin
 
I'm checking out your sma now....but in the future, if you please, when your code is less than like 10 MB, just copy paste it into the thread between [php] tags. It'll make for less hard drive space being taken up by us. And quicker replies.

YamiKaitou 06-11-2012 21:12

Re: Help with a plugin
 
Quote:

Originally Posted by Liverwiz (Post 1727033)
I'm checking out your sma now....but in the future, if you please, when your code is less than like 10 MB, just copy paste it into the thread between [php] tags. It'll make for less hard drive space being taken up by us. And quicker replies.

Sorry but hell no. Unless it is a short plugin or a snippet of the code, the SMA is preferred.

Liverwiz 06-11-2012 21:17

Re: Help with a plugin
 
Quote:

Originally Posted by YamiKaitou (Post 1727036)
Sorry but hell no. Unless it is a short plugin or a snippet of the code, the SMA is preferred.

ok....i guess 10M is pretty big. but a 2K file....gimme code.


SOLUTION: you don't actually show the model to anyone.
Code:

entity_set_string(id, EV_SZ_weaponmodel, "models/p_knife.mdl")
entity_set_string(id, EV_SZ_viewmodel, "models/v_box_blue.mdl")

will show your model to the indicated player, and on the indicated player. make sure to #include <engine>

and place those lines appropriately throughout your code.

Kreation 06-11-2012 21:22

Re: Help with a plugin
 
Quote:

Originally Posted by Liverwiz (Post 1727038)
ok....i guess 10M is pretty big. but a 2K file....gimme code.

Well, why didn't you say a 2KB file and not a 10MB? Durdurdur.

YamiKaitou 06-11-2012 21:31

Re: Help with a plugin
 
Quote:

Originally Posted by Liverwiz (Post 1727038)
ok....i guess 10M is pretty big. but a 2K file....gimme code.

Still disagree. Anything longer than 30 lines should be attached. It is much easier to read the code when viewing it in a text editor as compared to in a post

sasukebr 06-11-2012 21:37

Re: Help with a plugin
 
1 Attachment(s)
I'm new guy I have no experience with many being able to help me precache thank you

sasukebr 06-11-2012 21:38

Re: Help with a plugin
 
You can pass the edited sma ready

Liverwiz 06-11-2012 21:43

Re: Help with a plugin
 
Quote:

Originally Posted by sasukebr (Post 1727053)
I'm new guy I have no experience with many being able to help me precache thank you

what you had before was correct. the entity_set_string() SHOWS the models, it isn't the models themselves.

sasukebr 06-11-2012 21:49

Re: Help with a plugin
 
is how you post your edited the sma / box

Liverwiz 06-11-2012 21:55

Re: Help with a plugin
 
Quote:

Originally Posted by sasukebr (Post 1727058)
is how you post your edited the sma / box

i'm not writing your code for you. but i'll give you example from my code. deploy it accordingly.

PHP Code:

public Event_CurWeapon(id)
{
    if(!
is_user_alive(id) || !is_user_connected(id) || get_pcvar_num(toggle_pcvar) == 0
        return 
PLUGIN_CONTINUE
        
    
static weaponlevel
    weapon 
get_user_weapon(id)
    
level getLevel(id)
    if(
weapon == CSW_KNIFE && g_bknuckles[id])    //REMOVED: (weapon == CSW_KNIFE && g...
    
{
        
entity_set_string(idEV_SZ_viewmodel"models/v_bknuckles.mdl")
        
entity_set_string(idEV_SZ_weaponmodel"models/p_bknuckles.mdl")
        
        new 
Float:speed get_user_maxspeed(id) + HIGH_SPEED
        
        
switch( level )
        {
            case 
2:
            {    
// Run faster
                
set_user_maxspeed(idspeed)
            }
            case 
3:
            {    
// jump higher
                
set_user_gravity(idLOW_GRAVITY)
                
set_user_maxspeed(idspeed)
            }
            
// case 5: power ups
        
}
        if(
level 3)
        {
            
set_user_gravity(idLOW_GRAVITY)
            
set_user_maxspeed(idspeed)
        }
    }
    else
        
set_user_gravity(id1.0)
    return 
PLUGIN_CONTINUE


if you want to keep it to your knife, make sure to hook CurWeapon event. and entity_set_string will show it as the current weapon. make sure to keep your original plugin_precache()


All times are GMT -4. The time now is 02:03.

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