// =============================================================================== // DESCRIPTION: Abstract class for player // CALLED BY: playerjoin // PARAMS: id: clientid, idx: index // TYPE: Server-Side // =============================================================================== // Init ========================================================================== @INIT if [__debug == 1] goto DEBUG goto SCRIPT // =============================================================================== // Debug ========================================================================= @DEBUG Echo #__debug_prefix#"Calling script _SVR_PLAYER" goto SCRIPT // =============================================================================== // Script ======================================================================== @SCRIPT if [__debug == 1] Echo #__debug_prefix#"Calling method _SVR_PLAYER::"#GetScriptParam(::)# goto #GetScriptParam(::)# goto EOF /** / * "Registers a client so we can keep track of him" / * @args clientid / ** / @REGISTER Set __clients [__clients + 1] Set __clients_max_idx [__clients_max_idx] SendMessage #GetScriptParam(clientid)# "^r[DUAL ARENA] ^yWelcome to TEAM DEATHMATCH the rules:" SendMessage #GetScriptParam(clientid)# "^r[DUAL ARENA] ^y- When get killed you join the otherside" SendMessage #GetScriptParam(clientid)# "^r[DUAL ARENA] ^y- If one team gets emptied it loses. NEXT GAME!" goto EOF /** / * "Destroy the tracking of an client" / * @args clientid / ** / @UNREGISTER Set __clients [__clients - 1] echo #__debug_prefix#"UNREGISTER: clientid: "#GetScriptParam(clientid)# goto EOF /** / * "Handles the spawning of a client" / * @args index, clientid / ** / @JOIN Set _tmp_team_one #GetNumClients(1)# Set _tmp_team_two #GetNumClients(2)# if [_tmp_team_one > _tmp_team_two] "ExecScript _SVR_PLAYER :: TEAM clientid #GetScriptParam(clientid)# team 2; goto EOF" ExecScript _SVR_PLAYER :: TEAM clientid #GetScriptParam(clientid)# team 1 goto EOF @PART ExecScript _SVR_PLAYER :: TEAM clientid #GetScriptParam(clientid)# team 0; goto EOF /** / * "Handles the death of a client" / * @args index attackingindex damage method blockable / ** / @DEATH Echo "index: "#GetScriptParam(index)#" attackingindex: "#GetScriptParam(attackingindex)#" damage: "#GetScriptParam(damage)#" method: "#GetScriptParam(method)#" blockable: "#GetScriptParam(blockable)# Set _tmp_index #GetScriptParam(index)# Set _tmp_clientid #GetClientNumFromIndex(|#GetScriptParam(index)|#)# Set _tmp_team #GetTeam(|#_tmp_index|#)# KillEntity #_tmp_index# if [_tmp_team == 1] "ExecScript _SVR_PLAYER :: TEAM clientid #_tmp_clientid# team 2;goto EOF" if [_tmp_team == 2] "ExecScript _SVR_PLAYER :: TEAM clientid #_tmp_clientid# team 1;goto EOF" ExecScript _SVR_PLAYER :: RENEW index #_tmp_index# goto EOF @RENEW RefreshCooldowns #GetScriptParam(index)# RefillAmmo #GetScriptParam(index)# ClearStates #GetScriptParam(index)# RefillHealth #GetScriptParam(index)# RefillMana #GetScriptParam(index)# RefillStamina #GetScriptParam(index)# goto EOF /** / * "Forces player to go OBSERVER" / * @args clientid / ** / @OBSERVER SetTeam #GetIndexFromClientNum(|#GetScriptParam(clientid)|#)# 0 ForceSpawn #GetIndexFromClientNum(|#GetScriptParam(clientid)|#)# ClientExecScript #GetScriptParam(clientid)# _CL_PLAYER :: OBSERVER goto EOF /** / * "Forces player to go to the playfield" / * @args clientid team / ** / @TEAM Set _tmp_team #GetScriptParam(team)# SetTeam #GetIndexFromClientNum(|#GetScriptParam(clientid)|#)# #_tmp_team# if [_tmp_team == 1] "Echo changeunit 1; ChangeUnit #GetIndexFromClientNum(|#GetScriptParam(clientid)|#)# Player_Savage true" if [_tmp_team == 2] "Echo changeunit 2; ChangeUnit #GetIndexFromClientNum(|#GetScriptParam(clientid)|#)# Player_ShapeShifter true" ClientExecScript #GetScriptParam(clientid)# _CL_PLAYER :: JOIN_SQUAD RegisterEntityScript #GetIndexFromClientNum(|#GetScriptParam(clientid)|#)# death "ExecScript _SVR_PLAYER :: DEATH index \#GetScriptParam(index)\# attackingindex \#GetScriptParam(attackingindex)\# \#GetScriptParam(damage)\# method \#GetScriptParam(method)\# blockable \#GetScriptParam(blockable)\#" SendMessage #GetScriptParam(clientid)# "^r[DUAL ARENA] ^yYou are now on TEAM"#_tmp_team# goto EOF @EOF // ===============================================================================