Rules FAQ Members List Search Register Login

 Raised This Month: \$48 Target: \$400 12%

Author Message
blanko
Senior Member
Join Date: Aug 2008
Location: Wodka und EnergyDrink
 02-13-2019 , 06:00   [REQ] Dif gravity for CTs and Ts #1 Any way to make gravity different for CTs and Ts? Like Ts can jump way higher than cts? __________________
iceeedr
Senior Member
Join Date: Apr 2017
Location: Brazil
 02-13-2019 , 09:01   Re: [REQ] Dif gravity for CTs and Ts #2 An easy method would be this below, but there are better ways to achieve the same result. Code: ```/* Plugin generated by AMXX-Studio */ #include #include #include #include #include #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "arsmi" new CvarCtGravity, CvarTrGravity public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) CvarCtGravity = register_cvar("amx_ct_gravity", "800") CvarTrGravity = register_cvar("amx_tr_gravity", "500") RegisterHam(Ham_Spawn,"player","fwPlayerSpawn",1) } public fwPlayerSpawn( id ) { if(!is_user_alive(id)) return switch(cs_get_user_team(id)) { case CS_TEAM_T: set_user_gravity(id, get_pcvar_float(CvarTrGravity)) case CS_TEAM_CT: set_user_gravity(id, get_pcvar_float(CvarCtGravity)) } }``` __________________ List of Plugins Add me on Steam --> LINK Last edited by iceeedr; Yesterday at 09:21.
blanko
Senior Member
Join Date: Aug 2008
Location: Wodka und EnergyDrink
02-13-2019 , 19:16   Re: [REQ] Dif gravity for CTs and Ts
#3

Quote:
 Originally Posted by iceeedr An easy method would be this below, but there are better ways to achieve the same result. Code: ```/* Plugin generated by AMXX-Studio */ #include #include #include #include #include #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "arsmi" new CvarCtGravity, CvarTrGravity public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) CvarCtGravity = register_cvar("amx_ct_gravity", "800") CvarTrGravity = register_cvar("amx_tr_gravity", "500") RegisterHam(Ham_Spawn,"player","fwPlayerSpawn",1) } public fwPlayerSpawn( id ) { if(!is_user_connected(id) || !is_user_alive(id)) return new CsTeams:Team = cs_get_user_team(id) switch(Team) { case CS_TEAM_T: set_user_gravity(id, get_pcvar_float(CvarTrGravity)) case CS_TEAM_CT: set_user_gravity(id, get_pcvar_float(CvarCtGravity)) } }```
nothing happened
__________________
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
 Yesterday , 08:41   Re: [REQ] Dif gravity for CTs and Ts #4 That means you have another plugin that's blocking the effects from this one PS: iceeedr - "is_user_alive" also checks if the user is connected, you don't need both checks in there. Also the "Team" variable is unnecessary. __________________ YOU FOUND A BIG SECRET! ☄ My Plugins! (translate to English) ☄ OciXCrom's Rank System - give players something to play for! ☄ Chat Manager - take full control over your chat! ☄ CromChat - a better ColorChat! __________________
iceeedr
Senior Member
Join Date: Apr 2017
Location: Brazil
Yesterday , 08:45   Re: [REQ] Dif gravity for CTs and Ts
#5

Quote:
 Originally Posted by OciXCrom That means you have another plugin that's blocking the effects from this one PS: iceeedr - "is_user_alive" also checks if the user is connected, you don't need both checks in there. Also the "Team" variable is unnecessary.
@Ocix You're right though, I've experienced some "invalid player" errors, when just check if the player is alive, I know in the documentation it's written that by obvious if someone is alive it's because they're connected but in reality I've experienced some problems with that ... and as for the variable, I really do not know what I was thinking at the time: D
__________________
List of Plugins

OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
 Yesterday , 08:56   Re: [REQ] Dif gravity for CTs and Ts #6 Nope, it's not possible to experience such errors. "is_user_alive" is the only thing you need in this case - you can even check the function's code in Github: PHP Code: ``` static cell AMX_NATIVE_CALL is_user_alive(AMX *amx, cell *params) /* 1 param */{    int index = params[1];    if (index < 1 || index > gpGlobals->maxClients)    {        return FALSE;    }  ``` As you can see, the first thing it checks is if the user is connected. If you got errors, it was probably a different scenario. __________________ YOU FOUND A BIG SECRET! ☄ My Plugins! (translate to English) ☄ OciXCrom's Rank System - give players something to play for! ☄ Chat Manager - take full control over your chat! ☄ CromChat - a better ColorChat! __________________ Last edited by OciXCrom; Yesterday at 08:56.
