#include #include #include #include #include #define PLUGIN "[ZP] Armor Free" #define VERSION "0.2" #define AUTHOR "tii/MONK" //pcvar const g_armor_amount = 100 const g_armor_limit = 500 public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_event("ResetHUD", "playerSpawn", "be") } public playerSpawn(id) { set_task(2.0, "shield", id) } public shield(id , player) { if(is_user_alive(id) && !zp_get_user_zombie(id)) set_pev(player, pev_armorvalue, float(min(pev(player, pev_armorvalue)+g_armor_amount, g_armor_limit))) zp_colored_print(id, "^x04[ZP]^x01 You Now Have Armor") } // Colored Print (zp_colored_print) stock zp_colored_print(target, const message[], any:...) { static g_msgSayText, maxplayers; if ( !g_msgSayText ) g_msgSayText = get_user_msgid("SayText") if ( !maxplayers ) maxplayers = get_maxplayers(); static buffer[512], i, argscount; argscount = numargs(); // Send to everyone if (!target) { static player; for (player = 1; player <= maxplayers; player++) { // Not connected if (!is_user_connected(player)) continue; // Remember changed arguments static changed[5], changedcount; // [5] = max LANG_PLAYER occurencies changedcount = 0; // Replace LANG_PLAYER with player id for (i = 2; i < argscount; i++) { if (getarg(i) == LANG_PLAYER) { setarg(i, 0, player); changed[changedcount] = i; changedcount++; } } // Format message for player vformat(buffer, sizeof buffer - 1, message, 3); // Send it message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, player); write_byte(player); write_string(buffer); message_end(); // Replace back player id's with LANG_PLAYER for (i = 0; i < changedcount; i++) setarg(changed[i], 0, LANG_PLAYER); } } // Send to specific target else { // Format message for player vformat(buffer, sizeof buffer - 1, message, 3); // Send it message_begin(MSG_ONE, g_msgSayText, _, target); write_byte(target); write_string(buffer); message_end(); } }