reposition commands in pool script

This commit is contained in:
Lorenc Pekaj 2018-09-15 12:32:32 +10:00
parent 87f4163b97
commit 5bc7b36b1c
2 changed files with 55 additions and 57 deletions

View File

@ -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

View File

@ -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
(+) Adds "/reconnectchuff" for level 5 administrators.