This plugin will allow you to give reward or bonus easily. Just use the CS Core API. As example, just download c_24.sma file to see how I'm using the CS Core API. ;)
1. Invisibility reward.
2. Noclip reward.
3. Grenades reward.
4. Weapon reward.
5. Health reward.
6. Deadly shot reward.
7. God mode reward.
8. Glow reward.
9. Aura reward.
10. Armor reward.
11. Money reward.
12. Multi-jump reward.
13. Speed boost reward.
14. Unlimited clip reward.
15. Unlimited BP ammo reward.
16. No-recoil reward.
17. Line drawing reward. (This simulates a sort of ability by drawing a line between you and the enemy.) Screenshots. ;)
18. Ring indicator reward. (This ability start at enemy feet and expanded outwards into a much larger sort of ring.) Screenshots. ;)
19. Gravity reward. (New!)
20. Trail reward. (New!) Screenshots. ;)
21. Wall ability reward. (New!) (This ability allow player to penetrate the wall. It is not the same with no-clip.) Screenshots. ;)
Quote:
Deadly Shot is a firepower enhancement item. The user's firepower will be boosted to deal headshot damages and also score headshot kills.
/** * This is called during a player spawn * param id - ID of client */ forward cs_fw_spawn_post(id);
/** * This is called when a player becomes the last terrorists * param id - ID of client */ forward cs_fw_last_terrorist(id)
/** * This is called when a player becomes the last counter-terrorists * param id - ID of client */ forward cs_fw_last_counter(id)
/** * This is called when a player has drew the first blood * param victim - ID of client * param attacker - ID of client */ forward cs_fw_first_blood(victim, attacker);
If you want to see how to use this forward, just download the c_24.sma file.
Just download the c_24.sma file to see how I'm using the CS Core API. ;)
Just say /core in your chat. Yet, this command only available for player that has specific flag. If you want to configure the flag, just open the c_24.sma file, then edit below part:
PHP Code:
// Configure which flag will have access to the reward menu #define ADMIN_FLAG ADMIN_IMMUNITY
Then, a menu will be opened such below screenshots:
Just download the c_24.sma file. You also can try the reward by yourself.
Just say /rm in your chat. Yet, this command only available for player that has specific flag. If you want to configure the flag, just open the c_24.sma file, then edit below part:
PHP Code:
// Configure which flag will have access to the reward menu #define ADMIN_FLAG ADMIN_IMMUNITY
Then, a menu will be opened such below screenshots:
1. cs_health_reward(id, 20.0, 0) = It will set the health to 20.
2. cs_health_reward(id, 20.0, 1) = It will give 20 more health.
B. ARMOR:
1. cs_armor_reward(id, 20.0, 0) = It will set the armor to 20.
2. cs_armor_reward(id, 20.0, 1) = It will give 20 more armor.
C. MONEY:
1. cs_money_reward(id, 300, 0) = It will set the money to 300.
2. cs_money_reward(id, 300, 1) = It will give 300 more money.
D. INVISIBILITY:
1. cs_invisible_reward(id, 0, 0, 0. 0.0) = It will restore the invisibility.
2. cs_invisible_reward(id, 1, 5, 0, 0.0) = The visibility will be "5" and the reward is permanent.
3. cs_invisible_reward(id, 1, 5, 1, 30.0) = It will give invisibility for 30 seconds only.
E. NOCLIP:
1. cs_noclip_reward(id, 0, 0, 0.0) = It will restore the noclip.
2. cs_noclip_reward(id, 1, 0, 0.0) = The noclip reward is permanent.
3. cs_noclip_reward(id, 1, 1, 30.0) = It will give noclip for 30 seconds only.
F. GRENADE:
1. cs_grenade_reward(id, 1, 0) = It will give 1 HE grenade.
2. cs_grenade_reward(id, 1, 1) = It will give 1 flashbang.
3. cs_grenade_reward(id, 1, 2) = It will give 1 smo2e grenade.
4. cs_grenade_reward(id, 1, 3) = It will give 1 from all types of grenades.
G. WEAPON:
2. cs_weapon_reward(id, "weapon_awp") = It will give free AWP.
H. HEADSHOT:
1. cs_headshot_reward(id, 0, 0, 0.0) = It will restore the headshot.
2. cs_headshot_reward(id, 1, 0, 0.0) = The headshot reward is permanent.
3. cs_headshot_reward(id, 1, 1, 30.0) = It will give headshot for 30 seconds only.
I. GODMODE:
1. cs_godmode_reward(id, 0, 0, 0.0) = It will restore the god mode.
2. cs_godmode_reward(id, 1, 0, 0.0) = The god mode reward is permanent.
3. cs_godmode_reward(id, 1, 1, 30.0) = It will give god mode for 30 seconds only.
J. GLOW:
1. cs_glow_reward(id, 0, "", 0, 0.0) = It will restore the glow.
2. cs_glow_reward(id, 1, "255 0 0", 0, 0.0) = The glow reward is permanent.
3. cs_glow_reward(id, 1, "255 0 0", 1, 30.0) = It will give glow for 30 seconds only.
K. AURA:
1. cs_aura_reward(id, 0, "", 0, 0.0) = It will restore the aura.
2. cs_aura_reward(id, 1, "255 0 0", 0, 0.0) = The aura reward is permanent.
3. cs_aura_reward(id, 1, "255 0 0", 1, 30.0) = It will give aura for 30 seconds only.
L. SPEED:
1. cs_speed_reward(id, 0, 0, 0, 0.0) = It will restore the speed boost.
2. cs_speed_reward(id, 1, 150, 0, 0.0) = The speed boost reward is permanent.
3. cs_speed_reward(id, 1, 150, 1, 30.0) = It will give speed boost for 30 seconds only.
M. MULTI-JUMP:
1. cs_jump_reward(id, 0, 0, 0, 0.0) = It will restore the multi-jump.
2. cs_jump_reward(id, 1, 3, 0, 0.0) = The multi-jump reward is permanent.
3. cs_jump_reward(id, 1, 3, 1, 30.0) = It will give multi-jump for 30 seconds only.
N. UNLIMITED CLIP:
1. cs_unlimited_reward(id, 0, 0, 0.0) = It will restore the unlimited clip.
2. cs_unlimited_reward(id, 1, 0, 0.0) = The unlimited clip reward is permanent.
3. cs_unlimited_reward(id, 1, 1, 30.0) = It will give unlimited clip for 30 seconds only.
O. UNLIMITED BP AMMO:
1. cs_unlimited_reward(id, 0, 0, 0.0) = It will restore the unlimited BP ammo.
2. cs_unlimited_reward(id, 2, 0, 0.0) = The unlimited BP ammo reward is permanent.
3. cs_unlimited_reward(id, 2, 1, 30.0) = It will give unlimited BP ammo for 30 seconds only.
P. NO-RECOIL:
1. cs_norecoil_reward(id, 0, 0, 0.0) = It will restore the no-recoil.
2. cs_norecoil_reward(id, 1, 0, 0.0) = The no-recoil reward is permanent.
3. cs_norecoil_reward(id, 1, 1, 30.0) = It will give no-recoil for 30 seconds only.
Q. LINE-DRAWING:
1. cs_line_reward(id, 0, "", 0, 0, 0.0) = It will restore the line drawing.
2. cs_line_reward(id, 1, "255 0 0", 0, 0, 0.0) = The line drawing reward is permanent and will search all alive players.
3. cs_line_reward(id, 1, "255 0 0", 1, 0, 0.0) = The line drawing reward is permanent and and will search nearest alive players only.
4. cs_line_reward(id, 1, "255 0 0", 0, 1, 30.0) = It will give line drawing for 30 seconds only and will search all alive players.
5. cs_line_reward(id, 1, "255 0 0", 1, 1, 30.0) = It will give line drawing for 30 seconds only and will search nearest alive players only.
R. RING INDICATOR:
1. cs_ring_reward(id, 0, "", 0, 0, 0.0) = It will restore the ring indicator.
2. cs_ring_reward(id, 1, "255 0 0", 0, 0, 0.0) = The ring indicator reward is permanent and will search all alive players.
3. cs_ring_reward(id, 1, "255 0 0", 1, 0, 0.0) = The ring indicator reward is permanent and will search nearest alive players only.
4. cs_ring_reward(id, 1, "255 0 0", 0, 1, 30.0) = It will give ring indicator for 30 seconds only and will search all alive players.
5. cs_ring_reward(id, 1, "255 0 0", 1, 1, 30.0) = It will give ring indicator for 30 seconds only and will search nearest alive players only.
S. TRAIL:
1. cs_trail_reward(id, 0, "", 0, 0.0) = It will remove the trail.
2. cs_trail_reward(id, 1, "255 0 0", 0, 0.0) = The trail reward is permanent.
3. cs_trail_reward(id, 1, "255 0 0", 1, 30.0) = It will give trail for 30 seconds only.
T. GRAVITY:
1. cs_gravity_reward(id, 0, 0.0, 0, 0.0) = It will restore the gravity.
2. cs_gravity_reward(id, 1, 0.5, 0, 0.0) = The gravity is reduced to half and permanent.
3. cs_gravity_reward(id, 1, 0.5, 1, 30.0) = The gravity is reduced to half for 30 seconds only.
U. WALL:
1. cs_wall_reward(id, 0, 0, 0.0) = It will restore the wall ability.
2. cs_wall_reward(id, 1, 0, 0.0) = The wall ability is permanent.
3. cs_wall_reward(id, 1, 1, 30.0) = The wall ability is for 30 seconds only.
/**************************************************** * CS Core * *****************************************************/ /** * Return whether a player is a terrorist * param id - ID of client */ native cs_is_terrorist(id);
/** * Return whether a player is the last terrorist * param id - ID of client */ native cs_is_last_terrorist(id);
/** * Return whether a player is the last counter-terrorist * param id - ID of client */ native cs_is_last_counter(id);
/** * Returns number of alive terrorists * param iType - 0; Show all/ 1; Alive players/ 2; Not-alive players */ native cs_get_terrorist_count(iType);
/** * Return number of alive counter-terrorists * param iType - 0; Show all/ 1; Alive players/ 2; Not-alive players */ native cs_get_counter_count(iType);
/** * This is called during a player spawn * param id - ID of client */ forward cs_fw_spawn_post(id);
/** * This is called when a player becomes the last terrorists * param id - ID of client */ forward cs_fw_last_terrorist(id);
/** * This is called when a player becomes the last counter-terrorists * param id - ID of client */ forward cs_fw_last_counter(id);
/**************************************************** * CS Reward * *****************************************************/ /* * This is to give health rewards. * param id - ID of client * param Float:fHP - the values of health given * param iType - if you set it to 0, it will reset your health */ native cs_health_reward(id, Float:fHP, iType);
/* * This is to give armor rewards. * param id - ID of client * param Float:fAP - the values of armor given * param iType - if you set it to 0, it will reset your armor */ native cs_armor_reward(id, Float:fAP, iType);
/* * This is to give money rewards. * param id - ID of client * param iMoney - the values of money given * param iType - if you set it to 0, it will reset your money */ native cs_money_reward(id, iMoney, iType);
/* * This is to give invisible rewards. * param id - ID of client * param iValue - if you set it to 0, it will restore the reward * param iInvi - the values of visibility * param iType - if you set it to 0, it will give permanent reward * param Float:fInviT - the durations of the reward */ native cs_invisible_reward(id, iValue, iInvi, iType, Float:fInviT);
/* * This is to give noclip rewards. * param id - ID of client * param iValue - if you set it to 0, it will restore the reward * param iType - if you set it to 0, it will give permanent noclip * param Float:fNoclipT - the durations of the reward */ native cs_noclip_reward(id, iValue, iType, Float:fNoclipT);
/* * This is to enable unstuc2 feature * param id - ID of client */ native cs_istrap(id);
/* * This is to give grenade rewards. * param id - ID of client * param iGrenade - the values of grenades given * param iType - 0; HE grenade || 1; Flashbang || 2; Smo2e grenade || 3:; All grenades */ native cs_grenade_reward(id, iGrenade, iType);
/* * This is to give weapon rewards. * param id - ID of client * param const szName[] - the name of weapon given */ native cs_weapon_reward(id, const szName[]);
/* * This is to give headshot rewards. * param id - ID of client * param iValue - if you set it to 0, it will restore the reward * param iType - if you set it to 0, it will give permanent headshot * param Float:fHeadshotT - the durations of the reward */ native cs_headshot_reward(id, iValue, iType, Float:fHeadshotT);
/* * This is to give godmode rewards. * param id - ID of client * param iValue - if you set it to 0, it will restore the reward * param iType - if you set it to 0, it will give permanent godmode * param Float:fGodmodeT - the durations of the reward */ native cs_godmode_reward(id, iValue, iType, Float:fGodmodeT);
/* * This is to give glow rewards. * param id - ID of client * param iValue - if you set it to 0, it will restore the reward * param const g_iColor[] - is color of glow * param iType - if you set it to 0, it will give permanent glow * param Float:fGlowT - the durations of the reward */ native cs_glow_reward(id, iValue, const g_iColor[], iType, Float:fGlowT);
/* * This is to give aura rewards * param id - ID of client * param iValue - if you set it to 0, it will restore the reward * param const g_iColor[] - is color of aura * param iType - if you set it to 0, it will give permanent aura * param Float:fAuraT - the durations of the reward */ native cs_aura_reward(id, iValue, const g_iColor[], iType, Float:fAuraT);
/* * This is to give speed boost rewards * param id - ID of client * param iValue - if you set it to 0, it will restore the reward * param g_iAddSpeed - the values of speed boost * param iType - if you set it to 0, it will give permanent speed boost * param Float:fSpeedT - the durations of the reward */ native cs_speed_reward(id, iValue, g_iAddSpeed, iType, Float:fSpeedT);
/* * This is to give multi-jump rewards * param id - ID of client * param iValue - if you set it to 0, it will restore the reward * param g_iAddJump - the values of multi-jump * param iType - if you set it to 0, it will give permanent multi-jump * param Float:fJumpT - the durations of the reward */ native cs_jump_reward(id, iValue, g_iAddJump, iType, Float:fJumpT);
/* * This is to give unlimited bullet rewards * param id - ID of client * param iValue - if you set it to 0, it will restore the reward || 1; Unlimited clip ammo || 2; Unlimited BP ammo * param iType - if you set it to 0, it will give permanent unlimited bullet * param Float:fUnlimitT - the durations of the reward */ native cs_unlimited_reward(id, iValue, iType, Float:fUnlimitT);
/* * This is to give no-recoil rewards * param id - ID of client * param iValue - if you set it to 0, it will restore the reward * param iType - if you set it to 0, it will give permanent no-recoil * param Float:fRecoilT - the durations of the reward */ native cs_norecoil_reward(id, iValue, iType, Float:fRecoilT);
/* * This is to give line drawing rewards * param id - ID of client * param iValue - if you set it to 0, it will restore the reward * param const g_iColor[] - is color of line * param g_iFindLine - allow you to configure the finding. 0; All alive players || 1; Nearest player * param iType - if you set it to 0, it will give permanent line drawing * param Float:fLineT - the durations of the reward */ native cs_line_reward(id, iValue, const g_iColor[], g_iFindLine, iType, Float:fLineT);
/* * This is to give ring indicator rewards * param id - ID of client * param iValue - if you set it to 0, it will restore the reward * param const g_iColor[] - is color of ring * param g_iFindRing - allow you to configure the color. 0; All alive players || 1; Nearest player * param iType - if you set it to 0, it will give permanent ring indicator * param Float:fRingT - the durations of the reward */ native cs_ring_reward(id, iValue, const g_iColor[], g_iFindRing, iType, Float:fRingT);
/* * This is to give trail rewards * param id - ID of client * param iValue - if you set it to 0, it will restore the reward * param const g_iColor[] - is color of trail * param iType - if you set it to 0, it will give permanent trail * param Float:fTrailT - the durations of the reward */ native cs_trail_reward(id, iValue, const g_iColor[], iType, Float:fTrailT);
/* * This is to give gravity rewards * param id - ID of client * param iValue - if you set it to 0, it will restore the reward * param g_iAddLow - the values of custom gravity * param iType - if you set it to 0, it will give permanent custom gravity * param Float:fLowT - the durations of the reward */ native cs_gravity_reward(id, iValue, Float:g_iAddLow, iType, Float:fLowT);
/* * This is to give wall rewards * param id - ID of client * param iValue - if you set it to 0, it will restore the reward * param iType - if you set it to 0, it will give permanent wall ability * param Float:fWallT - the durations of the reward */ native cs_wall_reward(id, iValue, iType, Float:fWallT);
//----------------------------------------------------------------------------------// // If you want to give primary weapon as a reward: // // // // weapon_scout, weapon_xm1014, weapon_mac10, weapon_aug, weapon_ump45, // // weapon_sg550, weapon_galil, weapon_famas, weapon_mp5navy, weapon_m249, // // weapon_m4a1, weapon_tmp, weapon_g3sg1, weapon_sg552, weapon_ak47, weapon_p90 // // // // If you want to give secondary weapon as a reward: // // // // weapon_p228, weapon_elite, weapon_fiveseven, weapon_usp, // // weapon_glock18, weapon_deagle // //----------------------------------------------------------------------------------//
*/
#include <amxmodx> #include <cs_core>
// Configure which flag will have access to menu #define ADMIN_FLAG ADMIN_IMMUNITY
// Variable new g_iReward, g_iCore
public plugin_init() { register_plugin("[API] CS Core Menu", "5.9", "zmd94")
// If you want to open reward menu, just say /rm // in you chat register_clcmd("say /rm", "reward_menu") register_clcmd("say_team /rm", "reward_menu")
// If you want to test the CS core, just say /core // in you chat register_clcmd("say /core", "core_menu") register_clcmd("say_team /core", "core_menu")
// If you want to test the unstuc native, just say /is // in you chat register_clcmd("say /is", "im_trap") register_clcmd("say_team /is", "im_trap") }
public plugin_cfg() { g_iReward = menu_create("\yReward Menu \r5.9", "menu_reward")
public reward_menu(id) { if(is_user_alive(id) && get_user_flags(id) & ADMIN_FLAG) { // Show reward menu. ;) menu_display(id, g_iReward, 0) } }
public menu_reward(const id, const menuid, const item) { if(is_user_alive(id)) { switch( item ) { case 0: { // native cs_health_reward(id, Float:fHP, iType); // Float:fHP - is the value of health reward // iType - if you set it to 0, it will reset your health, so to give it as a reward // we set it into 1 cs_health_reward(id, 20.0, 1) } case 1: { // native cs_armor_reward(id, Float:fAP, iType); // Float:fAP - is the value of armor reward // iType - if you set it to 0, it will reset your armor, so to give it as a reward // we set it into 1 cs_armor_reward(id, 20.0, 1) } case 2: { // native cs_money_reward(id, iMoney, iType); // iMoney is the value of money reward // iType - if you set it to 0, it will reset your money, so to give it as a reward // we set it into 1 cs_money_reward(id, 300, 1) } case 3: { // native cs_invisible_reward(id, iValue, iInvi, iType, Float:fInviT); // iValue - if you set it to 0, it will restore the reward // iInvi is the value of the visibility // iType - if you set it to 0, it will give permanent reward // Float:fInviT is the duration of the reward, the values must in decimal cs_invisible_reward(id, 1, 10, 1, 30.0) } case 4: { // native cs_noclip_reward(id, iValue, iType, Float:fNoclipT); // iValue - if you set it to 0, it will restore the reward // iType - if you set it to 0, it will give permanent reward // Float:fNoclipT is the duration of the reward, the values must in decimal cs_noclip_reward(id, 1, 1, 30.0) } case 5: { // native cs_grenade_reward(id, iGrenade, iType); // iGrenade is the value of grenade given // iType - 0; HE grenade || 1; Flashbang || 2; SMOKE grenade || 3:; All grenades cs_grenade_reward(id, 1, 3) } case 6: { // native cs_weapon_reward(id, const szWeapon[], iAmmo); // const szName[] is the name of weapon reward // for reference of the weapon names, just see above! cs_weapon_reward(id, "weapon_awp") } case 7: { // native cs_headshot_reward(id, iValue, iType, Float:fHeadshotT); // iValue - if you set it to 0, it will restore the reward // iType - if you set it to 0, it will give permanent reward // Float:fHeadshotT is the duration of the reward, the values must in decimal cs_headshot_reward(id, 1, 1, 30.0) } case 8: { // native cs_godmode_reward(id, iValue, iType, Float:fGodmodeT); // iValue - if you set it to 0, it will restore the reward // iType - if you set it to 0, it will give permanent reward // Float:fGodmodeT is the duration of the reward, the values must in decimal cs_godmode_reward(id, 1, 1, 30.0) } case 9: { // native cs_glow_reward(id, iValue, const g_iColor[], iType, Float:fGlowT); // iValue - if you set it to 0, it will restore the reward // const g_iColor[] - is color of glow // iType - if you set it to 0, it will give permanent reward // Float:fGlowT is the duration of the reward, the values must in decimal cs_glow_reward(id, 1, "0 0 255", 1, 30.0) } case 10: { // nnative cs_aura_reward(id, iValue, const g_iColor[], iType, Float:fAuraT); // iValue - if you set it to 0, it will restore the reward // const g_iColor[] - is color of aura // iType - if you set it to 0, it will give permanent reward // Float:fAuraT is the duration of the reward, the values must in decimal cs_aura_reward(id, 1, "0 0 255", 1, 30.0) } case 11: { // native cs_speed_reward(id, iValue, g_iAddSpeed, iType, Float:fSpeedT); // iValue - if you set it to 0, it will restore the reward // g_iAddSpeed is the value of speed boost // iType - if you set it to 0, it will give permanent reward // Float:fSpeedT is the duration of the reward cs_speed_reward(id, 1, 150, 1, 30.0) } case 12: { // native cs_jump_reward(id, iValue, g_iAddJump, iType, Float:fJumpT); // iValue - if you set it to 0, it will restore the reward // g_iAddJump is the value of multi-jump // iType - if you set it to 0, it will give permanent reward // Float:fJumpT is the duration of the reward cs_jump_reward(id, 1, 3, 1, 30.0) } case 13: { // native cs_unlimited_reward(id, iValue, iType, Float:fUnlimitT); // This is to give unlimited bullet rewards // id - ID of client // iValue - if you set it to 0, it will restore the reward || 1; Unlimited clip ammo || 2; Unlimited BP ammo // iType - if you set it to 0, it will give permanent unlimited bullet // Float:fUnlimitT - the durations of the reward cs_unlimited_reward(id, 1, 1, 30.0); } case 14: { // native cs_unlimited_reward(id, iValue, iType, Float:fUnlimitT); // This is to give unlimited bullet rewards // id - ID of client // iValue - if you set it to 0, it will restore the reward || 1; Unlimited clip ammo || 2; Unlimited BP ammo // iType - if you set it to 0, it will give permanent unlimited bullet // Float:fUnlimitT - the durations of the reward cs_unlimited_reward(id, 2, 1, 30.0); } case 15: { // native cs_norecoil_reward(id, iValue, iType, Float:fRecoilT); // This is to give no-recoil rewards // id - ID of client // iValue - if you set it to 0, it will restore the reward // iType - if you set it to 0, it will give permanent no-recoil // Float:fRecoilT - the durations of the reward cs_norecoil_reward(id, 1, 1, 30.0); } case 16: { // native cs_line_reward(id, iValue, const g_iColor[], g_iFindLine, iType, Float:fLineT); // This is to give line drawing ability // id - ID of client // iValue - if you set it to 0, it will restore the reward // const g_iColor[] - is color of line // g_iFindLine - allow you to configure the finding // iType - if you set it to 0, it will give permanent line drawing // Float:fLineT - the durations of the reward cs_line_reward(id, 1, "255 0 0", 0, 1, 30.0); } case 17: { // native cs_ring_reward(id, iValue, g_iFindRing, const g_iColor[], iType, Float:fRingT); // This is to give ring indicator ability // id - ID of client // iValue - if you set it to 0, it will restore the reward // const g_iColor[] - is color of ring // g_iFindRing - allow you to configure the color // iType - if you set it to 0, it will give permanent ring indicator // Float:fRingT - the durations of the reward cs_ring_reward(id, 1, "255 0 0", 0, 1, 30.0); } case 18: { cs_line_reward(id, 1, "255 0 0", 1, 1, 30.0); } case 19: { cs_ring_reward(id, 1, "255 0 0", 1, 1, 30.0); } case 20: { // native cs_trail_reward(id, iValue, const g_iColor[], iType, Float:fTrailT); // id - ID of client // iValue - if you set it to 0, it will restore the reward // g_iColor[] - is color of trail // iType - if you set it to 0, it will give permanent trail // Float:fTrailT - the durations of the reward cs_trail_reward(id, 1, "255 127 0", 1, 30.0) } case 21: { // native cs_gravity_reward(id, iValue, Float:g_iAddLow, iType, Float:fLowT); // id - ID of client // iValue - if you set it to 0, it will restore the reward // g_iAddLow - the values of custom gravity // iType - if you set it to 0, it will give custom gravity // Float:fLowT - the durations of the reward cs_gravity_reward(id, 1, 0.5, 1, 30.0) } case 22: { // native cs_wall_reward(id, iValue, iType, Float:fWallT); // id - ID of client // iValue - if you set it to 0, it will restore the reward // iType - if you set it to 0, it will give permanent wall ability // Float:fWallT - the durations of the reward cs_wall_reward(id, 1, 1, 60.0) } }
menu_cancel(id) } }
public core_menu(id) { // Only player that have access can open the menu if(is_user_alive(id) && get_user_flags(id) & ADMIN_FLAG) { // Show cs_core menu menu_display(id, g_iCore, 0) } }
public menu_core(const id, const menuid, const item) { if(is_user_alive(id)) { switch( item ) { case 0: { // This is how to use native cs_is_last_terrorist(id) if(cs_is_last_terrorist(id)) { client_print(id, print_chat, "[ZM] Now, you are the last terrorist!") } else { client_print(id, print_chat, "[ZM] Now, you are not the last terrorist!") } } case 1: { // This is how to use native cs_is_last_counter(id) if(cs_is_last_counter(id)) { client_print(id, print_chat, "[ZM] Now, you are the last counter-terrorist!") } else { client_print(id, print_chat, "[ZM] Now, you are not the last counter-terrorist!") } } case 2: { // This is how to use native cs_is_terrorist(id) if(cs_is_terrorist(id)) { client_print(id, print_chat, "[ZM] Now, you are the terrorist!") } else { client_print(id, print_chat, "[ZM] Now, you are not the terrorist!") } } case 3: { // This is how to use native cs_is_terrorist(id) if(!cs_is_terrorist(id)) { client_print(id, print_chat, "[ZM] Now, you are the counter-terrorist!") } else { client_print(id, print_chat, "[ZM] Now, you are not the counter-terrorist!") } } case 4: { new iHud = cs_get_terrorist_count(0)
set_hudmessage(0, 255, 255, -1.0, 0.35, 0, 6.0, 6.0, 0.5, 0.15, -1) show_hudmessage(0, "All Terrorist: %d players!", iHud) } case 5: { new iHud = cs_get_terrorist_count(1)
// This is called when a player spawn // forward cs_fw_spawn_post(id); public cs_fw_spawn_post(id) { // If the player is a terrorist, we set the HP to 120 // else we set the HP to 140 cs_is_terrorist(id) ? cs_health_reward(id, 120.0, 0) : cs_health_reward(id, 140.0, 0) }
// This is called when a player has drew the first blood // forward cs_fw_first_blood(victim, attacker) public cs_fw_first_blood(victim, attacker) { new szName[32], szName2[32] get_user_name(attacker, szName, charsmax(szName)) get_user_name(victim, szName2, charsmax(szName2))
// Show the hud message about the first attacker and first victim set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1) show_hudmessage(0,"%s drew a first blood^nFirst victim is %s!", szName, szName2) }
// This is called when a player becomes the last terrorists // forward cs_fw_last_terrorist(id) public cs_fw_last_terrorist(id) { // Print the message to tell that the player is the last player in the team client_print(id, print_chat, "[ZM] Now, you are the last terrorist!")
// This is called when a player becomes the last counter-terrorists // forward cs_fw_last_counter(id) public cs_fw_last_counter(id) { // Print the message to tell that the player is the last player in the team client_print(id, print_chat, "[ZM] Now, you are the last counter-terrorist!")
1. Just put the cs_core.inc in the include folder. This is crucial.
2. Next, compile the cs_core.sma file. Then, put the .amxx file in the plugin folder. If you just want to use the Reward API, no need to download this.
3. Then, compile the cs_reward.sma file. Then, put the .amxx file in the plugin folder. If you just want to use the CS Core API, no need to download this.
3. Lastly, just compile the c_24.sma file (if you want to test the reward) and put the .amxx file in the plugin folder to see how the CS Core API is working. This is just for example. If you just want to use the CS Core or Reward API in your code, no need to download this.
4. Or you can just use your creativity on how to give the reward to the players or using the forward. Have fun!
1. WBYOKOMO for his parachute API.
2. Kia for code helping.
3. Jhob94 for code helping and idea.
4. Dar2_Siders for his ideas.
5. v3x for line drawing method.
6. HamletEagle for code helping. ;)
7. Blizzard_87 for spending his time to teach me about API as I'm still newbie. ;)
8. ZP Dave Team for forward method.
9. Xalus for wall ability code. ;)
10. etc
(8/7/2014):
v1.2 - [FIXED] Optimizing the code.
v1.3 - [FIXED] The code for giving money.
v1.4 - [FIXED] The code for giving money and error on line 18.
(9/8/2014)
v1.5 - [ADDED] Cvar to enable or disable the health, armor and money rewards.
v1.6 - [OPTIMIZED] Remove unnecessary code.
(31/8/2014)
v1.7 - [ADDED] Invisibility reward (Option to enabled or disabled it).
v1.8 - [ADDED] Noclip reward (Option to enabled or disabled it).
v1.9 - [ADDED] Grenades reward (Option to enabled or disabled it). You also can specify the amount of the grenades.
v2.0
- [ADDED] Weapon reward (Option to enabled or disabled it).
- [ADDED] Auto-unstuck feature.
v2.1 - [ADDED] Deadly shot reward (Option to enabled or disabled it).
v2.2 - [ADDED] God mode reward (Option to enabled or disabled it).
(2/9/2014)
v2.3 - [ADDED] Glow reward (Option to enabled or disabled it).
v2.4 - [ADDED] Aura reward (Option to enabled or disabled it).
(3/9/2014)
v2.5 - [ADDED] firstblood.cfg file option. So, you only have to edit the .cfg file instead of edit the code.
(28/10/2014)
v2.7 - Releasing new CS Reward.
v2.8 - [FIXED] Give the proper checks in the fw_traceattack.
v2.9
- [FIXED] Increase the cfgdir array size.
- [FIXED] Give credit to the author for the auto unstuck code.
- [FIXED] Using style 0 for the natives as style 1 is deprecated and style 0 is better.
v3.0 - [FIXED] Re-index the array in the print_colored.
v3.1
- [ADDED] Adding the ID of a task so that we can remove the task when the player that recieve the reward is being killed or disconnect from the server.
- [FIXED] Improve the readibility of the code (Credit to wbyokowo for helping).
- [ADDED] The information about the HP, amor and money limit in the cs_reward.cfg file.
(29/10/2014)
v3.2
- [ADDED] A menu for any players that has specific flag to open it. Then, he can give any rewards to any players.
- [FIXED] Add code to remove the reward at the beginning of the round.
(1/11/2014)
v3.3 - [ADDED] Add 2 new rewards which are multi-jump reward and speed boost reward.
(5/11/2014)
v4.0 - Releasing the Reward API. ;)
(7/11/2014)
v4.1
- [FIXED] Stick to 1 style for the global vars.
- [FIXED] Remove unnecessary check and rearrage the arrangement of the variable to reduce memory usage.
- [FIXED] Change the integer to float for some of the code as I'm little bit confused about get_param and get_param_f.
- [FIXED] Remove unnecessary var.
v4.2
- [FIXED] Giving proper name to variables.
- [ADDED] New check for integer values.
(8/11/2014)
v4.3
- Releasing new CS Core API. ;)
- [ADDED] 2 new forwards.
(9/11/2014)
v4.4
- [ADDED] New natives so that coder can restore the reward.
- [ADDED] New natives so that coder can configure the reward whether it will be permanent or not.
- [ADDED] New forward that will be called when player spawn.
v4.5 - [ADDED] New forward that will be called when the first attacker is detected. ;)
(10/11/2014)
- [ADDED] 4 new plugin that are using this API. ;)
(14/11/2014)
v4.6 - [ADDED] Limit for health and armor reward due to goldsrc engine limitation.
(22/11/2014)
v4.7
- [ADDED] New feature for cs_get_counter_count() and cs_get_terrorist_count(). Now, it can run a variable. 0- All; 1- only alive players ; 2- only dead players.
- [FIXED] Now, the code to count players is using get_players instead get_maxplayers.
- [FIXED] Remove unnecessary code in cs_core.sma file.
(25/11/2014)
v4.8
- [ADDED] 5 new rewards and 1 new native for unstuc2 command.
- [FIXED] The auto-unstuc2 is using new method to fix a few problem when player is using noclip.
- [FIXED] Remove unnecessary code.
(26/11/2014)
v4.9
- [ADDED] An option to disable or enable the custom chat message from the cs_reward.sma file.
- [ADDED] New debug messages for each param of each native. So, it will be more easier to detect any problems.
- [ADDED] New check for certain param to prevent crash problem.
- [FIXED] Remove the unnecessary variables.
- [FIXED] Remove completely get_maxplayers code in cs_core.sma file. Now, it is using get_players.
- [FIXED] Change the integer number of health and armor reward to float number. ;)
- [FIXED] Improve the arrangement and readability of the codes.
(1/12/2014)
v5.0
- [ADDED] An option to change values of color for glow, aura, line and ring indicator reward.
- [ADDED] An option to change the way of line and ring indicator reward is working. Now, you can search the nearest player instead all alive players. ;)
(4/12/2014)
v5.1
- [FIXED] Now, all the forwards for the rewards will only being registered when needed. In previous version, all of forwards will be called even if no native need them. ;)
- [FIXED] Improve the code in fw_CmdStart. ;)
(5/12/2014)
v5.2 - [FIXED] Prevent the forwards for the rewards from being registered everytime when we want to use it. Reduce CPU usages!
v5.3 - [FIXED] The arrangement and readibility of the code.
(6/12/2014)
v5.4
- [FIXED] Remove unnecessary code in c_24.sma file and change the way of the reward is being given at cs_fw_spawn_post(id).
- [FIXED] The readibility of the code by giving proper names. So, we know from which commands or forwards they come.
- [FIXED] Now, the cs_reward code is using real offset names to keep compatibility with the game.
- [FIXED] All of the offset values has been changed into offset names. So, we can know what offest is being used.
- [ADDED] This new update will support Linux and Mac offset values also.
- [FIXED] The variable in cs_speed_reward and cs_jump_reward natives.
- [FIXED] The code in fw_ResetMaxSpeed.
- [FIXED] Now, all the errors from native will be printed by using log_error(AMX_ERR_NATIVE, "message") instead server_print("message").
- [FIXED] Remove unnecessary set_task in cs_noclip_reward native.
- [FIXED] The problem with the static variables. ;)
- [FIXED] Remove unnecessary g_bBulletForward boolean as there is already g_iMsgAmmo variable.
- [FIXED] Remove the new variables inside the loop in public player_line(id) and public player_ring(id).
- [FIXED] Remove the "a" flag in the get_players during HLTV.
- [FIXED] Remove return HAM_IGNORED in fw_WeaponPrimary_Pre and fw_WeaponPrimary_Post.
- [ADDED] New, option in cs_grenade_reward native. Now, you can choose which grenade that you want to recieve instead recieve all of the grenades.
v5.5
- [FIXED] iTEcount, iCTcount, players[32] in cs_core.sma file is changed into global variables. ;)
- [FIXED] Remove unnecessary variables in native_get_terrorist_count and native_get_counter_count.
(7/12/2014)
v5.6
- [FIXED] Remove unnecessary variables in cs_core.sma and cs_reward.sma file.
- [FIXED] The code for cs_fw_last_terrorist and cs_fw_last_counter forwards in cs_core.sma file.
(14/12/2014)
v5.7
- [FIXED] The color variables for aura, line and ring rewards. Now, each person can have different color.
- [ADDED] 3 new rewards.
(22/12/2014)
v5.8
- [FIXED] The color variables for glow. Now, each person can have different color.
- [FIXED] Return 0 on failure on cs_core natives.
- [FIXED] !cs_get_user_team(id) in changed into cs_get_user_team(id) == CS_TEAM_UNASSIGNED to make it more clear and improve the readability.
- [FIXED] The code for LastPlayer() in cs_core.sma file.
- [FIXED] Remove the used of static in UTIL_Player.
- [FIXED] Remove new variables in looping for cs_line_reward and cs_ring_reward.
- [FIXED] Remove unnecessary get_aura_color, get_glow_color, get_line_color and get_ring_color code. Now, all of this are using one stock.
- [FIXED] The arrangement of param for cs_line_reward and cs_ring_reward due to use of one stock for color. ;)
- [FIXED] The auto-unstuck native name is being changed into cs_istrap instead cs_istuc.
- [FIXED] The engine forwards name for cs_wall_reward.
- [ADDED] Check for param count for all natives to prevent user errors, if someone is silly enough to change the .inc file.
v5.9
- [FIXED] Change into switch instead if for cs_is_terrorist native.
- [ADDED] New log error message if the forward is not successfully created in cs_core code. ;)
- [FIXED] Now, the sprite path is not hardcode. It use #define in this new update.
- [FIXED] Problem in i_NoClip(id).
- [FIXED] Problem in player_aura(id).
- [FIXED] Remove unnecessary bool in cs_aura_reward.
- [FIXED] Change the reward and core menu in c_24.sma file into global menu.
(26/12/2014)
v6.0
- [FIXED] Switch in native_get_terrorist_count and native_get_counter_count.
- [FIXED] Cache the value of cs_get_user_team in fw_PlayerRespawn.
- [FIXED] Change static to new in is_hull_vacant and origin_in_front.
- [FIXED] Remove unnecessary code in EngFunc_TraceLine.
(4/1/2015)
v6.1
- [FIXED] Change g_iFirstBlood to bool:g_bFirstBlood in cs_core code.
- [FIXED] Update the bitsum for cs_is_terrorist native in register_event("TeamInfo", "event_TeamInfo", "a").
- [ADDED] Check if the code for cs_weapon_reward native is pass an valid string. If not it will throw an error.
- [FIXED] Remove the bool to register the forward in a few natives.
- [FIXED] Check if the weapon entity is valid before getting it's owner in fw_WeaponPrimary_Pre(entity) and fw_WeaponPrimary_Post(entity).
- [FIXED] Code in bool:is_hull_vacant. Now, we use global variable g_iTrace. ;)
And it compiled perfectly. Tested on my listen server ZPA and every time a person infects (not by gun) they dont get rewards (perfect!)
And ofc by gun they get HP, AP and Money!
Good Work!
EDIT: Also tested with bots, same result!
Last edited by Br0k3nPh1LL1p; 08-07-2014 at 14:24.
And it compiled perfectly. Tested on my listen server ZPA and every time a person infects (not by gun) they dont get rewards (perfect!)
And ofc by gun they get HP, AP and Money!
Good Work!
EDIT: Also tested with bots, same result!
When you infect someone in zp, he doesnt dies. And since he isnt using zp include for detect infections, ofc it will detect first human kill.
Anyway i would suggest you to add zp support to next version. And if running for zp, use cvars if only want ct kills or infections too. Instead of give money, give ap.
And since he isnt using zp include for detect infections, ofc it will detect first human kill.
I should have noticed that..
Quote:
Originally Posted by Jhob94
Anyway i would suggest you to add zp support to next version. And if running for zp, use cvars if only want ct kills or infections too. Instead of give money, give ap.
I was just checking this, and this might be perfect!
@ Br0k3nPh1LL1p, this plugin can be used for ZP. However, it only detected the killed made by human not the zombie.
Quote:
Originally Posted by Jhob94
Anyway I would suggest you to add ZP support to next version. And if running for ZP, use cvars if only want CT kills or infections too. Instead of give money, give ammo packs.
I meant that you directly set that ammount of money to the user and don't add it to his current money. And if I have 15000 and make first blood, my money won't get 15500, but 500. And I loose 14500
It should be: