Junior Member
|
07-13-2020
, 10:13
Re: [req] combokey\gun toss\spray contest...
|
#6
|
Quote:
Originally Posted by ZaX
|
This has not been confirmed
Quote:
Originally Posted by OciXCrom
Do you care to explain how they work?
|
Spray Contest = Whoever sprays higher wins
Gun Toss = Whoever throws the most wins
Shot 4 Shot (weapon deagle) = A shot for the TRR player then a shot for the CT player
Typing Contest = A word appears randomly. Whoever types faster wins
Combo Key = I do not know how to explain this, But I have a plugin that can only be used on jailbreak mod 2.5.5
Combo Key Plugin ( jailbreak 2.5.5 only ):
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <jailbreak_core>
#define PLUGIN "[JB] LR:COMBO KEY"
#define VERSION "1.0"
#define AUTHOR "Natsheh"
#define TASK_COMBOKEYS_HUD 8884958374672
new COMBO_KEY_DUEL, FW_FM_CMDSTART_POST;
enum(+=1)
{
KEY_USE = 0,
KEY_ATTACK,
KEY_ATTACK2,
KEY_DUCK,
KEY_JUMP,
KEY_MLEFT,
KEY_MRIGHT,
KEY_RELOAD,
KEY_MFORWARD,
KEY_MBACKWARD,
MAX_KEYS
}
new const iComboKeys[] = {
IN_USE,
IN_ATTACK,
IN_ATTACK2,
IN_DUCK,
IN_JUMP,
IN_MOVELEFT,
IN_MOVERIGHT,
IN_RELOAD,
IN_FORWARD,
IN_BACK
}
new const szComboKeys[][] = {
"USE",
"SLASH",
"STAB",
"CROUCH",
"JUMP",
"MOVE LEFT",
"MOVE RIGHT",
"RELOAD",
"MOVE FORWARD",
"MOVE BACKWARD"
}
new g_user_progress[33], Array:tmp_array, iLRPrisoner, iLRGuard, Float:g_delay[33];
new const correct_snd[] = "buttons/blip2.wav";
new const incorrect_snd[] = "buttons/button10.wav";
public plugin_precache()
{
precache_sound(correct_snd);
precache_sound(incorrect_snd);
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
COMBO_KEY_DUEL = register_jailbreak_lritem("Combo Key");
FW_FM_CMDSTART_POST = -1;
}
public jb_lr_duel_started(prisoner, guard, duelid)
{
if(duelid == COMBO_KEY_DUEL)
{
if(FW_FM_CMDSTART_POST == -1)
{
FW_FM_CMDSTART_POST = register_forward(FM_CmdStart, "fw_CmdStart_post", 1);
}
iLRGuard = guard;
iLRPrisoner = prisoner;
strip_user_weapons(guard)
strip_user_weapons(prisoner)
give_item(guard, "weapon_knife");
give_item(prisoner, "weapon_knife");
jb_block_user_weapons(guard, true, ~(1<<CSW_KNIFE))
jb_block_user_weapons(prisoner, true, ~(1<<CSW_KNIFE))
if(!_:tmp_array)
{
tmp_array = ArrayCreate(1,1);
}
for(new i; i < MAX_KEYS; i++)
{
ArrayPushCell(tmp_array, i);
}
new szString[96];
const maxcombokeys = 7;
for(new i, maxloop = (ArraySize(tmp_array)-maxcombokeys); i < maxloop; i++)
{
ArrayDeleteItem(tmp_array, random(ArraySize(tmp_array)));
}
ArraySort(tmp_array, "arraysorting_keys");
for(new i, maxloop = ArraySize(tmp_array); i < maxloop; i++)
{
add(szString, charsmax(szString), szComboKeys[ArrayGetCell(tmp_array,i)])
add(szString, charsmax(szString), "|");
}
if(szString[0] != 0)
szString[strlen(szString)-1] = 0;
set_task(1.0, "show_combokeys_hud", guard+TASK_COMBOKEYS_HUD, szString, charsmax(szString), "b");
set_task(1.0, "show_combokeys_hud", prisoner+TASK_COMBOKEYS_HUD, szString, charsmax(szString), "b");
}
}
public arraysorting_keys(Array:array, item1, item2, const data[], data_size)
{
if(random_num(0,1) == 0) return -1;
return 1;
}
public show_combokeys_hud(const szString[], taskid)
{
new id = taskid - TASK_COMBOKEYS_HUD;
set_hudmessage(255, 255, 255, -1.0, 0.30, 2, 6.0, 0.99, 0.05, 0.2, -1);
show_hudmessage(id, szString);
}
public jb_lr_duel_ended(prisoner, guard, duelid)
{
if(duelid == COMBO_KEY_DUEL)
{
if(FW_FM_CMDSTART_POST != -1)
{
unregister_forward(FM_CmdStart, FW_FM_CMDSTART_POST, 1);
FW_FM_CMDSTART_POST = -1;
}
iLRGuard = 0;
iLRPrisoner = 0;
if(_:tmp_array > 0)
{
ArrayDestroy(tmp_array);
tmp_array = any:0;
}
remove_task(guard+TASK_COMBOKEYS_HUD);
remove_task(prisoner+TASK_COMBOKEYS_HUD);
jb_block_user_weapons(guard, false);
jb_block_user_weapons(prisoner, false);
g_user_progress[guard] = 0;
g_user_progress[prisoner] = 0;
}
}
public fw_CmdStart_post(id, uc_handle, seed)
{
if(iLRGuard != id && iLRPrisoner != id)
{
return;
}
if(g_delay[id] >= get_gametime())
{
return;
}
static iButtons; iButtons = get_uc(uc_handle, UC_Buttons);
static iOldButtons; iOldButtons = pev(id, pev_oldbuttons);
if(iButtons == iComboKeys[ArrayGetCell(tmp_array, g_user_progress[id])])
{
g_delay[id] = get_gametime() + 0.1;
g_user_progress[id]++;
emit_sound(id, CHAN_AUTO, correct_snd, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
if(g_user_progress[id] == ArraySize(tmp_array))
{
g_user_progress[id] = 0;
keycombo_end(id);
}
}
else if( g_user_progress[id] > 0 && iButtons > 0 && (iOldButtons != iComboKeys[ArrayGetCell(tmp_array, g_user_progress[id]-1)]) )
{
g_delay[id] = get_gametime() + 0.1;
g_user_progress[id] = 0;
emit_sound(id, CHAN_AUTO, incorrect_snd, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
}
}
keycombo_end(winner)
{
new szWinnerName[32];
get_user_name(winner, szWinnerName, charsmax(szWinnerName));
set_hudmessage(225, 225, 225, -1.0, 0.25, 2, 6.0, 5.0, 0.05, 0.2, -1);
show_hudmessage(0, "%s has win the KeyCombo Duel!", szWinnerName);
cprint_chat(0, _, "!g%s !yhas win the !gKeyCombo !yDuel!t!", szWinnerName)
if(iLRPrisoner == winner)
{
user_kill(iLRGuard);
return;
}
if(iLRGuard == winner)
{
user_kill(iLRPrisoner);
}
}
Typing Contest Plugin ( jailbreak 2.5.5 only ):
PHP Code:
#include < amxmodx >
#include < jailbreak_core >
const TASK_TYPING_CONTEST = 192182;
new g_szWord[ 128 ];
new bool:g_bGameStarted;
new LR_Prisoner, LR_Guard, DUEL_ID;
new const RANDOM_WORDS[][] = {
"I Love Newyork",
"How Fast can you type!?",
"Jailbreak Mod By Natsheh"
}
public plugin_init( ) {
register_plugin( "[LR] Typing Const", "0.1", "master4life" );
DUEL_ID = register_jailbreak_lritem("Typing Contest");
register_clcmd( "say", "CmdHook" );
}
public jb_lr_duel_ended(prisoner, guard, duelid)
{
if(DUEL_ID == duelid)
{
g_bGameStarted = false;
LR_Prisoner = LR_Guard = 0;
remove_task( TASK_TYPING_CONTEST );
}
}
public jb_lr_duel_started(prisoner, guard, duelid)
{
if(DUEL_ID == duelid)
{
remove_task( TASK_TYPING_CONTEST );
LR_Prisoner = prisoner;
LR_Guard = guard;
new szPris[32], szGuar[32];
get_user_name(prisoner, szPris, charsmax(szPris))
get_user_name(guard, szGuar, charsmax(szGuar))
cprint_chat(0, _, "^4%s ^1has challenged ^3%s ^1in a ^4Typing Contest!", szPris, szGuar)
set_task( 3.0, "ReadWord", TASK_TYPING_CONTEST );
}
}
public ReadWord( )
{
new const szFile[ ] = "addons/amxmodx/configs/jailbreak_words.txt";
if(!file_exists(szFile))
{
for(new i; i < sizeof RANDOM_WORDS; i++)
{
write_file(szFile, RANDOM_WORDS[i]);
}
}
new iLines = file_size( szFile, true );
read_file( szFile, random_num( 0, iLines - 1 ), g_szWord, charsmax( g_szWord ),iLines );
g_bGameStarted = true;
new szMessage[ 196 ];
formatex( szMessage, charsmax( szMessage ), "The Word is... ^n >> %s <<", g_szWord );
cprint_chat( 0, _, "The Word is >> ^4%s^1.", g_szWord );
UTIL_DirectorMessage(
.index = 0,
.message = szMessage,
.red = 90,
.green = 30,
.blue = 0,
.x = -1.0,
.y = 0.30,
.effect = 0,
.fxTime = 5.0,
.holdTime = 5.0,
.fadeInTime = 0.5,
.fadeOutTime = 0.3
);
}
public CmdHook( const id )
{
if( g_bGameStarted )
{
if( id != LR_Guard && id != LR_Prisoner ) return;
new szSaid[ 196 ];
read_args( szSaid, charsmax(szSaid) );
remove_quotes( szSaid );
// string is empty
if(!szSaid[0]) return;
if( equali( g_szWord, szSaid ) ) {
g_bGameStarted = false;
FinishOver( id == LR_Prisoner ? LR_Guard : LR_Prisoner , id )
}
else {
cprint_chat(id, _, "^3Your word is incorrect, ^4try again." );
}
}
}
public FinishOver( const iLooser, const iWinner )
{
new szMessage[ 96 ], szName[ 2 ][ 32 ];
get_user_name( iWinner, szName[ 0 ], charsmax(szName[]));
get_user_name( iLooser, szName[ 1 ], charsmax(szName[]));
formatex( szMessage, charsmax( szMessage ), "%s has won the typing Contest, ^n%s has lost!", szName[ 0 ], szName[ 1 ] );
cprint_chat( 0, _, " ^4%s ^1has won the typing ^3Contest, ^4%s^1 Dies.", szName[ 0 ], szName[ 1 ] );
UTIL_DirectorMessage(
.index = 0,
.message = szMessage,
.red = 90,
.green = 30,
.blue = 0,
.x = -1.0,
.y = -1.0,
.effect = 0,
.fxTime = 5.0,
.holdTime = 5.0,
.fadeInTime = 0.5,
.fadeOutTime = 0.3
);
user_kill( iLooser );
}
stock UTIL_DirectorMessage( const index, const message[], const red = 0, const green = 160, const blue = 0,
const Float:x = -1.0, const Float:y = 0.65, const effect = 2, const Float:fxTime = 6.0,
const Float:holdTime = 3.0, const Float:fadeInTime = 0.1, const Float:fadeOutTime = 1.5 )
{
#define pack_color(%0,%1,%2) ( %2 + ( %1 << 8 ) + ( %0 << 16 ) )
#define write_float(%0) write_long( _:%0 )
message_begin( index ? MSG_ONE : MSG_BROADCAST, SVC_DIRECTOR, .player = index );
{
write_byte( strlen( message ) + 31 ); // size of write_*
write_byte( DRC_CMD_MESSAGE );
write_byte( effect );
write_long( pack_color( red, green, blue ) );
write_float( x );
write_float( y );
write_float( fadeInTime );
write_float( fadeOutTime );
write_float( holdTime );
write_float( fxTime );
write_string( message );
}
message_end( );
}
|
|