Raised This Month: $32 Target: $400
 8% 

Solved CSS - Is it possible to make a player float above ground?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
blackdevil72
Member
Join Date: Jun 2010
Location: Bordeaux (France)
Old 05-20-2019 , 03:24   CSS - Is it possible to make a player float above ground?
Reply With Quote #1

Hello!

As the title say I'd like to know is its possible to make a player float above ground. Not "fly", just float X above ground, that mean able to move, jump etc and still be affect by gravity while not touching ground.

I hope I was clear enought, I'm sorry if you need I can try to be more precise.

Thank you for future help!
__________________


Last edited by blackdevil72; 06-01-2019 at 09:31.
blackdevil72 is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 05-23-2019 , 08:01   Re: CSS - Is it possible to make a player float above ground?
Reply With Quote #2

Perhaps you could create an invisible entity with the height of X underneath the player, and make it solid for that particular player only? Not sure about implementation, just need to play around and test.
__________________
hleV is offline
blackdevil72
Member
Join Date: Jun 2010
Location: Bordeaux (France)
Old 05-23-2019 , 17:29   Re: CSS - Is it possible to make a player float above ground?
Reply With Quote #3

The entity would have to move everywhere at the same time as the play player. That seem a bit too much?

I've tried to play with some ideas but that did work:

PHP Code:
public void Make_Player_Foat(int client)
{
    
float ClientPosition[MAXPLAYERS][3]
    
float ClientPreviousHeight[MAXPLAYERS]

    if (
GetClientButtons(client) == IN_JUMP || GetClientButtons(client) == IN_FORWARD || GetClientButtons(client) == IN_BACK || GetClientButtons(client) == IN_MOVELEFT || GetClientButtons(client) == IN_MOVERIGHT && GetEntityMoveType(client) != MOVETYPE_WALK && Global_IsPlayerFreeze[client] == false)
        
SetEntityMoveType(clientMOVETYPE_WALK)

    else if (
GetClientButtons(client) != IN_JUMP || GetClientButtons(client) != IN_FORWARD || GetClientButtons(client) != IN_BACK || GetClientButtons(client) != IN_MOVELEFT || GetClientButtons(client) != IN_MOVERIGHT && GetEntityMoveType(client) != MOVETYPE_NONE && Global_IsPlayerFreeze[client] == false)
    {
        
GetClientAbsOrigin(clientClientPosition[client])

        if (
ClientPreviousHeight[client] != ClientPosition[client][2])
        {
            
ClientPosition[client][2] = ClientPosition[client][2] + Global_ModelHeightFix[client]
            
ClientPreviousHeight[client] = ClientPosition[client][2]

            
TeleportEntity(clientClientPosition[client], NULL_VECTORNULL_VECTOR)
            
SetEntityMoveType(clientMOVETYPE_NONE)
        }
    }

    
Make_Player_Foat(client)

When I do that th eplayer is teleported up to the maximum height. It theory it shouldn't happen. I don't see what I'm doing badly here.
__________________

blackdevil72 is offline
blackdevil72
Member
Join Date: Jun 2010
Location: Bordeaux (France)
Old 05-30-2019 , 21:24   Re: CSS - Is it possible to make a player float above ground?
Reply With Quote #4

Any one else with an idea?
__________________

blackdevil72 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 10:09.


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