Raised This Month: $12 Target: $400
 3% 

How can you change a players position or speed?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kingnugget
Junior Member
Join Date: Apr 2005
Old 04-17-2005 , 14:15   How can you change a players position or speed?
Reply With Quote #1

I am looking for a way to change a players direction, vertical speed and position in a map.

What is the best way to do this??

I can see my player position info with playerinfo->GetAbsOrigin(); but there is no set function!

In Mattie's plugin he uses the edict value alot i.e. SetEdictValue(pEdict, PLAYER_HEALTH, value); where is the list of these values, are there any for player position and speed?

I did some stuff with AMX a long time ago and want to convert my old plugins for CS Source.

If anyone can help that'd be great.
Kingnugget is offline
Sekkusu
Junior Member
Join Date: Dec 2004
Old 04-18-2005 , 17:17  
Reply With Quote #2

Use ->Teleport to teleport them to a certain location and to give them a vector of force in a certain direction.
Sekkusu is offline
Kingnugget
Junior Member
Join Date: Apr 2005
Old 04-20-2005 , 08:24  
Reply With Quote #3

Thanks, I'll try that.

Another question I had was to do with where to manipulate these properties. When I wrote some old AMX mods I used their task functions to create and delete tasks to manipulate player properties continuously.

I believe that SourceMod will provide similar functionality, but what can I do until a proper SourceMod release?

I was thinking that I could do some operations on each GameFrame function call, but think that this wouldn't be the best idea. At the moment I am getting a crash when I add any player manipulation in the GameFrame function so haven't been able to test, but I think adding too much to GameFrame will really slow down the game.

Am I wrong?
Is GameFrame the place to do these things??
Kingnugget is offline
sslice
Senior Member
Join Date: Feb 2005
Location: Texas, USA
Old 04-20-2005 , 17:39  
Reply With Quote #4

What exactly are you trying to do? I don't think it would require GameFrame.
__________________
sslice is offline
Kingnugget
Junior Member
Join Date: Apr 2005
Old 04-21-2005 , 05:55  
Reply With Quote #5

I am trying to change a players properties on a regular basis.

When a player presses and holds a key, (i.e. create a client command: +speed), I want to accelerate that players speed (velocity.x += 5) until they let go of the key (client command: -speed). If the calculation is only done once on the client command +speed the speed will increase once, but not accelerate, i.e. velocity = 10, then 15, then 20, then 25... until the player releases the key.

I want to manipulate the player regularly, not just on the client command.
In AMX mod this could have been done in a separate thread, how can I do this in the new system?
Kingnugget is offline
Sekkusu
Junior Member
Join Date: Dec 2004
Old 04-21-2005 , 18:25  
Reply With Quote #6

Looks like you'll need to do it in Game Frame or hook the player's Think function (eww). This isn't going to be very smooth, either, since most of this stuff is predicted client-side, so you'll be changing server-side data and it'll snap to the right thing for the player. That's how most things are, velocity probably does too.
Sekkusu is offline
Reply



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 01:02.


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