Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < amxmodx >
- #include < amxmisc >
- #include < fakemeta >
- #include < hamsandwich >
- #pragma semicolon 1
- #define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1))
- #define fm_find_ent_by_class(%1,%2) engfunc(EngFunc_FindEntityByString, %1, "classname", %2)
- enum _:Teams
- {
- FM_TEAM_UNASSIGNED,
- FM_TEAM_T,
- FM_TEAM_CT,
- FM_TEAM_SPECTATOR
- };
- new bool:g_open;
- public plugin_init() {
- register_plugin( "Deluxe JailBreak - Addons", "0.0.1", "CreePs" );
- register_event("HLTV", "event_round_start", "a", "1=0", "2=0");
- register_saycmd( "open", "cmdOpen", 0, "- open the jail's" );
- }
- public event_round_start()
- {
- g_open = false;
- set_task(60.0 * 1.5, "AutocmdOpen");
- }
- public cmdOpen( client )
- {
- if( ! is_user_can( client ) )
- return;
- new ent = -1;
- while( ( ent = fm_find_ent_by_class( ent, "func_button" ) ) )
- {
- dllfunc( DLLFunc_Use, ent, 0 );
- }
- new name[ 32 ];
- get_user_name( client, name, sizeof( name ) - 1 );
- g_open = true;
- ColorChat( 0, "Guard:^4 %s^1 has open the jail's!", name );
- }
- public AutocmdOpen()
- {
- if(g_open == false)
- {
- new ent = -1;
- while( ( ent = fm_find_ent_by_class( ent, "func_button" ) ) )
- {
- dllfunc( DLLFunc_Use, ent, 0 );
- }
- //Do FD all
- }
- }
- bool:is_user_can( client )
- {
- if( fm_get_user_team( client ) != FM_TEAM_CT )
- {
- ColorChat( client, "This command is only for ct's!" );
- return false;
- }
- if( ! is_user_alive( client ) )
- {
- ColorChat( client, "You need to be alive!" );
- return false;
- }
- return true;
- }
- register_saycmd( saycommand[], function[], flags, info[] )
- {
- new temp[ 64 ];
- format( temp, 63, "say /%s", saycommand );
- register_clcmd( temp, function, flags, info );
- format( temp, 63, "say .%s", saycommand );
- register_clcmd( temp, function, flags, info );
- format( temp, 63, "say_team /%s", saycommand );
- register_clcmd( temp, function, flags, info );
- format( temp, 63, "say_team .%s", saycommand );
- register_clcmd( temp, function, flags, info );
- }
- stock fm_get_user_team( client )
- {
- return get_pdata_int( client, 114 );
- }
- stock ColorChat(const id, const string[], {Float, Sql, Resul,_}:...) {
- new msg[191], players[32], count = 1;
- static len;
- len = formatex(msg, charsmax(msg), "^x01[^x04 Deluxe JailBreak^x01 ] ");
- vformat(msg[len], charsmax(msg) - len, string, 3);
- if(id)
- players[0] = id;
- else
- get_players(players,count,"ch");
- for (new i = 0; i < count; i++)
- {
- if(is_user_connected(players[i]))
- {
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"),_, players[i]);
- write_byte(players[i]);
- write_string(msg);
- message_end();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment