AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   MOVETYPE_NOCLIP with gravity and physics? (https://forums.alliedmods.net/showthread.php?t=313882)

GasmoN 01-26-2019 12:55

MOVETYPE_NOCLIP with gravity and physics?
 
Is there any way to make that player X can go through all other players and all other players can go through player X ONLY but not through each other?
Basicly, I need what this plugin is doing but only with different method.
https://forums.alliedmods.net/showthread.php?p=562944
I don't want to use server_frame, Touch, or any other forwards.
I tried something like this:

PHP Code:

set_pev(idpev_movetypeMOVETYPE_NOCLIP)
set_pev(idpev_solidSOLID_BSP


But I want that player can walk/run/jump around the map and be able to go through other players, and not "fly" with noclip.

gabuch2 01-26-2019 13:38

Re: MOVETYPE_NOCLIP with gravity and physics?
 
pev_groupinfo, however, it will make him invisible to other players, so you need to render him with AddToFullpack

GasmoN 01-26-2019 14:37

Re: MOVETYPE_NOCLIP with gravity and physics?
 
Okay, I managed to do this with pev_groupinfo. (When I use /aspec command, I move all players to group 1 and me to group 2) but now I can't see other players and they can't see me. How can I render me to them and them to me? I need example since didn't worked with AddToFullpack so far, but I did found this https://www.amxmodx.org/api/fakemeta..._AddToFullPack

gabuch2 01-26-2019 14:39

Re: MOVETYPE_NOCLIP with gravity and physics?
 
Check out my thread from some days ago.

GasmoN 01-26-2019 14:51

Re: MOVETYPE_NOCLIP with gravity and physics?
 
I don't get it at all now.

This is the part where i go to aspec but I don't know what do I need to add to render players.

PHP Code:

    if(!g_IsAspec[id])
    {
        
g_IsAspec[id] = true;
        
        if(
cs_get_user_team(id) != CS_TEAM_CT)
        {
            
cs_set_user_team(idCS_TEAM_CT)
            
ExecuteHamB(Ham_CS_RoundRespawnid)
        }
        else
        {
            
ExecuteHamB(Ham_CS_RoundRespawnid)
        }
        
        
set_user_rendering(idkRenderFxDistort000kRenderTransAdd127);
        
set_user_godmode(id1)
        
cs_set_user_team(idCS_TEAM_SPECTATOR)
        
set_group(id2)
        new 
i;
        new 
mp get_maxplayers()
        
        for(
1<= mpi++)
        {
            if(!
is_user_alive(i) || id == i)
            continue;
            
            
set_group(iGROUP_DEFAULT)
        }



JocAnis 01-26-2019 21:24

Re: MOVETYPE_NOCLIP with gravity and physics?
 
My suggestion is not to use grouinfo, but setting aspec-ent semiclip (solid_not and solid_slidebox) and make it invis to other players, it will work 100%.. See example in prokreedz plugin

GasmoN 01-27-2019 07:09

Re: MOVETYPE_NOCLIP with gravity and physics?
 
Quote:

Originally Posted by JocAnis (Post 2636775)
My suggestion is not to use grouinfo, but setting aspec-ent semiclip (solid_not and solid_slidebox) and make it invis to other players, it will work 100%.. See example in prokreedz plugin

I tried that, but that way players can go through me but I can't go through them.
I set all players to be solid_slidebox and me to be solid_not.

JocAnis 01-27-2019 08:42

Re: MOVETYPE_NOCLIP with gravity and physics?
 
Show your code? I think you didnt made it good with indexes

GasmoN 01-27-2019 13:20

Re: MOVETYPE_NOCLIP with gravity and physics?
 
PHP Code:

public player_spawn_post(id)
{
        if(!
is_user_alive(id))
        return;

        if(
g_IsAspec[id])
        return;

        
set_pev(idpev_solidSOLID_SLIDEBOX)


PHP Code:

public cmd_aspec(id)
{
    if(!
access(idADMIN_RCON))
    return 
PLUGIN_HANDLED;
    
    if(!
g_IsAspec[id])
    {
        
g_IsAspec[id] = true;
        
        if(
cs_get_user_team(id) != CS_TEAM_CT)
        {
            
cs_set_user_team(idCS_TEAM_CT)
            
ExecuteHamB(Ham_CS_RoundRespawnid)
        }
        else
        {
            
ExecuteHamB(Ham_CS_RoundRespawnid)
        }
        
        
set_user_rendering(idkRenderFxDistort000kRenderTransAdd60);
        
set_user_godmode(id1)
        
cs_set_user_team(idCS_TEAM_SPECTATOR)
                
set_pev(idpev_solidSOLID_NOT)
    }
    else
    {        
        
g_IsAspec[id] = false;
        
BackToTeam(id)
    }
    
    return 
PLUGIN_HANDLED;



JocAnis 01-27-2019 14:15

Re: MOVETYPE_NOCLIP with gravity and physics?
 
w8..you want to go through ALL and ALL through you? i think its just simple: SOLID_NOT (cmd_aspec)..unless you have some other plugin which is doing semiclip things ?


All times are GMT -4. The time now is 20:26.

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