PDA

View Full Version : noclip



ORDI
21st February 2015, 23:18
hello everybody

someone here has a noclip/unclip script which can be publish?

i would like to do in rcon command or b3 command (/rcon unclip id) instead of activate cheat and do /noclip in console.

ORDI
xfire: ordi37zk

Tally
22nd February 2015, 07:25
hello everybody

someone here has a noclip/unclip script which can be publish?

i would like to do in rcon command or b3 command (/rcon unclip id) instead of activate cheat and do /noclip in console.

ORDI
xfire: ordi37zk

No cheat version - run your dedicated server in developer mode - run "devmap + mapname" instead of "map + mapname". All cheats are enabled in devmap mode.

ORDI
22nd February 2015, 09:25
yes but every players can do that. i would like to do when i want (those who have the rcon). or put that in b3 command

Ni3ls
22nd February 2015, 18:39
Spawn script_model in front of the player where he is looking. Link to. Shift or F to let him move towards the script_model.

ORDI
23rd February 2015, 11:11
i made this script:


unclip()
{
self endon("disconnect");
self endon("killed_player");
self endon("spawned_player");
self endon("spawned");
self endon("stop_noclip");

self.obj = spawn("script_origin",self.origin, 1);
self.obj.angles = self.angles;
self linkto(self.obj);
self disableweapon();
self iprintlnbold("^7Press ^3[^7MELEE^3]^7 to move!");
wait 0.1;
self iprintlnbold("^7Press ^3[^7F^3]^7 to stop!");
for(;;)
{
if(self meleebuttonpressed())
{
thing1 = anglestoforward(self getplayerangles());
thing2 = maps\mp\_utility::vectorScale( thing1, 11 );
position = self.origin + thing2;
self.obj.origin = position;
}
else if(self usebuttonPressed())
{
self notify("stop_noclip");
self unlink();
self enableweapon();
self.obj delete();
}
wait 0.01;
}
}
when i press f to stop, i am stuck
someone can help me?

Tally
23rd February 2015, 11:43
unclip()
{
self endon("disconnect");
self endon("killed_player");

self.obj = spawn("script_origin",self.origin, 1);
self.obj.angles = self.angles;
self linkto(self.obj);
self disableweapon();
self iprintlnbold("^7Press ^3[^7MELEE^3]^7 to move!");
wait 0.1;
self iprintlnbold("^7Press ^3[^7F^3]^7 to stop!");
for( ;; )
{
if( self meleebuttonpressed() )
{
thing1 = anglestoforward( self getplayerangles() );
thing2 = maps\mp\_utility::vectorScale( thing1, 11 );
position = self.origin + thing2;
self.obj.origin = position;
}
else if( self usebuttonPressed() )
{
self notify("stop_noclip");
self unlink();
wait( 0.05 );
if( isDefined( self.obj ) )
self.obj delete();

self enableweapon();
}

wait( 0.05 );
}
}


There was technically not much wrong with your code - it was just a question of timing - if a player is linked to any object, allow at least 1 server frame before you delete the object.

FYI - if you end a wait time with "killed_player", there is no point putting further notifications like "spawned" or "spawned_player" because the loop is already ended when you die. Every single time you use endon() it adds to the total amount of script variables you use, and if you use too many, your server will crash.

ORDI
23rd February 2015, 12:04
Thank you tally :D

i added something in the script because if you press the melee button after f button after melee button, it crash.


unclip()
{
self endon("disconnect");
self endon("killed_player");

self.obj = spawn("script_origin",self.origin, 1);
self.obj.angles = self.angles;
self linkto(self.obj);
self disableweapon();
self iprintlnbold("^7Press ^3[^7MELEE^3]^7 to move!");
wait 0.1;
self iprintlnbold("^7Press ^3[^7F^3]^7 to stop!");
for( ;; )
{
if( self meleebuttonpressed() )
{
if(!isDefined(self.obj))
{
self.obj = spawn("script_origin",self.origin, 1);
self.obj.angles = self.angles;
self linkto(self.obj);
self disableweapon();
}
thing1 = anglestoforward( self getplayerangles() );
thing2 = maps\mp\_utility::vectorScale( thing1, 11 );
position = self.origin + thing2;
self.obj.origin = position;
}
else if( self usebuttonPressed() )
{
self notify("stop_noclip");
self unlink();
wait( 0.05 );
if( isDefined( self.obj ) )
self.obj delete();

self enableweapon();
}

wait( 0.05 );
}
}