Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #include <fun>
- #include <cstrike>
- #include <hamsandwich>
- #include <fakemeta>
- #include <fcs>
- #include <engine>
- #include <xs>
- //Gloante infinite
- new bool:g_bInfiniteBullets[ 33 ]
- enum
- {
- CurWeapon_IsActive = 1, // byte
- CurWeapon_WeaponID, // byte
- CurWeapon_ClipAmmo // byte
- }
- #define XO_WEAPON 4
- #define m_iClip 51
- #define m_iClientClip 52
- #define SLOT "b"
- #define m_pActiveItem 373
- new const g_iMaxClip[CSW_P90+1] =
- {
- -1, 13, -1, 10, 1, 7, 1, 30, 30, 1, 30,
- 20, 25, 30, 35, 25, 12, 20, 10, 30, 100,
- 8 , 30, 30, 20, 2, 7, 30, 30, -1, 50
- }
- enum _:Colors
- {
- print_team_default,
- print_team_red,
- print_team_blue,
- print_team_grey
- };
- stock const TeamName [Colors] [ ] =
- {
- "UNASSIGNED",
- "TERRORIST",
- "CT",
- "SPECTATOR"
- };
- new bool:g_slotpass[33];
- new g_norecoil[33];
- new Float: cl_pushangle[33][3];
- new g_maxplayers;
- new cvar_hpap, cvar_HESG, cvar_DU, cvar_God, cvar_Ak, cvar_M4, cvar_recoil, cvar_Awp, cvar_unc, cvar_bslot, cvar_energy, cvar_inv, cvar_m249;
- const WEAPONS_BITSUM = (1<<CSW_KNIFE|1<<CSW_HEGRENADE|1<<CSW_FLASHBANG|1<<CSW_SMOKEGRENADE|1<<CSW_C4)
- public plugin_init()
- {
- register_clcmd ( "chooseteam", "ShowMenu", -1);
- register_clcmd ( "jointeam", "ShowMenu", -1 );
- register_clcmd("say /shop", "ShowMenu", -1);
- RegisterHam( Ham_Spawn, "player", "SpawnCmd", 1 )
- register_message( get_user_msgid( "CurWeapon" ), "event_curweapon" );
- register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
- register_clcmd ( "amx_password_for_slot", "slot" );
- cvar_hpap = register_cvar("50_HP_+_50_AP", "3");
- cvar_HESG = register_cvar("HE", "5");
- cvar_DU = register_cvar("Deagle", "10");
- cvar_God = register_cvar("GodMode(3_sec)", "30");
- cvar_Ak = register_cvar("Ak47", "30");
- cvar_M4 = register_cvar("M4A1", "30");
- cvar_Awp = register_cvar("AWP", "50");
- cvar_recoil = register_cvar("no-recoil", "100");
- cvar_m249 = register_cvar("m249", "30");
- cvar_unc = register_cvar("Unlimited_Clip", "100");
- cvar_bslot = register_cvar("Buy_Slot_&_Super_Knife", "2500");
- cvar_energy = register_cvar("Energy_Pack", "200");
- cvar_inv = register_cvar("Invizibilitate ", "50");
- new weapon_name[24]
- for (new i = 1; i <= 30; i++)
- {
- if (!(WEAPONS_BITSUM & 1 << i) && get_weaponname(i, weapon_name, 23))
- {
- RegisterHam(Ham_Weapon_PrimaryAttack, weapon_name, "fw_Weapon_PrimaryAttack_Pre")
- RegisterHam(Ham_Weapon_PrimaryAttack, weapon_name, "fw_Weapon_PrimaryAttack_Post", 1)
- }
- }
- g_maxplayers = get_maxplayers()
- }
- public client_connect(id)
- g_norecoil[id] = false
- public event_round_start()
- for (new id = 1; id <= g_maxplayers; id++)
- g_norecoil[id] = false
- public fw_Weapon_PrimaryAttack_Pre(entity)
- {
- new id = pev(entity, pev_owner)
- if (g_norecoil[id])
- {
- pev(id, pev_punchangle, cl_pushangle[id])
- return HAM_IGNORED;
- }
- return HAM_IGNORED;
- }
- public fw_Weapon_PrimaryAttack_Post(entity)
- {
- new id = pev(entity, pev_owner)
- if (g_norecoil[id])
- {
- new Float: push[3]
- pev(id, pev_punchangle, push)
- xs_vec_sub(push, cl_pushangle[id], push)
- xs_vec_mul_scalar(push, 0.0, push)
- xs_vec_add(push, cl_pushangle[id], push)
- set_pev(id, pev_punchangle, push)
- return HAM_IGNORED;
- }
- return HAM_IGNORED;
- }
- public SpawnCmd ( id )
- {
- if(is_user_alive(id) && is_user_connected(id))
- {
- g_bInfiniteBullets[id] = false;
- set_user_rendering(id, kRenderFxNone, 255, 255, 255 ,kRenderNormal, 16);
- }
- }
- public ShowMenu (id, level, cid)
- {
- if(cs_get_user_team(id) == CS_TEAM_CT)
- {
- new menu = menu_create( "\r[DeathRun OutStanding]\yExtra Items CT:", "extract");
- menu_additem(menu, "\w50HP + 50AP - \r 3 Points", "1", 0);
- menu_additem(menu, "\wHE - \r 5 Points", "2", 0);
- menu_additem(menu, "\wDeagle - \r 10 Points", "3", 0);
- menu_additem(menu, "\wGodMode(3sec) - \r 30 Points", "4", 0);
- menu_additem(menu, "\wAk47 - \r 30 Points", "5", 0);
- menu_additem(menu, "\wM4A1 - \r 30 Points", "6", 0);
- menu_additem(menu, "\wAWP\r 50 Points", "7", 0);
- menu_additem(menu, "\wNo Recoil - \r 100 Points", "8", 0);
- menu_additem(menu, "\wUnlimited Clip - \r 100 Points", "9", 0);
- menu_additem(menu, "\wBuy SuperKnife + Slot - \r 2500 Points", "10", 0);
- menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
- menu_display(id, menu, 0);
- return 1;
- }
- else
- {
- new menu = menu_create( "\r[DeathRun OutStanding] \yExtra Items T", "extrat");
- menu_additem(menu, "\w50HP + 50AP - \r 3 Points", "1", 0);
- menu_additem(menu, "\wEnergy Pack (1000 HP + 1000 AP) - \r 200 Points", "2", 0);
- menu_additem(menu, "\wAWP- \r 50 Points", "3", 0);
- menu_additem(menu, "\wM249 - \r 50 Points", "4", 0);
- menu_additem(menu, "\wAk47 - \r 30 Points", "5", 0);
- menu_additem(menu, "\wInvizibilitate 80% - \r 50 Points", "7", 0);
- menu_additem(menu, "\wBuy SuperKnife + Slot - \r 2500 Points", "7", 0);
- menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
- menu_display(id, menu, 0);
- return 1;
- }
- return 1;
- }
- public extract ( id, menu, item )
- {
- if( item == MENU_EXIT )
- {
- return 1;
- }
- new data[6], szName[64];
- new access, callback;
- menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
- new key = str_to_num(data);
- switch(key)
- {
- case 1:
- {
- if(get_user_credits(id) >= get_pcvar_num(cvar_hpap))
- {
- set_user_credits(id, get_user_credits(id) - 3);
- new viata =get_user_health(id);
- set_user_health(id,clamp(viata+50,1,1000));
- set_user_armor(id,get_user_armor(id)+50)
- return 1
- }
- else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
- }
- case 2:
- {
- if(get_user_credits(id) >= get_pcvar_num(cvar_HESG))
- {
- set_user_credits(id, get_user_credits(id) - 5);
- give_item(id,"weapon_hegrenade")
- }
- else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
- }
- case 3:
- {
- if(get_user_credits(id) >= get_pcvar_num(cvar_DU))
- {
- set_user_credits(id, get_user_credits(id) - 10);
- give_item(id,"weapon_deagle")
- cs_set_user_bpammo(id,CSW_DEAGLE,100)
- }
- else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
- }
- case 4:
- {
- if(get_user_credits(id) >= get_pcvar_num(cvar_God))
- {
- set_user_credits(id, get_user_credits(id) - 30);
- set_user_godmode(id,1)
- set_task(3.0,"RemoveGod",id)
- }
- else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
- }
- case 5:
- {
- if(get_user_credits(id) >= get_pcvar_num(cvar_Ak))
- {
- set_user_credits(id, get_user_credits(id) - 30);
- give_item(id,"weapon_ak47")
- cs_set_user_bpammo(id,CSW_AK47,90)
- }
- else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
- }
- case 6:
- {
- if(get_user_credits(id) >= get_pcvar_num(cvar_M4))
- {
- set_user_credits(id, get_user_credits(id) - 30);
- give_item(id,"weapon_m4a1")
- cs_set_user_bpammo(id,CSW_M4A1,90)
- }
- else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
- }
- case 7:
- {
- if(get_user_credits(id) >= get_pcvar_num(cvar_Awp))
- {
- set_user_credits(id, get_user_credits(id) - 30);
- give_item(id,"weapon_awp")
- cs_set_user_bpammo(id,CSW_AWP,90)
- }
- else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
- }
- case 8:
- {
- if(get_user_credits(id) >= get_pcvar_num(cvar_recoil))
- {
- set_user_credits(id, get_user_credits(id) - 100);
- g_norecoil[id] = true
- }
- else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
- }
- case 9:
- {
- if(get_user_credits(id) >= get_pcvar_num(cvar_unc))
- {
- set_user_credits(id, get_user_credits(id) - 100);
- g_bInfiniteBullets[id] = true;
- }
- else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
- }
- case 10:
- {
- if (get_user_credits(id) >= get_pcvar_num(cvar_bslot))
- {
- set_user_credits(id, get_user_credits(id) - 2500);
- g_slotpass[id] = true;
- slot(id);
- }
- else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
- }
- default:
- {
- }
- }
- return PLUGIN_CONTINUE;
- }
- public extrat ( id, menu, item )
- {
- if( item == MENU_EXIT )
- {
- return 1;
- }
- new data[6], szName[64];
- new access, callback;
- menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
- new key = str_to_num(data);
- switch(key)
- {
- case 1:
- {
- if(get_user_credits(id) >= get_pcvar_num(cvar_hpap))
- {
- set_user_credits(id, get_user_credits(id) - 5);
- set_user_health(id,get_user_health(id)+50)
- set_user_armor(id,get_user_armor(id)+50)
- return 1
- }
- else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
- }
- case 2:
- {
- if(get_user_credits(id) >= get_pcvar_num(cvar_energy))
- {
- set_user_credits(id, get_user_credits(id) - 200);
- set_user_armor(id,get_user_armor(id)+1000)
- new viata =get_user_health(id);
- set_user_health(id,clamp(viata+1000,1,1000));
- }
- else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
- }
- case 3:
- {
- if(get_user_credits(id) >= get_pcvar_num(cvar_Awp))
- {
- set_user_credits(id, get_user_credits(id) - 50);
- give_item(id,"weapon_awp")
- cs_set_user_bpammo(id,CSW_AWP,90)
- }
- else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
- }
- case 4:
- {
- if(get_user_credits(id) >= get_pcvar_num(cvar_m249))
- {
- set_user_credits(id, get_user_credits(id) - 50);
- give_item(id,"weapon_m249")
- cs_set_user_bpammo(id,CSW_M249,90)
- }
- else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
- }
- case 5:
- {
- if(get_user_credits(id) >= get_pcvar_num(cvar_Ak))
- {
- set_user_credits(id, get_user_credits(id) - 30);
- give_item(id,"weapon_ak47")
- cs_set_user_bpammo(id,CSW_AK47,90)
- }
- else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
- }
- case 6:
- {
- if(get_user_credits(id) >= get_pcvar_num(cvar_inv))
- {
- set_user_credits(id, get_user_credits(id) - 50);
- set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 20 );
- }
- else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
- }
- case 7:
- {
- if (get_user_credits(id) >= get_pcvar_num(cvar_bslot))
- {
- set_user_credits(id, get_user_credits(id) - 2500);
- g_slotpass[id] = true;
- slot(id);
- }
- else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
- }
- }
- return PLUGIN_CONTINUE;
- }
- public slot(id)
- {
- if (get_user_flags ( id ) & read_flags ( SLOT ) )
- {
- client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You can't buy this item!");
- return 1
- }
- client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 PLEASE INSERT THE PASSWORD");
- new password[16];
- read_args(password, charsmax(password));
- remove_quotes(password);
- if(strlen(password) < 3 || strlen(password) > 15)
- {
- client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 Password^3 Invalid^1.");
- client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 Password must contain between^1 3^x03 si^1 15 characters^3.");
- client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 Retype Again^3 Password^1.");
- client_cmd(id, "messagemode amx_password_for_slot");
- return 1
- }
- new configsDir[64];
- get_configsdir(configsDir, charsmax(configsDir));
- format(configsDir, 63, "%s/users.ini", configsDir);
- new name[32];
- get_user_name(id, name, charsmax(name));
- new linetoadd[512];
- formatex(linetoadd, 511, "^"%s^" ^"%s^" ^"b^"", name, password);
- server_print("Adding: %s", linetoadd);
- if(!write_file(configsDir, linetoadd))
- console_print(id, "[DeathRun OutStanding] Failed writing to %s!", configsDir);
- set_user_info(id, "_pw", password);
- server_cmd("amx_reloadadmins");
- client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 Congratulations You Have Slot Access (your password:^4 %s^1)", password);
- client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 Congratulations You Have Slot Access (your password:^4 %s^1)", password);
- g_slotpass[id] = false;
- console_print(id, "");
- console_print(id, "****************************");
- console_print(id, "Done! You have now slot access!");
- console_print(id, "Be careful, to login with your account,");
- console_print(id, "You should type in your console");
- console_print(id, "setinfo _pw ^"password^"");
- console_print(id, "We hope you enjoy you have fun!");
- console_print(id, "****************************");
- console_print(id, "");
- server_cmd("kick #%d Check your console!", get_user_userid(id));
- return PLUGIN_HANDLED
- }
- public RemoveGod(id)
- {
- set_user_godmode(id,0)
- client_print_color ( id, print_team_default, "Numai ai godmode!");
- }
- public event_curweapon( iMsgId, iMsgDest, id )
- {
- if ( get_msg_arg_int( CurWeapon_IsActive ) && g_bInfiniteBullets[ id ] )
- {
- new iMaxClip = g_iMaxClip[ get_msg_arg_int( CurWeapon_WeaponID ) ];
- if( get_msg_arg_int(CurWeapon_ClipAmmo) < iMaxClip )
- {
- new iWeapon = get_pdata_cbase( id, m_pActiveItem );
- if ( iWeapon > 0 )
- {
- set_pdata_int( iWeapon, m_iClip, iMaxClip, XO_WEAPON );
- set_pdata_int( iWeapon, m_iClientClip, iMaxClip, XO_WEAPON );
- set_msg_arg_int( CurWeapon_ClipAmmo, ARG_BYTE, iMaxClip );
- }
- }
- }
- }
- stock client_print_color ( id, iColor = print_team_default, const Msg [ ], any:... )
- {
- if ( id && !is_user_connected ( id ) ) return 0;
- if ( iColor > print_team_grey ) iColor = print_team_default;
- new Message [192];
- if ( iColor == print_team_default )
- Message [0] = 0x04;
- else
- Message [0] = 0x03;
- new iParams = numargs ( )
- if ( id )
- {
- if ( iParams == 3 )
- copy ( Message [1], charsmax ( Message ) -1, Msg );
- else
- vformat ( Message [1], charsmax ( Message ) -1, Msg, 4 );
- if ( iColor )
- {
- new GetTeam [11]; get_user_team ( id, GetTeam, charsmax ( GetTeam ) );
- SendTeamInfo ( id, id, TeamName [iColor] );
- SendSayText ( id, id, Message );
- SendTeamInfo ( id, id, GetTeam );
- }
- else
- SendSayText ( id, id, Message );
- }
- else
- {
- new iPlayers [32], iNum; get_players ( iPlayers, iNum, "ch" );
- if ( !iNum ) return 0;
- new iFool = iPlayers [0];
- if ( iParams == 3 )
- copy ( Message [1], charsmax ( Message ) -1, Msg );
- else
- vformat ( Message [1], charsmax ( Message ) -1, Msg, 4 );
- if ( iColor )
- {
- new GetTeam [11]; get_user_team ( iFool, GetTeam, charsmax ( GetTeam ) );
- SendTeamInfo ( 0, iFool, TeamName [iColor] );
- SendSayText ( 0, iFool, Message);
- SendTeamInfo ( 0, iFool, GetTeam );
- }
- else
- SendSayText ( 0, iFool, Message );
- }
- return 1;
- }
- stock SendTeamInfo ( iReceiver, iPlayerId, GetTeam [] )
- {
- static iTeamInfo = 0;
- if ( !iTeamInfo )
- iTeamInfo = get_user_msgid ( "TeamInfo" );
- message_begin ( iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iTeamInfo, .player = iReceiver );
- write_byte ( iPlayerId );
- write_string ( GetTeam );
- message_end ( );
- }
- stock SendSayText ( iReceiver, iPlayerId, Message [ ] )
- {
- static iSayText = 0;
- if ( !iSayText )
- iSayText = get_user_msgid ( "SayText" );
- message_begin ( iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iSayText, .player = iReceiver );
- write_byte ( iPlayerId );
- write_string ( Message );
- message_end ( );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement