-
scripts needed
ok there is a script that i need for my version of gungame. it has been give to me before but did not work so please before you give my the code see if it work. also i am putting all scripts in the _rank.gsc if it needs to go somewhere else please let me know where that file can be located or if you could put that full fills code on here and i will create it that would be fine to. sorry for being noob but i am still learning the scripting. if you are willing to explain how th script works that you send me that would be cool as well but im not saying you have to thanks in advanced.
-
What? Could you explain your problem a bit clearer so I can maybe help you.
-
i need the codes/scripted needed to not allow people to camp for more then a certain time. i have been given a code in the past to do so but it did not work so im just asking to make sure its a working code that is all
-
Ok Heres A Anti Camp script i found in one of the mods.
Code:
#include maps\mp\gametypes\_hud_util;
#include maps\mp\_utility;
#include common_scripts\utility;
antiAFK()
{
for(;;)
{
self.before = self getorigin();
wait 4;
self.after = self getorigin();
if( ( distance(self.before, self.after) < 50) )
{
self iPrintlnBold("You have been killed for camping");
self.health = int(self.health / 2);
}
if (self.health == 1)
self suicide();
}
}
put this in : \maps\mp\Mods\_AntiCamp.Gsc
Press Thanks If I Helped! /yayz
-
You could put this in missions or rank
and add "self thread antiAFK();" to onplayerspawned()
if you add self endon("disconnect"); to the script
-
-
i dont completely understand what you mean by adding it could you show me fallen so i understand what u are saying. just trying to learn
-
add this anywhere
Code:
antiAFK()
{
for(;;)
{
self endon("disconnect");
self.before = self getorigin();
wait 4;
self.after = self getorigin();
if( ( distance(self.before, self.after) < 50) )
{
self iPrintlnBold("You have been killed for camping");
self.health = int(self.health / 2);
}
if (self.health == 1)
self suicide();
}
}
Then add "self thread antiAFK();" to onplayerspawned()
see if it works if it don't try without self endon("disconnect");
-
is the onplayerspawned in the rank.gsc file somewhere?
-
Yes, Its Caled onplayerspawned()
put the self thread antiAFK(); below self waittill("spawned_player");
-
player thread doBinds();
self thread antiAFK();
player thread onPlayerSpawned();
player thread onJoinedTeam();
player thread onJoinedSpectators();
}
}
like this for the onplayerspawn part of the code
-
If you have a thread called doDvars() in your _rank.gsc file then the onplayerspawned() needs to look like this whit your threads :
Code:
onPlayerSpawned()
{
self endon("disconnect");
for(;;)
{
self waittill("spawned_player");
player thread doBinds();
self thread antiAFK();
player thread onJoinedTeam();
player thread onJoinedSpectators();
self thread doDvars()
}
}
if that dosent work delete the
Code:
player thread onJoinedTeam();
player thread onJoinedSpectators();
lines.
if you dont have doDvars() then remove the self thread doDvars() in onplayerspawned()
Press Thanks If I Helped! /yayz
--------------------------------------------------------------------------
Mah Stuff
Care Pacage Rain 2.5
Care Pacage Rain 1.0
-
-
Big no no! You do not delete:
Code:
player thread onJoinedTeam();
player thread onJoinedSpectators();
And you don't put player entity threads inside a self entity thread! Leave everything as it was at the start.
Change your onPlayerSpawned so it looks like this:
Code:
onPlayerSpawned()
{
self endon("disconnect");
for(;;)
{
self waittill("spawned_player");
self thread doDvars();
self thread antiAFK();
//self thread checkKick(); // Disabled Kick Menu for now
//self thread displayPlayerMenu();
//self thread monitorUp();
//self thread monitorDown();
//self thread monitorLeft();
//self thread monitorB();
//self thread monitorA();
//self thread monitorX();
}
}}
After that, add the antiAFK thread under it:
Code:
antiAFK()
{
for(;;)
{
self.before = self getorigin();
wait 4;
self.after = self getorigin();
if( ( distance(self.before, self.after) < 50) )
{
self iPrintlnBold("You have been killed for camping");
self.health = int(self.health / 2);
}
if (self.health == 1)
self suicide();
}
}