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

CSG0 - noclipme edit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
XHUNTERX
Senior Member
Join Date: Aug 2019
Location: World
Old 10-15-2020 , 23:20   CSG0 - noclipme edit
Reply With Quote #1

https://forums.alliedmods.net/showthread.php?t=209155

Code:
#pragma semicolon 1
 
#include <sourcemod>
 
#define PLUGIN_VERSION "1.0.1"
 
public Plugin:myinfo =
{
    name        =    "Self Noclip",
    author        =    "killjoy",
    description    =    "personal noclip for Donators",
    version        =    PLUGIN_VERSION,
    url            =    "http://www.epic-nation.com"
};
 
public OnPluginStart()
{
    RegAdminCmd("sm_noclipme",NoclipMe,ADMFLAG_RESERVATION,"Toggles noclip on yourself");
}
 
public Action:NoclipMe(client, args)
{
	decl String:sAuthID[MAX_NAME_LENGTH];
	decl String:strName[MAX_NAME_LENGTH];
	GetClientAuthId(client, AuthId_Steam2, sAuthID, sizeof(sAuthID));
	GetClientName(client, strName, sizeof(strName));
	
	if( client < 1 || !IsClientInGame(client) || !IsPlayerAlive(client ))
	{
		ReplyToCommand(client, "\x04[SM] \x05You need to be alive to use noclip");
		return Plugin_Handled;
	}
	if (GetEntityMoveType(client) != MOVETYPE_NOCLIP)
	{
		LogAction(client, client, "%s (%s) Enabled noclip", strName, sAuthID);
		SetEntityMoveType(client, MOVETYPE_NOCLIP);
		ReplyToCommand(client, "\x04[SM] \x05Noclip Enabled");
	}
	else
	{
		LogAction(client, client, "%s (%s) Disabled noclip", strName, sAuthID);
		SetEntityMoveType(client, MOVETYPE_WALK);
		ReplyToCommand(client, "\x04[SM] \x05Noclip Disabled");
	}
	return Plugin_Handled;
}
hello;
Can you add time + round limit to this plugin?
each round can be used 1 time
Stays active for 5 seconds then returns to normal

not just ADMFLAG_RESERVATION ( every living player can use )

thanks

Last edited by XHUNTERX; 10-15-2020 at 23:28.
XHUNTERX is offline
NanoC
Veteran Member
Join Date: Jan 2016
Location: Argentina
Old 10-15-2020 , 23:24   Re: CSG0 - noclipme edit
Reply With Quote #2

Time and cooldown? What do you mean?
__________________
NanoC is offline
Send a message via Skype™ to NanoC
XHUNTERX
Senior Member
Join Date: Aug 2019
Location: World
Old 10-15-2020 , 23:40   Re: CSG0 - noclipme edit
Reply With Quote #3

Quote:
Originally Posted by NanoC View Post
Time and cooldown? What do you mean?
each round can be used 1 time
Stays active for 5 seconds then returns to normal

thanks
XHUNTERX is offline
SSheriFF
AlliedModders Donor
Join Date: May 2020
Location: Israel
Old 10-15-2020 , 23:54   Re: CSG0 - noclipme edit
Reply With Quote #4

Quote:
Originally Posted by XHUNTERX View Post
each round can be used 1 time
Stays active for 5 seconds then returns to normal

thanks
I also added that after the 5 seconds over the client will be teleported to the place he was when he used the command so he wont get stucked.
PHP Code:
#pragma semicolon 1
 
#include <sourcemod>
#include <sdktools>
#define PLUGIN_VERSION "1.0.1"

bool g_bUsed[MAXPLAYERS 1] =  { false };
float g_fClientPos[MAXPLAYERS 1][3];
public 
Plugin myinfo =
{
    
name        =    "Self Noclip",
    
author        =    "killjoy",
    
description    =    "personal noclip for Donators",
    
version        =    PLUGIN_VERSION,
    
url            =    "http://www.epic-nation.com"
};
 
public 
OnPluginStart()
{
    
RegConsoleCmd("sm_noclipme",NoclipMe,"Toggles noclip on yourself");
    
HookEvent("round_start"OnRoundStart);
}
 public 
