[RLA] # HazZaRD Mesaje : 541 | Subiect: Salvatorul Craciunului [Xmas Random] Dum 14 Feb 2016, 22:01 | |
| Descriere: La fiecare inceput de runda serverul alege aleatoriu un jucator de la CT/T si ii ofera un costum de "Mos Craciun" + niste abilitati default alese de mine FULL HE,150 HP,100 ARMURA.. l-am testat din toate punctele de vedere sa nu apara erori sau modelul sa nu dispara deci merge 100% Am pus mesajul care anunta jucatorul ales in chat deoarece in hud mai avea tendinta sa dispara din cauza altor mesaje Download: link1link2 Nume: Xmas RandomVersiune: 1.1Autor: S3ekEr^Credite: Chaos (pentru idea cu " Salvatorul Craciunului") sKz (pentru banner si ajutorul la teste) - Cod:
-
#include <amxmodx> #include <cstrike> #include <hamsandwich> #include <fun>
#define PLUGIN "Xmas Random" #define VERSION "1.0" #define AUTHOR "S3ekEr"
new const g_szModel[] = "xmas_red";
new g_iLastSaverId;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_logevent("logevent_RoundStart", 2, "1=Round_Start");
RegisterHam(Ham_Spawn, "player", "fwd_HamPlayerSpawnPost", 1); }
public plugin_precache() { new szBuff[128]; formatex(szBuff, charsmax(szBuff), "models/player/%s/%s.mdl", g_szModel, g_szModel);
precache_model(szBuff); }
//lower the SVC_BAD error / maybe? public logevent_RoundStart() set_task(0.1, "task_SetSanta");
public fwd_HamPlayerSpawnPost(id) { if(!is_user_connected(id)) return HAM_IGNORED;
if(id == g_iLastSaverId) cs_reset_user_model(id);
return HAM_IGNORED; }
public task_SetSanta() { //get random player and don't get it twice in a row new iPlayer; do { iPlayer = GetRandomPlayer("ah"); } while((iPlayer == g_iLastSaverId || !is_user_connected(iPlayer)) && iPlayer != 0); if(!iPlayer) return;
set_user_health(iPlayer, 150); cs_set_user_armor(iPlayer, 100, CS_ARMOR_VESTHELM);
give_item(iPlayer, "weapon_hegrenade"); give_item(iPlayer, "weapon_smokegrenade"); give_item(iPlayer, "weapon_flashbang");
cs_set_user_model(iPlayer, g_szModel);
new szName[32]; get_user_name(iPlayer, szName, charsmax(szName));
player_color( 0, ".g----------------------------------------------------------------------------"); player_color( 0, ".g[.vXmas.g] .e%s .ga fost ales salvatorul .vCraciunului! .g.v150HP.g+.v100ARMURA.g-HE-FLASH! .eHo Ho Ho.g!", szName); player_color( 0, ".g----------------------------------------------------------------------------");
g_iLastSaverId = iPlayer; }
//get random player stock GetRandomPlayer(const flags[] = "", const team[]= "") { new iPlayers[32], iNum; get_players(iPlayers, iNum, flags, team);
return iNum ? iPlayers[random_num(0, iNum - 1)] : 0; }
stock player_color( const id, const input[ ], any:... ) { new count = 1, players[ 32 ]
static msg[ 191 ] vformat( msg, 190, input, 3 )
replace_all( msg, 190, ".v", "^4" ) /* verde */ replace_all( msg, 190, ".g", "^1" ) /* galben */ replace_all( msg, 190, ".e", "^3" ) /* ct=albastru | t=rosu */ replace_all( msg, 190, ".x", "^0" ) /* normal-echipa */
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( ); } } } } Instalare: 1. Fisierul Xmas-Random.sma il puneti in addons/amxmodx/scripting2. Fisierul Xmas-Random.amxx il puneti in addons/amxmodx/plugins3. Fiserul xmas_red.mdl il puneti in cstrike/models/player4. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma: - Cod:
-
Xmas-Random.amxx Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini): cstrikehamsandwichfunInformatii:Nu prea am gasit niste modele atat de frumoase ca sa le pun,acesta a fost cel mai acceptabil dintre toate asa ca fiecare poate sa puna ce model doreste dar sa nu uitati sa pastrati numele sau sa-l modificati de aici la model new const g_szModel[] = "xmas_red";, v-am mai lasat aici inca un model pentr plugin,acum fiecare pune ce doreste download
|
|