Modificare plugin

Cereri modificari/adaugari la un plugin! (postati .sma)
Post Reply
ALEX
Nou Venit
Nou Venit
Posts: 10
Joined: Thu Jan 28, 2010 12:09 pm

Modificare plugin

Post by ALEX »

Cine stie sa modifice pluginu DeathrunManager sa imi arate colorat ca in poza asta unde scrie [Deathrun] Incepem in 10 secunde. La mine arata cu alb
Folosesc versiunea 2.1
Ca la v3 nu imi arata ca se da restart dak nu gaseste niciun terorist ca incepe in 10 sec, ca muta singur pe unu la terro

Image


Sma la plugin /****************************************/ /* */ /* Deathrun Manager */ /* by xPaw */ /* */ /* Original code */ /* by Grim */ /****************************************/ /*** * Link to the plugin * * http://forums.alliedmods.net/showthread.php?t=78197 */ #include #include #include #pragma semicolon 1 // Plugin Version #define VERSION "2.1" // Bools new bool:g_Restart; new bool:g_Randromized; new bool:g_Starting; new bool:g_FirstRound; new g_iSemiClip[33], g_sv_restart, g_mp_autoteambalance, g_mp_limitteams, bool:g_isEnabled, g_HudSync, g_HudSync2; new g_Toggle, g_SprayB, g_RadioB, g_Semiclip, g_GiveUsp, g_RemoveBZ, g_HideHud, g_BlockMoney, g_LifeSystem; new g_Maxplayers, g_msgHideWeapon, g_msgCrosshair, g_msgTeamInfo, g_msgMoney, g_BuyZone, g_Lifes[33]; // Macros #if cellbits == 32 #define OFFSET_BZ 235 #else #define OFFSET_BZ 268 #endif enum { FM_TEAM_UNASSIGNED, FM_TEAM_T, FM_TEAM_CT, FM_TEAM_SPECTATOR, FM_TEAM_MAX }; // ======================================================================================= public plugin_init() { register_plugin("Deathrun Manager", VERSION, "xPaw"); g_Toggle = register_cvar("deathrun_toggle", "1"); g_SprayB = register_cvar("deathrun_spray", "1"); g_RadioB = register_cvar("deathrun_radio", "1"); g_Semiclip = register_cvar("deathrun_semiclip", "1"); g_GiveUsp = register_cvar("deathrun_giveusp", "1"); g_RemoveBZ = register_cvar("deathrun_removebz", "1"); g_HideHud = register_cvar("deathrun_hidehud", "1"); g_BlockMoney = register_cvar("deathrun_blockmoney", "1"); g_LifeSystem = register_cvar("deathrun_lifesystem", "1"); g_sv_restart = get_cvar_pointer( "sv_restart" ); g_mp_autoteambalance = get_cvar_pointer( "mp_autoteambalance" ); g_mp_limitteams = get_cvar_pointer( "mp_limitteams" ); register_cvar("deathrun_version", VERSION, FCVAR_SERVER|FCVAR_SPONLY); set_cvar_string("deathrun_version", VERSION); // Registering Language file register_dictionary( "deathrun.txt" ); // Logging Events register_logevent( "eStartRound", 2, "1=Round_Start" ); register_logevent( "eRandromize", 2, "1=Round_End" ); register_event( "SendAudio", "eTerrWin", "a", "2&%!MRAD_terwin" ); register_event( "TextMsg", "eRandromize", "a", "2&#Game_w" ); register_event( "DeathMsg", "eDeath", "a"); register_event( "Money", "eMoney", "b" ); register_event( "ResetHUD", "eResetHUD", "be" ); // Forwards RegisterHam( Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1 ); register_forward( FM_ClientKill, "fwClientKill" ); register_forward( FM_CmdStart, "fwCmdStart" ); register_forward( FM_GetGameDescription,"fwGameDesc" ); g_FirstRound = true; g_Maxplayers = get_maxplayers(); g_msgHideWeapon = get_user_msgid( "HideWeapon" ); g_msgCrosshair = get_user_msgid( "Crosshair" ); g_msgTeamInfo = get_user_msgid( "TeamInfo" ); g_msgMoney = get_user_msgid( "Money" ); g_HudSync = CreateHudSyncObj(); g_HudSync2 = CreateHudSyncObj(); if( get_pcvar_num(g_Toggle) ) { // Block all radio commands register_clcmd("radio1", "cmdBlockRadio"); register_clcmd("radio2", "cmdBlockRadio"); register_clcmd("radio3", "cmdBlockRadio"); register_clcmd("coverme", "cmdBlockRadio"); register_clcmd("takepoint", "cmdBlockRadio"); register_clcmd("holdpos", "cmdBlockRadio"); register_clcmd("regroup", "cmdBlockRadio"); register_clcmd("followme", "cmdBlockRadio"); register_clcmd("takingfire", "cmdBlockRadio"); register_clcmd("go", "cmdBlockRadio"); register_clcmd("fallback", "cmdBlockRadio"); register_clcmd("sticktog", "cmdBlockRadio"); register_clcmd("getinpos", "cmdBlockRadio"); register_clcmd("stormfront", "cmdBlockRadio"); register_clcmd("report", "cmdBlockRadio"); register_clcmd("roger", "cmdBlockRadio"); register_clcmd("enemyspot", "cmdBlockRadio"); register_clcmd("needbackup", "cmdBlockRadio"); register_clcmd("sectorclear", "cmdBlockRadio"); register_clcmd("inposition", "cmdBlockRadio"); register_clcmd("reportingin", "cmdBlockRadio"); register_clcmd("getout", "cmdBlockRadio"); register_clcmd("negative", "cmdBlockRadio"); register_clcmd("enemydown", "cmdBlockRadio"); register_clcmd("say /lifes", "cmdShowlifes"); register_clcmd("say /lives", "cmdShowlifes"); // Terrorist Check set_task(15.0, "eTerrorCheck",_,_,_, "b"); // Lets make restart after 20 seconds from map start. set_task(20.0, "fnRestart"); if( get_pcvar_num(g_RemoveBZ) ) { register_forward( FM_PlayerPostThink, "fwPlayerPostThink"); register_message( get_user_msgid("StatusIcon"), "msgStatusIcon" ); // BuyZone Icon g_BuyZone = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "func_buyzone")); dllfunc(DLLFunc_Spawn, g_BuyZone); engfunc(EngFunc_SetSize, g_BuyZone, {-8192.0, -8192.0, -8192.0}, {-8191.0, -8191.0, -8191.0}); } if( get_pcvar_num(g_Semiclip) ) { register_forward( FM_StartFrame, "fwStartFrame", 0 ); register_forward( FM_AddToFullPack, "fwFullPack", 1 ); } g_isEnabled = true; log_amx("Deathrun Manager by xPaw v%s is ON.", VERSION); } else { g_isEnabled = false; log_amx("Deathrun Manager by xPaw v%s is OFF.", VERSION); } } // ======================================================================================= // ================ // Making new Terr // ================ public eRandromize() { if( !g_isEnabled || g_FirstRound || g_Randromized ) return PLUGIN_CONTINUE; g_Randromized = true; new iPlayers, indexArray[32]; for( new i = 1; i <= g_Maxplayers; i ) { if( is_user_connected(i) ) { indexArray[iPlayers] = i; iPlayers ; } if( get_user_team(i) == 1 ) fm_set_user_team(i, FM_TEAM_CT); } if( iPlayers <= 1 ) return PLUGIN_CONTINUE; new ID = indexArray[random_num(0, iPlayers - 1)]; if( get_user_team(ID) == 2 || get_user_team(ID) == 1 ) { new name[32]; get_user_name(ID, name, 31); client_print(0, print_chat, "[Deathrun] %L", LANG_PLAYER, "MSG_NOW_TERR", name); fm_set_user_team(ID, FM_TEAM_T); } else { g_Randromized = false; eRandromize(); } return PLUGIN_CONTINUE; } // ================ // New round // ================ public eStartRound() { if( !g_isEnabled ) return PLUGIN_CONTINUE; g_Randromized = false; g_Restart = false; g_Starting = false; new g_Players; for( new i = 1; i <= g_Maxplayers; i ) { if(is_user_connected(i) && (get_user_team(i) == 1 || get_user_team(i) == 2) ) g_Players ; } if( g_Players <= 1 ) { set_hudmessage(0, 128, 0, -1.0, 0.1, 0, 4.0, 4.0, 0.5, 0.5, 4); ShowSyncHudMsg(0, g_HudSync, "Not enought players to start Deathrun!"); return PLUGIN_CONTINUE; } set_pcvar_num(g_mp_autoteambalance, 0); set_pcvar_num(g_mp_limitteams, 0); // set_hudmessage(255, 127, 0, -1.0, 0.1, 2, 4.0, 4.0, 0.1, 0.3, 1); // ShowSyncHudMsg(0, g_HudSync, "%L", LANG_PLAYER, "MSG_PREPARE"); if( g_FirstRound ) { log_amx("[Deathrun] %L", LANG_SERVER, "MSG_STARTING"); set_hudmessage(0, 128, 0, -1.0, 0.1, 0, 4.0, 4.0, 0.5, 0.5, 4); ShowSyncHudMsg(0, g_HudSync, "%L", LANG_PLAYER, "MSG_STARTING"); client_print(0, print_chat, "[Deathrun] %L", LANG_PLAYER, "MSG_STARTING"); set_task(9.0, "fnRestart"); g_Starting = true; g_FirstRound = false; } return PLUGIN_CONTINUE; } // ================ // Terrorist Check // ================ public eTerrorCheck() { if( !g_isEnabled || g_FirstRound || g_Starting ) return PLUGIN_CONTINUE; new iTerrors, iPlayers, iTeam; for( new i = 1; i <= g_Maxplayers; i ) { iTeam = get_user_team(i); if( iTeam == 1 ) iTerrors ; if( is_user_connected(i) && (iTeam == 1 || iTeam == 2) ) iPlayers ; } if( iPlayers <= 1 ) { set_hudmessage(0, 128, 0, -1.0, 0.1, 0, 4.0, 4.0, 0.5, 0.5, 4); ShowSyncHudMsg(0, g_HudSync, "Not enought players to start Deathrun!"); return PLUGIN_CONTINUE; } if( iTerrors == 0 ) { if( g_Restart ) return PLUGIN_CONTINUE; g_Restart = true; client_print(0, print_chat, "[Deathrun] %L", LANG_PLAYER, "MSG_NO_DETECT"); log_amx("[Deathrun] %L", LANG_SERVER, "MSG_NO_DETECT"); eRandromize(); for( new i = 1; i <= g_Maxplayers; i ) { if( is_user_alive(i) && get_user_team(i) == 2 ) dllfunc(DLLFunc_ClientKill, i); } } return PLUGIN_CONTINUE; } // ================ // Life System // ================ public eTerrWin() { if( !g_isEnabled || g_FirstRound ) return PLUGIN_CONTINUE; new Float:flFrags; for( new i = 1; i <= g_Maxplayers; i ) { if( get_user_team(i) == 1 ) { pev(i, pev_frags, flFrags); set_pev(i, pev_frags, flFrags 3.0); if( get_pcvar_num(g_LifeSystem) == 2 ) g_Lifes ; } } return PLUGIN_CONTINUE; } public eDeath() { if( !g_isEnabled || get_pcvar_num(g_LifeSystem) == 0 ) return PLUGIN_CONTINUE; new iKiller = read_data( 1 ); new iVictim = read_data( 2 ); if( iKiller != iVictim && get_user_team(iKiller) != get_user_team(iVictim) ) g_Lifes[iKiller] ; if( get_user_team(iVictim) == 2 && g_Lifes[iVictim] > 0 ) { new iCTcount; for( new i = 1; i <= g_Maxplayers; i ) { if( is_user_alive(i) && get_user_team(i) == 2 ) iCTcount ; } if( iCTcount > 1 ) { set_task(3.2, "fnRevivePlayer", iVictim); client_print(iVictim, print_chat, "[Deathrun] You will be respawned in 3 seconds!"); } else client_print(iVictim, print_chat, "[Deathrun] You could be respawned but all CT's are dead now!"); } return PLUGIN_CONTINUE; } public fnRevivePlayer( id ) { if( is_user_connected(id) ) { new iCTcount; for( new i = 1; i <= g_Maxplayers; i ) if( is_user_alive(i) && get_user_team(i) == 2 ) iCTcount ; if( iCTcount > 1 ) { ExecuteHamB(Ham_CS_RoundRespawn, id); g_Lifes[id]--; } } } public cmdShowlifes( id ) { if( get_pcvar_num(g_LifeSystem) == 0 ) { client_print(id, print_chat, "[Deathrun] Life system is disabled."); return PLUGIN_HANDLED; } if( g_Lifes[id] > 0 ) client_print(id, print_chat, "[Deathrun] You have %i lifes.", g_Lifes[id]); else client_print(id, print_chat, "[Deathrun] You dont have lifes, kill enemy to get one!"); return PLUGIN_HANDLED; } public Showlifes( id ) { set_hudmessage(0, 128, 0, 0.04, 0.71, 0, 4.0, 4.0, 0.5, 0.5, 3); if( g_Lifes[id] > 0 ) ShowSyncHudMsg(id, g_HudSync2, "You have %i lifes.", g_Lifes[id]); else ShowSyncHudMsg(id, g_HudSync2, "You dont have lifes^nKill enemy to get one!"); } // ================ // Events // ================ public eResetHUD( id ) { if( g_isEnabled && get_pcvar_num(g_HideHud) && !is_user_bot( id ) ) { message_begin( MSG_ALL, g_msgHideWeapon, _, id ); write_byte( (1<<4 | 1<<5) ); message_end(); message_begin( MSG_ALL, g_msgCrosshair, _, id ); write_byte( 0 ); message_end(); } } public client_disconnect() eTerrorCheck(); public eMoney( id ) { if( g_isEnabled && get_pcvar_num(g_BlockMoney) ) { set_pdata_int ( id, 115, 0 ); message_begin ( MSG_ONE, g_msgMoney, _, id ); write_long ( 0 ); write_byte ( 1 ); message_end (); } } // ======================================================================================= // Semiclip // ======================================================================================= public fwFullPack( es, e, ent, host, flags, player, pSet ) { if( !g_isEnabled ) return FMRES_IGNORED; if( player && g_iSemiClip[ent] && g_iSemiClip[host] ) { set_es(es, ES_Solid, SOLID_NOT); set_es(es, ES_RenderMode, kRenderTransAlpha); set_es(es, ES_RenderAmt, 100); } return FMRES_IGNORED; } public fwStartFrame() { if( !g_isEnabled ) return FMRES_IGNORED; static iPlayers[32], iNum, iPlayer, iPlayer2; get_players(iPlayers, iNum); arrayset(g_iSemiClip, 0, sizeof(g_iSemiClip)); new iTeams[33] = {-1, ...}; for( new i = 0; i < iNum; i ) { iPlayer = iPlayers; if( !is_user_alive(iPlayer) ) continue; for( new j = 0; j < iNum; j ) { iPlayer2 = iPlayers[j]; if(iPlayer == iPlayer2 || !is_user_alive(iPlayer2)) continue; static Float:vOrigin1[3], Float:vOrigin2[3]; pev(iPlayer, pev_origin, vOrigin1); pev(iPlayer2, pev_origin, vOrigin2); if( vector_distance( vOrigin1, vOrigin2 ) < 96) { if( iTeams[iPlayer] == -1 ) iTeams[iPlayer] = get_user_team(iPlayer); if( iTeams[iPlayer2] == -1 ) iTeams[iPlayer2] = get_user_team(iPlayer2); if( iTeams[iPlayer] == 2 && iTeams[iPlayer2] == 2 ) { g_iSemiClip[iPlayer] = true; g_iSemiClip[iPlayer2] = true; } } } } for( new i = 0; i < iNum; i ) { iPlayer = iPlayers; if( is_user_alive(iPlayer) ) set_pev(iPlayer, pev_solid, g_iSemiClip[iPlayer] ? SOLID_NOT : SOLID_SLIDEBOX); } return FMRES_IGNORED; } // ======================================================================================= // Forwards & Block commands // ======================================================================================= public fwHamPlayerSpawnPost( id ) { if( !g_isEnabled || !is_user_alive( id ) ) return HAM_IGNORED; // An small delay for message if( get_pcvar_num(g_LifeSystem) != 0 ) set_task(0.8, "Showlifes", id); fm_strip_user_weapons( id ); fm_give_item( id, "weapon_knife" ); if( get_pcvar_num(g_GiveUsp) && get_user_team(id) == 2 ) { fm_give_item( id, "weapon_usp" ); fm_give_item( id, "ammo_45acp" ); fm_give_item( id, "ammo_45acp" ); fm_give_item( id, "ammo_45acp" ); fm_give_item( id, "ammo_45acp" ); fm_give_item( id, "ammo_45acp" ); fm_give_item( id, "ammo_45acp" ); } return HAM_IGNORED; } public fwGameDesc() { if( !g_isEnabled ) return FMRES_IGNORED; static szGameName[ 32 ]; format(szGameName, 31, "Deathrun v%s", VERSION); forward_return(FMV_STRING, szGameName); return FMRES_SUPERCEDE; } public fwPlayerPostThink( id ) { if( g_isEnabled && is_user_alive(id)) set_pdata_int(id, OFFSET_BZ, get_pdata_int(id, OFFSET_BZ, 5) & ~(1<<0), 5); return FMRES_IGNORED; } public fwClientKill( id ) { if( !g_isEnabled || !is_user_alive(id) ) return FMRES_IGNORED; client_print(id, print_center, "[Deathrun] You can't kill yourself!"); client_print(id, print_console, "[Deathrun] You can't kill yourself!"); return FMRES_SUPERCEDE; } public fwCmdStart( id, uc_handle, seed ) { if( g_isEnabled && get_pcvar_num(g_SprayB) && get_uc(uc_handle, UC_Impulse) == 201 ) { if( is_user_alive(id) ) { set_uc(uc_handle, UC_Impulse, 0); client_print(id, print_center, "%L", id, "BLOCK_SPRAY"); return FMRES_SUPERCEDE; } } return FMRES_IGNORED; } public msgStatusIcon( msg_id, msg_dest, id ) { new szIcon[8]; get_msg_arg_string(2, szIcon, 7); if( equal(szIcon, "buyzone") ) return PLUGIN_HANDLED; return PLUGIN_CONTINUE; } public cmdBlockRadio( id ) { if( g_isEnabled && get_pcvar_num(g_RadioB) && is_user_alive(id) ) { client_print(id, print_center, "%L", id, "BLOCK_RADIO"); return PLUGIN_HANDLED; } return PLUGIN_CONTINUE; } public fnRestart() set_pcvar_num(g_sv_restart, 1); // ======================================================================================= // Stocks // ======================================================================================= stock fm_set_user_team(client, team) { set_pdata_int(client, 114, team); static const TeamInfo[FM_TEAM_MAX][] = { "UNASSIGNED", "TERRORIST", "CT", "SPECTATOR" }; message_begin(MSG_ALL, g_msgTeamInfo); write_byte(client); write_string(TeamInfo[team]); message_end(); } stock fm_strip_user_weapons(index) { new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "player_weaponstrip")); if (!pev_valid(ent)) return 0; dllfunc(DLLFunc_Spawn, ent); dllfunc(DLLFunc_Use, ent, index); engfunc(EngFunc_RemoveEntity, ent); return 1; } stock fm_give_item(index, const item[]) { if (!equal(item, "weapon_", 7) && !equal(item, "ammo_", 5) && !equal(item, "item_", 5)) return 0; new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, item)); if (!pev_valid(ent)) return 0; new Float:origin[3]; pev(index, 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, index); if (pev(ent, pev_solid) != save) return ent; engfunc(EngFunc_RemoveEntity, ent); return -1; }
ShAd0w ;x
Nou Venit
Nou Venit
Posts: 5
Joined: Mon Mar 08, 2010 7:52 am