void OnRoundStart(Event event, const char[] namebool dontBroadcast)
{
    for (
int i 1<= MaxClientsi++)
    {
        
g_bUsed[i] = false;
    }
}
public 
Action NoclipMe(int clientint args)
{
    
char sAuthID[MAX_NAME_LENGTH];
    
GetClientAuthId(clientAuthId_Steam2sAuthIDsizeof(sAuthID));
    
GetClientAbsOrigin(clientg_fClientPos[client]);
    if( 
client || !IsClientInGame(client) || !IsPlayerAlive(client ))
    {
        
ReplyToCommand(client"\x04[SM] \x05You need to be alive to use noclip");
        return 
Plugin_Handled;
    }
    if (
GetEntityMoveType(client) != MOVETYPE_NOCLIP && !g_bUsed[client])
    {
        
CreateTimer(5.0StopNoclipclient);
        
g_bUsed[client] = true;
        
LogAction(clientclient"%N (%s) Enabled noclip"clientsAuthID);
        
SetEntityMoveType(clientMOVETYPE_NOCLIP);
        
ReplyToCommand(client"\x04[SM] \x05Noclip Enabled");
    }
    return 
Plugin_Handled;
}
public 
Action StopNoclip(Handle timerint client)
{
    
SetEntityMoveType(clientMOVETYPE_WALK);
    
TeleportEntity(clientg_fClientPos[client], NULL_VECTORNULL_VECTOR);
    
PrintToChat(client"\x04[SM] \x05Noclip Disabled");

__________________
Taking small private requests (Free) and big private requests (Paid).
Contact me via Discord: WilDick#1524

My Plugins:
SSheriFF is offline
NanoC
Veteran Member
Join Date: Jan 2016
Location: Argentina
Old 10-16-2020 , 00:24   Re: CSG0 - noclipme edit
Reply With Quote #5

Just in case you want to control timer and teleport, i've added 2 cvars on Sherif's code to do it.
  • sm_noclipme_teleport - Teleport player to the place he was when he used the command so he wont get stucked. 1 = Enabled | 0 = Disabled (Default 1)
  • sm_noclipme_timer - Time in seconds to disable noclip on player (Default 5)

Source Code:
Spoiler
Attached Files
File Type: smx NoclipMe.smx (13.3 KB, 56 views)
__________________

Last edited by NanoC; 10-16-2020 at 00:24.
NanoC is offline
Send a message via Skype™ to NanoC
XHUNTERX
Senior Member
Join Date: Aug 2019
Location: World
Old 10-16-2020 , 01:03   Re: CSG0 - noclipme edit
Reply With Quote #6

you are amazing thank you so much
but I forgot to say the most important thing
Using this command should be banned for 60 seconds each time the round starts.
is it possible ?
XHUNTERX is offline
SSheriFF
AlliedModders Donor
Join Date: May 2020
Location: Israel
Old 10-16-2020 , 01:12   Re: CSG0 - noclipme edit
Reply With Quote #7

Quote:
Originally Posted by XHUNTERX View Post
you are amazing thank you so much
but I forgot to say the most important thing
Using this command should be banned for 60 seconds each time the round starts.
is it possible ?
PHP Code:
#pragma semicolon 1
 
#include <sourcemod>
#include <sdktools>
#include <multicolors>
#define PLUGIN_VERSION "1.0.1"

#pragma newdecls required

bool g_bUsed[MAXPLAYERS 1] = {false, ...};
bool g_bTimePassed false;
float g_fClientPos[MAXPLAYERS 1][3];
ConVar  g_cTeleport,
        
g_cTimer;

public 
Plugin myinfo =
{
    
name        =   "Self Noclip",
    
author    "killjoy",
    
description =    "personal noclip for Donators",
    
version  =    PLUGIN_VERSION,
    
url   =    "http://www.epic-nation.com"
};
 
public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_noclipme",NoclipMe,"Toggles noclip on yourself");
    
HookEvent("round_start"OnRoundStart);
    
    
g_cTeleport CreateConVar("sm_noclipme_teleport""1""Teleport player to the place he was when he used the command so he wont get stucked. 1 = Enabled | 0 = Disabled (Default 1)");
    
g_cTimer    CreateConVar("sm_noclipme_timer""5",   "Time in seconds to disable noclip on player (Default 5)");
}

public 
void OnRoundStart(Event event, const char[] namebool dontBroadcast)
{
    for(
int i 1<= MaxClientsi++)
    {
        
g_bUsed[i] = false;
    }
    
g_bTimePassed false;
    
CreateTimer(60.0Timer_TimePassed);
}

