Raised This Month: $ Target: $400
 0% 

[CS:S] Is it possible to make a player speed save and load?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Risano
New Member
Join Date: Jun 2019
Old 06-01-2019 , 18:54   [CS:S] Is it possible to make a player speed save and load?
Reply With Quote #1

Hello!

I'd like to save and load the player's position,angular,velocity.
However, the plugins that are created can store locations and angles, but are not able to solve them because they do not store speed.
I need some help.
Below is a partial snippet of code


PHP Code:
new bool:g_bSaved[MAXPLAYERS 1];
new 
Float:g_fNew_CP[MAXPLAYERS 1][3][3];
new 
bool:g_bPrevSaved[MAXPLAYERS 1];

stock SavePosition(clientbool:menu)
{
    if(
GetEntityFlags(client))
    {
        
GetClientAbsOrigin(clientg_fNew_CP[client][0]);
        
GetClientEyeAngles(clientg_fNew_CP[client][1]);
        
g_bSaved[client] = true;
        
PrintToChat(client"%sCurrent location has been saved."g_sServerTag);
    }
    if(
menu)
    {
        
CPmenu(client);
    }
}

stock RestorePosition(clientbool:menu)
{
    if(
g_bSaved[client])
    {
        
TeleportEntity(clientg_fNew_CP[client][0], g_fNew_CP[client][1], NULL_VECTOR);
    }
    else
    {
        
PrintToChat(client"%sNo saved locations."g_sServerTag);
    }
    if(
menu)
    {
        
CPmenu(client);
    }


Last edited by Risano; 06-01-2019 at 19:52.
Risano is offline
farawayf
Senior Member
Join Date: Jan 2019
Old 06-01-2019 , 19:21   Re: [CS:S] Is it possible to make a player speed save and load?
Reply With Quote #2

You can check how it done on "shavit segmented style".
farawayf is offline
Risano
New Member
Join Date: Jun 2019
Old 06-02-2019 , 04:08   Re: [CS:S] Is it possible to make a player speed save and load?
Reply With Quote #3

Quote:
Originally Posted by farawayf View Post
You can check how it done on "shavit segmented style".
What part of the "shavit segmented style" plugin should you refer to?

Last edited by Risano; 06-02-2019 at 04:08.
Risano is offline
Kolapsicle
Senior Member
Join Date: Oct 2014
Old 06-02-2019 , 04:17   Re: [CS:S] Is it possible to make a player speed save and load?
Reply With Quote #4

PHP Code:
float velocity[3];
GetEntPropVector(clientProp_Data"m_vecVelocity"velocity); 
Kolapsicle is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 06-02-2019 , 16:32   Re: [CS:S] Is it possible to make a player speed save and load?
Reply With Quote #5

You need velocity along with origin and eye angles as Kolapsicle has provided the netprop for.
__________________
Neuro Toxin 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 04:56.


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