Raised This Month: $ Target: $400
 0% 

friction - not working


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 08-27-2008 , 11:04   friction - not working
Reply With Quote #1

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.
__________________

anakin_cstrike is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 08-27-2008 , 11:11   Re: friction - not working
Reply With Quote #2

Should work, you must set that value constantly maybe in player prethink.
Alka is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 08-27-2008 , 11:12   Re: friction - not working
Reply With Quote #3

Quote:
Originally Posted by Alka View Post
Should work, you must set that value constantly maybe in player prethink.
Hmm...i was thinking about that...

LE: not working...
__________________


Last edited by anakin_cstrike; 08-27-2008 at 12:04.
anakin_cstrike is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 09-02-2008 , 06:28   Re: friction - not working
Reply With Quote #4

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
__________________

anakin_cstrike is offline
Prajch
Senior Member
Join Date: Dec 2007
Location: anger++
Old 09-03-2008 , 16:30   Re: friction - not working
Reply With Quote #5

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.
Prajch is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 09-04-2008 , 09:29   Re: friction - not working
Reply With Quote #6

Quote:
Originally Posted by Prajch View Post
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 ?
__________________

anakin_cstrike is offline
Prajch
Senior Member
Join Date: Dec 2007
Location: anger++
Old 09-04-2008 , 10:11   Re: friction - not working
Reply With Quote #7

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)
   }  

Prajch is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 09-04-2008 , 13:07   Re: friction - not working
Reply With Quote #8

So:
Code:
sf_fric player 0.15
should work fine for you?
__________________

anakin_cstrike is offline
Prajch
Senior Member
Join Date: Dec 2007
Location: anger++
Old 09-04-2008 , 13:39   Re: friction - not working
Reply With Quote #9

Yep.
Prajch 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 03:09.


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