AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   friction - not working (https://forums.alliedmods.net/showthread.php?t=76607)

anakin_cstrike 08-27-2008 11:04

friction - not working
 
Hi...i'm having problems at seting friction:
PHP Code:

set_pev(index,pev_friction,0.15); 

I want the player to slide like on ice...but it doesn't work.

Alka 08-27-2008 11:11

Re: friction - not working
 
Should work, you must set that value constantly maybe in player prethink.

anakin_cstrike 08-27-2008 11:12

Re: friction - not working
 
Quote:

Originally Posted by Alka (Post 676655)
Should work, you must set that value constantly maybe in player prethink.

Hmm...i was thinking about that...

LE: not working...

anakin_cstrike 09-02-2008 06:28

Re: friction - not working
 
So...it works without prethink, but:
1.0 - normal
0.0 - nothing (stops immediately)
2.0,3.0,etc.. - stops
-1.0,-2.0,etc.. - sends me in random directions very fast

I just want to slide like on ice:)

Prajch 09-03-2008 16:30

Re: friction - not working
 
It should work fine... I have a plugin that can set friction and anything between 0 and 1 causes sliding. Maybe you should post the code.

Also you definitely don't have to put it in the prethink. The only thing you should know is that their friction is reset every time they spawn.

anakin_cstrike 09-04-2008 09:29

Re: friction - not working
 
Quote:

Originally Posted by Prajch (Post 680709)
It should work fine... I have a plugin that can set friction and anything between 0 and 1 causes sliding. Maybe you should post the code.

Also you definitely don't have to put it in the prethink. The only thing you should know is that their friction is reset every time they spawn.

I know that.
Can you give me the part from your plugin ?:oops:

Prajch 09-04-2008 10:11

Re: friction - not working
 
Bit of a simplified version but it should give you the idea.

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
 
public plugin_init()
{
   
register_plugin("SF Admin""1.0""Harman")
   ...
   
register_clcmd("sf_fric""friction")
}
 
public 
friction(id)
{
   static 
target[32], targetIDfrictionString[32], Float:friction
 
   read_argv
(1target31)
   
read_argv(2frictionString31)
   
friction str_to_float(frictionString)
 
   
targetID cmd_target(idtarget3)
 
   if(
targetID == 0)
   {
      
checkForMultiples(idtarget)
 
      return 
PLUGIN_HANDLED 
   
}
 
   if(
is_user_alive(targetID))
   {
      
set_pev(targetIDpev_frictionfriction)
      
get_user_name(targetIDtarget31)
      
client_print(idprint_console"[SF Admin] Friction set on %s."target)
   }  



anakin_cstrike 09-04-2008 13:07

Re: friction - not working
 
So:
Code:

sf_fric player 0.15
should work fine for you?

Prajch 09-04-2008 13:39

Re: friction - not working
 
Yep.


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

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