Re: Modificare plugin

Post by ShAd0w ;x »

din cate stiu eu...apare ca in poza la deathrun v3.0 ; nu stiu sigur daca poti sa il colorezi si la o versiune precedenta! dar eu te sfatuiesc sa folosesti v3.0 a modului!
User avatar
CryWolf
Sys Admin
Sys Admin
Posts: 443
Joined: Tue Dec 15, 2009 11:32 am
Detinator Steam: Da
Cunostinte CS: Excelente
Reputatie: Detinator
Webmaster
Scripter
Trance Fan
Location: Botosani
Contact:

Re: Modificare plugin

Post by CryWolf »

Daca vrei totusi pot sa ti-l colorez pe acesta trebuie doar sa incercuiesti ce vrei sa fie colorat
ca asa de la sine nu stiu deoarece nu am jucat deathrun :)
Info: NU IMI DATI PM PENTRU CERERI AJUTOR ETC (NU RASPUND) FOLOSITI FORUMUL.
Image

Image
CUM SA NU LUPTI PENTRU IUBIRE ????
Daca lupti,inseamna ca vrei sa castigi ceva.Iubirea nu-i o miza.
AnTyDoT
Nou Venit
Nou Venit
Posts: 9
Joined: Sun Mar 06, 2011 8:42 pm

Re: Modificare plugin

Post by AnTyDoT »

Adaugi codu asta de mai jos in plugin sma file si modifici in data lang txt cu !y normal !g verde !team echipei specifice inaintea scrisului dorit sa arate colorat

Code: Select all

}
stock chat_color(const id, const input[], any:...)
{
    new count = 1, players[32]
    static msg[191]
    vformat(msg, 190, input, 3)
   
    replace_all(msg, 190, "!g", "^4")
    replace_all(msg, 190, "!y", "^1")
    replace_all(msg, 190, "!team", "^3")
    replace_all(msg, 190, "!team2", "^0")
   
    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();
            }
        }
    }
}
Post Reply