From 5bc7b36b1ced7385568e58ab64abf70913f1d047 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sat, 15 Sep 2018 12:32:32 +1000 Subject: [PATCH] reposition commands in pool script --- gamemodes/irresistible/cnr/features/pool.pwn | 108 +++++++++---------- scriptfiles/updates.txt | 4 +- 2 files changed, 55 insertions(+), 57 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/pool.pwn b/gamemodes/irresistible/cnr/features/pool.pwn index 6ce6842..a5e66c2 100644 --- a/gamemodes/irresistible/cnr/features/pool.pwn +++ b/gamemodes/irresistible/cnr/features/pool.pwn @@ -1308,61 +1308,6 @@ hook OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float: fX, Float: f return 1; } -/* ** Commands ** */ -CMD:endgame(playerid) -{ - if ( ! IsPlayerAdmin( playerid ) ) - return 0; - - new iPool = Pool_GetClosestTable( playerid ); - - if ( iPool == -1 ) - return SendError( playerid, "You must be near a pool table to use this command." ); - - Pool_EndGame( iPool ); - - SendClientMessage(playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have force ended the pool game!"); - return 1; -} - -CMD:play(playerid) -{ - new - iPool = Pool_GetClosestTable( playerid ); - - if ( iPool == -1 ) - return SendError( playerid, "You are not near a pool table." ); - - if ( ! IsPlayerPlayingPool( playerid )) - { - p_isPlayingPool { playerid } = true; - p_PoolID[ playerid ] = iPool; - - PlayerPlaySound( playerid, 1085, 0.0, 0.0, 0.0 ); - GivePlayerWeapon( playerid, 7, 1 ); - - p_PoolScore[ playerid ] = 0; - - if ( ! g_poolTableData[ iPool ] [ E_STARTED ] ) - { - g_poolTableData[ iPool ] [ E_STARTED ] = true; - - Iter_Clear( poolplayers< iPool > ); - Iter_Add( poolplayers< iPool >, playerid ); - Iter_Add( poolplayers< iPool >, playerid ); - - UpdateDynamic3DTextLabelText(g_poolTableData[ iPool ] [ E_LABEL ], -1, sprintf( "{FFDC2E}%s is currently playing a test game.", ReturnPlayerName( playerid )) ); - - Pool_RespawnBalls( iPool ); - } - } - else - { - Pool_EndGame( iPool ); - } - return 1; -} - stock Pool_UpdatePlayerCamera( playerid, poolid ) { new @@ -1391,6 +1336,21 @@ stock Pool_UpdatePlayerCamera( playerid, poolid ) } /* ** Commands ** */ +CMD:endgame(playerid) +{ + if ( ! IsPlayerAdmin( playerid ) ) + return 0; + + new iPool = Pool_GetClosestTable( playerid ); + + if ( iPool == -1 ) + return SendError( playerid, "You must be near a pool table to use this command." ); + + Pool_EndGame( iPool ); + + SendClientMessage(playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have force ended the pool game!"); + return 1; +} CMD:addpool(playerid, params[]) { @@ -1475,4 +1435,42 @@ CMD:addpool(playerid, params[]) } return Streamer_Update( playerid ), 1; } + + CMD:play(playerid) + { + new + iPool = Pool_GetClosestTable( playerid ); + + if ( iPool == -1 ) + return SendError( playerid, "You are not near a pool table." ); + + if ( ! IsPlayerPlayingPool( playerid )) + { + p_isPlayingPool { playerid } = true; + p_PoolID[ playerid ] = iPool; + + PlayerPlaySound( playerid, 1085, 0.0, 0.0, 0.0 ); + GivePlayerWeapon( playerid, 7, 1 ); + + p_PoolScore[ playerid ] = 0; + + if ( ! g_poolTableData[ iPool ] [ E_STARTED ] ) + { + g_poolTableData[ iPool ] [ E_STARTED ] = true; + + Iter_Clear( poolplayers< iPool > ); + Iter_Add( poolplayers< iPool >, playerid ); + Iter_Add( poolplayers< iPool >, playerid ); + + UpdateDynamic3DTextLabelText(g_poolTableData[ iPool ] [ E_LABEL ], -1, sprintf( "{FFDC2E}%s is currently playing a test game.", ReturnPlayerName( playerid )) ); + + Pool_RespawnBalls( iPool ); + } + } + else + { + Pool_EndGame( iPool ); + } + return 1; + } #endif diff --git a/scriptfiles/updates.txt b/scriptfiles/updates.txt index 3913136..1f76fd0 100644 --- a/scriptfiles/updates.txt +++ b/scriptfiles/updates.txt @@ -1,4 +1,4 @@ +(+) Adds pool system minigame, like in singleplayer. (+) Adds "/p" to be able to chat inside the paintball lobby (+) Adds "/b production" to see what the status of your business production is. -(+) Adds "/reconnectchuff" for level 5 administrators. -(+) Adds pool system minigame, like in singleplayer \ No newline at end of file +(+) Adds "/reconnectchuff" for level 5 administrators. \ No newline at end of file