This commit is contained in:
ineed bots 2024-01-04 16:05:38 -06:00
parent 8acd9a282e
commit 541b0832e3
10 changed files with 2808 additions and 2802 deletions

View File

@ -1,21 +1,27 @@
# try to mimic the original gsc provided
# mode=ghc
mode=c
style=allman
indent=tab
indent=force-tab=2
lineend=windows
pad-oper
pad-paren-in
pad-header
# delete-empty-lines
# pad-brackets-in
fill-empty-lines
squeeze-lines=2
squeeze-ws
break-one-line-headers
add-braces
remove-comment-prefix
break-blocks
# remove-braces
indent-switches
indent-cases
indent-after-parens
indent-col1-comments
remove-comment-prefix

View File

@ -4,7 +4,7 @@ root = true
indent_style = tab
indent_size = 2
charset = latin1
trim_trailing_whitespace = true
trim_trailing_whitespace = false
insert_final_newline = true
[*.md]

View File

@ -6,12 +6,12 @@
// Code Callback functions
/*================
Called by code after the level's main script function has run.
================*/
Called by code after the level's main script function has run.
================*/
CodeCallback_StartGameType()
{
// If the gametype has not beed started, run the startup
if(!isDefined(level.gametypestarted) || !level.gametypestarted)
if ( !isDefined( level.gametypestarted ) || !level.gametypestarted )
{
[[level.callbackStartGameType]]();
@ -26,71 +26,71 @@ CodeCallback_StartGameType()
}
/*================
Called when a player begins connecting to the server.
Called again for every map change or tournement restart.
Called when a player begins connecting to the server.
Called again for every map change or tournement restart.
Return undefined if the client should be allowed, otherwise return
a string with the reason for denial.
Return undefined if the client should be allowed, otherwise return
a string with the reason for denial.
Otherwise, the client will be sent the current gamestate
and will eventually get to ClientBegin.
Otherwise, the client will be sent the current gamestate
and will eventually get to ClientBegin.
firstTime will be qtrue the very first time a client connects
to the server machine, but qfalse on map changes and tournement
restarts.
================*/
firstTime will be qtrue the very first time a client connects
to the server machine, but qfalse on map changes and tournement
restarts.
================*/
CodeCallback_PlayerConnect()
{
self endon("disconnect");
self endon( "disconnect" );
[[level.callbackPlayerConnect]]();
}
/*================
Called when a player drops from the server.
Will not be called between levels.
self is the player that is disconnecting.
================*/
Called when a player drops from the server.
Will not be called between levels.
self is the player that is disconnecting.
================*/
CodeCallback_PlayerDisconnect()
{
self notify("disconnect");
self notify( "disconnect" );
[[level.callbackPlayerDisconnect]]();
}
/*================
Called when a player has taken damage.
self is the player that took damage.
================*/
CodeCallback_PlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset)
Called when a player has taken damage.
self is the player that took damage.
================*/
CodeCallback_PlayerDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset )
{
self endon("disconnect");
[[level.callbackPlayerDamage]](eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset);
self endon( "disconnect" );
[[level.callbackPlayerDamage]]( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset );
}
/*================
Called when a player has been killed.
self is the player that was killed.
================*/
CodeCallback_PlayerKilled(eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration)
Called when a player has been killed.
self is the player that was killed.
================*/
CodeCallback_PlayerKilled( eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration )
{
self endon("disconnect");
[[level.callbackPlayerKilled]](eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration);
self endon( "disconnect" );
[[level.callbackPlayerKilled]]( eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration );
}
/*================
Called when a player has been killed, but has last stand perk.
self is the player that was killed.
================*/
CodeCallback_PlayerLastStand(eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration )
Called when a player has been killed, but has last stand perk.
self is the player that was killed.
================*/
CodeCallback_PlayerLastStand( eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration )
{
self endon("disconnect");
[[level.callbackPlayerLastStand]](eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration );
self endon( "disconnect" );
[[level.callbackPlayerLastStand]]( eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration );
}
//=============================================================================
/*================
Setup any misc callbacks stuff like defines and default callbacks
================*/
Setup any misc callbacks stuff like defines and default callbacks
================*/
SetupCallbacks()
{
SetDefaultCallbacks();
@ -106,9 +106,9 @@ SetupCallbacks()
}
/*================
Called from the gametype script to store off the default callback functions.
This allows the callbacks to be overridden by level script, but not lost.
================*/
Called from the gametype script to store off the default callback functions.
This allows the callbacks to be overridden by level script, but not lost.
================*/
SetDefaultCallbacks()
{
level.callbackStartGameType = maps\mp\gametypes\_globallogic::Callback_StartGameType;
@ -120,11 +120,11 @@ SetDefaultCallbacks()
}
/*================
Called when a gametype is not supported.
================*/
Called when a gametype is not supported.
================*/
AbortLevel()
{
println("Aborting level - gametype is not supported");
println( "Aborting level - gametype is not supported" );
level.callbackStartGameType = ::callbackVoid;
level.callbackPlayerConnect = ::callbackVoid;
@ -133,13 +133,13 @@ AbortLevel()
level.callbackPlayerKilled = ::callbackVoid;
level.callbackPlayerLastStand = ::callbackVoid;
setdvar("g_gametype", "dm");
setdvar( "g_gametype", "dm" );
exitLevel(false);
exitLevel( false );
}
/*================
================*/
================*/
callbackVoid()
{
}