View Single Post
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