AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need to make /gravity and /gravityoff (https://forums.alliedmods.net/showthread.php?t=156681)

alien100 05-10-2011 10:55

Need to make /gravity and /gravityoff
 
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

.Dare Devil. 05-10-2011 12:09

Re: Need to make /gravity and /gravityoff
 
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 :)

Doc-Holiday 05-10-2011 12:21

Re: Need to make /gravity and /gravityoff
 
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



alien100 05-10-2011 12:22

Re: Need to make /gravity and /gravityoff
 
thanks i try ...

how to give usp with max ammo ?

nnajko 05-10-2011 14:41

Re: Need to make /gravity and /gravityoff
 
Quote:

Originally Posted by alien100 (Post 1466873)
thanks i try ...

how to give usp with max ammo ?

PHP Code:

give_item(id"weapon_usp");
cs_set_user_bpammo(idCSW_USP90); 


SonicSonedit 05-10-2011 14:48

Re: Need to make /gravity and /gravityoff
 
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.

bibu 05-10-2011 16:03

Re: Need to make /gravity and /gravityoff
 
Just use strip_user_weapons native.

Exolent[jNr] 05-10-2011 17:15

Re: Need to make /gravity and /gravityoff
 
Quote:

Originally Posted by bibu (Post 1467034)
Just use strip_user_weapons native.

Along with setting OFFSET_PRIMARYWEAPON to 0.

alien100 05-12-2011 13:11

Re: Need to make /gravity and /gravityoff
 
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 :P

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

SonicSonedit 05-12-2011 14:58

Re: Need to make /gravity and /gravityoff
 
alien100
Use search button. It will help you. I guarantee it.


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

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