public 
Action NoclipMe(int clientint args)
{
    
char sAuthID[MAX_NAME_LENGTH];
    
GetClientAuthId(clientAuthId_Steam2sAuthIDsizeof(sAuthID));
    
GetClientAbsOrigin(clientg_fClientPos[client]);

    if( 
client || !IsClientInGame(client) || !IsPlayerAlive(client ))
    {
        
CPrintToChat(client"{green}[Noclip]{default} You have to be alive to use {green}noclip");
        return 
Plugin_Handled;
    }

    if (
GetEntityMoveType(client) != MOVETYPE_NOCLIP && !g_bUsed[client] && g_bTimePassed)
    {
        
CreateTimer(g_cTimer.FloatValueTimer_StopNoclipclient);
        
g_bUsed[client] = true;
        
LogAction(clientclient"%N (%s) Enabled noclip"clientsAuthID);
        
SetEntityMoveType(clientMOVETYPE_NOCLIP);
        
CPrintToChat(client"{green}[Noclip]{default} Noclip {green}enabled.");
    }
    return 
Plugin_Handled;
}

public 
Action Timer_StopNoclip(Handle timerint client)
{
    
SetEntityMoveType(clientMOVETYPE_WALK);
    if(
g_cTeleport.IntValue >= 1)
    {
        
TeleportEntity(clientg_fClientPos[client], NULL_VECTORNULL_VECTOR);
    }
    
CPrintToChat(client"{green}[Noclip]{default} Noclip {darkred}disabled.");
}
public 
Action Timer_TimePassed(Handle timer)
{
    
g_bTimePassed true;

__________________
Taking small private requests (Free) and big private requests (Paid).
Contact me via Discord: WilDick#1524

My Plugins:
SSheriFF is offline
XHUNTERX
Senior Member
Join Date: Aug 2019
Location: World
Old 10-16-2020 , 02:01   Re: CSG0 - noclipme edit
Reply With Quote #8

Quote:
sm_noclipme_teleport - Teleport player to the place he was when he used the command so he wont get stucked. 1 = Enabled | 0 = Disabled (Default 1)
Could something like this happen instead of this feature?

example;

Quote:
csgo/addons/sourcemod/configs/noclipme/de_dust2.cfg
Quote:
"locations"
{
"1"
{
"location_X" "1191.6"
"location_Y" "19.0"
"location_Z" "64.0"
}
}
Quote:
csgo/addons/sourcemod/configs/noclipme/de_mirage.cfg
Quote:
"locations"
{
"1"
{
"location_X" "-216.7"
"location_Y" "95.8"
"location_Z" "200.0"
}
}


so I can choose where to teleport for each map

Last edited by XHUNTERX; 10-16-2020 at 02:02.
XHUNTERX is offline
SSheriFF
AlliedModders Donor
Join Date: May 2020
Location: Israel
Old 10-16-2020 , 03:57   Re: CSG0 - noclipme edit
Reply With Quote #9

Quote:
Originally Posted by XHUNTERX View Post
Could something like this happen instead of this feature?

example;











so I can choose where to teleport for each map
You have to create a file in this directory: "addons/sourcemod/configs/noclipme/locations.cfg"
The file should look like that:
Code:
"Locations"
{
   "mapname"
   {
      "location_X" "-216.7"
      "location_Y" "95.8"
      "location_Z" "200.0"
    }
   "mapname2"
   {
      "location_X" "-123.5"
      "location_Y" "95.8"
      "location_Z" "200.0"
    }
}
Also I added a command for flag "z" / "ROOT" (sm_setpos) and it will type your current position on the map to the file on the entry of the current map.
Attached Files
File Type: sp Get Plugin or Get Source (Noclip.sp - 52 views - 4.2 KB)
__________________
Taking small private requests (Free) and big private requests (Paid).
Contact me via Discord: WilDick#1524

My Plugins:

Last edited by SSheriFF; 10-16-2020 at 06:07.
SSheriFF is offline
XHUNTERX
Senior Member
Join Date: Aug 2019
Location: World
Old 10-16-2020 , 05:54   Re: CSG0 - noclipme edit
Reply With Quote #10

Quote:
You have to create a file in this directory: "addons/sourcemod/configs/noclipme/locations.cfg"
I created the file you said but it doesn't automatically save ( sm_setpos )
Quote:
You set your current positon succesfully
(this message appears, but locations are not saved)
works when i manually enter locations

Last edited by XHUNTERX; 10-16-2020 at 06:01.
XHUNTERX 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 08:09.


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