Raised This Month: $ Target: $400
 0% 

Need to make /gravity and /gravityoff


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alien100
Member
Join Date: May 2010
Location: Finland
Old 05-10-2011 , 10:55   Need to make /gravity and /gravityoff
Reply With Quote #1

Yeah i need to make command if
/gravity then it sets gravity 0.70
and if /gravity off it sets 0.80
+
is there any wiki to help learning ?

i need to give wips usp with max ammo how ?
fm_give_item(id, "weapon_usp");

+how to make that ct got anti flash
__________________
alien100 is offline
Send a message via MSN to alien100 Send a message via Skype™ to alien100
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 05-10-2011 , 12:09   Re: Need to make /gravity and /gravityoff
Reply With Quote #2

PHP Code:
 
public plugin_init()
}
register_clcmd("say /gravity""give_gravity")
}
 
public 
give_gravity(id)
{
 
fm_set_user_gravity(id0.80)
 
}
 
stock fm_set_user_gravity(indexFloat:gravity 1.0) {
set_pev(indexpev_gravitygravity);
return 
1;

just make bool and if you write /gravity bool = true and make just if bool = true then if you write again /gravity then bool is false again or something

Last edited by .Dare Devil.; 05-10-2011 at 12:11.
.Dare Devil. is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 05-10-2011 , 12:21   Re: Need to make /gravity and /gravityoff
Reply With Quote #3

PHP Code:
#include <fun>

new bool:NoGravity[33];

public 
plugin_init()
}
       
register_clcmd("say /gravity""GravityCMD");
       
register_clcmd("say_team /gravity""GravityCMD");
}
 
public 
GravityCMD(id)
{
    if(!
NoGravity[id])
    {
          
set_user_gravity(id0.70);
          
NoGravity[id] = true;
    }
    else
    {
          
set_user_gravity(id8.0);
          
NoGravity[id] = false;
     }

For gives just put that where you want to give the weapons also a native from fun. i have been told using this is better then the fm way. but i have no idea.
PHP Code:
give_item(id"weapon_usp");
cs_set_user_bpamo(id100CSW_USP); 
To strip weapons use this above your gives.
PHP Code:
public PlayerSpawn(id)
{
     
StripUserWeapons(id);
     
give_item(id"weapon_usp");
     
cs_set_user_bpammo(id100CSW_USP);

PHP Code:
StripUserWeapons(id)
{
    new 
iC4Ent get_pdata_cbase(idOFFSET_C4_SLOT);
    
    if( 
iC4Ent )
    {
        
set_pdata_cbase(idOFFSET_C4_SLOTFM_NULLENT);
    }

    
strip_user_weapons(id);
    
give_item(id"weapon_knife");
    
set_pdata_int(idOFFSET_PRIMARYWEAPON0);

    if( 
iC4Ent )
    {
        
entity_set_int(idEV_INT_weaponsentity_get_int(idEV_INT_weapons) | (1<<CSW_C4));
        
set_pdata_cbase(idOFFSET_C4_SLOTiC4Ent);
        
cs_set_user_bpammo(idCSW_C41);
        
cs_set_user_plant(id1);
    }
    return 
PLUGIN_HANDLED


Last edited by Doc-Holiday; 05-10-2011 at 12:26.
Doc-Holiday is offline
alien100
Member
Join Date: May 2010
Location: Finland
Old 05-10-2011 , 12:22   Re: Need to make /gravity and /gravityoff
Reply With Quote #4

thanks i try ...

how to give usp with max ammo ?
__________________

Last edited by alien100; 05-10-2011 at 12:30.
alien100 is offline
Send a message via MSN to alien100 Send a message via Skype™ to alien100
nnajko
Senior Member
Join Date: May 2009
Location: Sweden
Old 05-10-2011 , 14:41   Re: Need to make /gravity and /gravityoff
Reply With Quote #5

Quote:
Originally Posted by alien100 View Post
thanks i try ...

how to give usp with max ammo ?
PHP Code:
give_item(id"weapon_usp");
cs_set_user_bpammo(idCSW_USP90); 
nnajko is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 05-10-2011 , 14:48   Re: Need to make /gravity and /gravityoff
Reply With Quote #6

PHP Code:
StripUserWeapons(id)
{
    new 
iC4Ent get_pdata_cbase(idOFFSET_C4_SLOT);
    
    if( 
iC4Ent )
    {
        
set_pdata_cbase(idOFFSET_C4_SLOTFM_NULLENT);
    }

    
strip_user_weapons(id);
    
give_item(id"weapon_knife");
    
set_pdata_int(idOFFSET_PRIMARYWEAPON0);

    if( 
iC4Ent )
    {
        
entity_set_int(idEV_INT_weaponsentity_get_int(idEV_INT_weapons) | (1<<CSW_C4));
        
set_pdata_cbase(idOFFSET_C4_SLOTiC4Ent);
        
cs_set_user_bpammo(idCSW_C41);
        
cs_set_user_plant(id1);
    }
    return 
PLUGIN_HANDLED

wut.
__________________

SonicSonedit is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 05-10-2011 , 16:03   Re: Need to make /gravity and /gravityoff
Reply With Quote #7

Just use strip_user_weapons native.
bibu is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-10-2011 , 17:15   Re: Need to make /gravity and /gravityoff
Reply With Quote #8

Quote:
Originally Posted by bibu View Post
Just use strip_user_weapons native.
Along with setting OFFSET_PRIMARYWEAPON to 0.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
alien100
Member
Join Date: May 2010
Location: Finland
Old 05-12-2011 , 13:11   Re: Need to make /gravity and /gravityoff
Reply With Quote #9

hello i need to make that if player has ADMIN_LEVEL_H he can only use gravity and he has anti flash and i don't need to strip weapons i am using deathrun server and it strips automatically

EDIT: I learned and i changed comamnds to admin level h but i need antiflash
__________________

Last edited by alien100; 05-12-2011 at 13:37.
alien100 is offline
Send a message via MSN to alien100 Send a message via Skype™ to alien100
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 05-12-2011 , 14:58   Re: Need to make /gravity and /gravityoff
Reply With Quote #10

alien100
Use search button. It will help you. I guarantee it.
__________________

SonicSonedit 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 04:26.


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