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 const c4cmds[][] =
- {
- "c4",
- "buyc4",
- "buy_c4",
- "bomb"
- };
- public plugin_init() {
- register_plugin( "Deluxe JailBreak - Addons", "0.0.1", "CreePs" );
- for( new i; i < sizeof c4cmds; i++ )
- register_saycmd( c4cmds[ i ], "cmdC4", 0, "- give c4 for alive ct's" );
- register_saycmd( "box", "cmdBox", 0, "- starting box" );
- }
- public cmdC4( client )
- {
- if( ! is_user_can( client ) )
- return;
- if( user_has_weapon( client, CSW_C4 ) )
- {
- ColorChat( client, "You already have c4!" );
- return;
- }
- fm_give_item( client, "weapon_c4" );
- return;
- }
- public cmdBox( client )
- {
- if( ! is_user_can( client ) )
- return;
- new name[ 32 ];
- new ff = get_cvar_num( "mp_friendlyfire" );
- get_user_name( client, name, sizeof( name ) - 1 );
- set_cvar_num( "mp_friendlyfire", !ff );
- if( ! ff )
- for( new i = 1; i <= get_maxplayers(); i++ )
- if( is_user_alive( i ) )
- if( get_user_team( i ) == 1 )
- fm_set_user_health( i, 100 );
- ColorChat( 0, "Guard:^4 %s^1 has turn^3 %s^1 the frendlyfire.", name, ff ? "Off" : "On" );
- return;
- }
- 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_set_user_health(index, health) {
- health > 0 ? set_pev(index, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, index);
- return 1;
- }
- stock fm_give_item( client, const item[] )
- {
- if ( !equal( item, "weapon_", 7 ) && !equal( item, "ammo_", 5 )
- && !equal( item, "item_", 5 ) && !equal( item, "tf_weapon_", 10 ) )
- return 0;
- new ent = fm_create_entity( item );
- if ( !pev_valid( ent ) )
- return 0;
- new Float:origin[3];
- pev( client, pev_origin, origin );
- set_pev( ent, pev_origin, origin );
- set_pev( ent, pev_spawnflags, pev( ent, pev_spawnflags ) | SF_NORESPAWN );
- dllfunc( DLLFunc_Spawn, ent );
- new save = pev( ent, pev_solid );
- dllfunc( DLLFunc_Touch, ent, client );
- if ( pev( ent, pev_solid ) != save )
- return ent;
- engfunc( EngFunc_RemoveEntity, ent );
- return -1;
- }
- 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