blanko
Senior Member
Join Date: Aug 2008
Location: Wodka und EnergyDrink
Yesterday , 17:42   Re: [REQ] Dif gravity for CTs and Ts
#7

Quote:
 Originally Posted by OciXCrom That means you have another plugin that's blocking the effects from this one PS: iceeedr - "is_user_alive" also checks if the user is connected, you don't need both checks in there. Also the "Team" variable is unnecessary.
I don't know how to solve this... what kind of plugin could be blocking this one, buddy?
__________________
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
 Yesterday , 17:57   Re: [REQ] Dif gravity for CTs and Ts #8 Probably some that is changing the gravity. If you don't know which one has such an option, try disabling all of them and then enable 1 by 1 to find it. __________________ YOU FOUND A BIG SECRET! ☄ My Plugins! (translate to English) ☄ OciXCrom's Rank System - give players something to play for! ☄ Chat Manager - take full control over your chat! ☄ CromChat - a better ColorChat! __________________
PartialCloning
Senior Member
Join Date: Dec 2015
 Yesterday , 18:27   Re: [REQ] Dif gravity for CTs and Ts #9 It's not your plugins, the above plugin isn't setting the gravity correctly. Try this: PHP Code: ``` #include  #include  #include  #include   new gCvarGravity[4]; public plugin_init()  {      register_plugin("Team Specific Gravity", "1.0", "Partial Cloning");     gCvarGravity[0] = get_cvar_pointer("sv_gravity");     gCvarGravity[1] = register_cvar("sv_gravity_tt", "400");     gCvarGravity[2] = register_cvar("sv_gravity_ct", "800");     gCvarGravity[3] = register_cvar("sv_gravity_sp", "1900");     RegisterHam(Ham_Spawn, "player", "HamOnPlayerSpawnPost", 1); } public HamOnPlayerSpawnPost(id) {     if(!is_user_alive(id))         return HAM_IGNORED;     set_pev(id, pev_gravity, get_pcvar_float(gCvarGravity[_:cs_get_user_team(id)]) / get_pcvar_float(gCvarGravity[0]));     return HAM_IGNORED; }  ```

 Thread Tools Display Modes Linear Mode

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Server Discussion     Source Servers (SRCDS)     HL1 Servers (HLDS) AMX Mod X     News     Bug Reports     General     Off-Topic     Plugins         Suggestions / Requests         Approved Plugins         New Plugin Submissions         Unapproved/Old Plugins         Translation Request         High-Traffic Plugins             GunGame             UAIO (Ultimate All-In-One Plugin)             xREDIRECT             CSDM             AMX Super             RuneMod             Zombie Plague Mod             SuperHero Mod                 News                 Tech Support                 Scripting Help                 Off-Topic / General Chat                 Heroes                     Suggestions / Requests                     Approved Heroes                     New Submissions                     Unapproved/Old Heroes                         Module Heroes                     SuperHero Mod Stats - By 123                 (OLD) Bug Reports     Scripting         Scripting Help         Code Snippets/Tutorials         Module Coding     Donor Access SourceMod     News     General     Plugins         Plugins         Unapproved Plugins         Plugin/Gameplay Ideas and Requests         High-Traffic Plugins             SourceMod Anti-Cheat             Zombie:Reloaded             SourceBans             VSH / Freak Fortress             Store             SM_Hosties             HLstatsX:CE     Scripting     Extensions     Snippets and Tutorials     Donor Access     Metamod: Source         Metamod:Source Plugins         Metamod:Source Questions         Coding MM:S Plugins & SM Extensions Hosted Stuff     Asherkin's Plugins         TF2Items         TFDodgeball         SteamTools     Bail's Plugins         CSDM         CS:S DM Off-Topic & Trash     Off-Topic     Trash

All times are GMT -4. The time now is 14:49.

 DMCA - Archive - Top