#1 |
Acá les traigo un pequeño aporte.
Autor; io
Plugin: Rangos CS:GO
Versión: 1,0
Espero que le sirva a alguien o les genere visitas (?)
Hay cosas incompletas pero que va, está fri.
Autor; io
Plugin: Rangos CS:GO
Versión: 1,0
Espero que le sirva a alguien o les genere visitas (?)
Hay cosas incompletas pero que va, está fri.
Código PHP:
/* Script generated by Pawn Studio
Rangos CS:GO v1.0
*/
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <fakemeta>
#include <colorchat>
#include <adv_vault>
new const PLUGIN[][] = {"Rangos + Skins CS:GO", "1,0", "ChrstopHr" , "[R CS:GO]"};
#define m_LastHitGroup 75
#define TASK_SHOWHUD 50000
#define ID_SHOWHUD (taskid - TASK_SHOWHUD)
#define cs_get_user_team(%1) get_pdata_int(%1,114)
enum TutorColor { TUTOR_RED = 1, TUTOR_BLUE, TUTOR_YELLOW, TUTOR_GREEN };
enum _:Armas{ CSW_NAME, WPN_ID[20], V_MDL[70], NAMEE[70], Nivel, CATEGORIA};
enum { KNIFES = 1, M4A1, AWP, DEAGLE, GLOCK18, AK47, USP };
enum _:rango { rangos_nombre[64], nivel_requerido };
enum _:ADM_DATA { ADMIN_TYPE[ 30 ], ADMIN_FLAGS };
enum { Cargar = 0, Guardar };
enum { PTS, MAX_FIELDS };
new const WEAPONENTNAMES[][] = { "", "weapon_p228", "", "weapon_scout", "weapon_hegrenade", "weapon_xm1014", "weapon_c4", "weapon_mac10",
"weapon_aug", "weapon_smokegrenade", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550",
"weapon_galil", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249",
"weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "weapon_flashbang", "weapon_deagle", "weapon_sg552",
"weapon_ak47", "weapon_knife", "weapon_p90" }
new const rangos[][rango] = {
{ "--", 100 },
{"Newbie", 200},
{"Soldado", 350},
{ "Silver I", 688 },
{ "Silver II", 3888 },
{ "Silver III", 10388 },
{ "Silver IV", 20938 },
{ "Silver Elite", 36288 },
{ "Silver Elite Master", 44189 },
{ "Gold Nova I", 57198 },
{ "Gold Nova II", 72896 },
{ "Gold Nova III", 91578 },
{ "Gold Nova Master", 115039 },
{ "Master Guardian I", 143521 },
{ "Master Guardian II", 178071 },
{ "Master Guardian Elite", 218974 },
{ "Distinguished Master Guardian", 266372 },
{ "Legendary Eagle", 319588 },
{ "Legendary Eagle Master", 379214 },
{ "Supreme Master First Class", 445082 },
{ "The Global Elite", 516995 },
{ "The Global Elite II", 517995 },
{"Amo Supremo", 519995},
{"", 99999999}
}
new const Admins[][ADM_DATA] =
{
{ "[ adm1 :v ]", ADMIN_RCON },
{ "[ adm2 :v ]", ADMIN_LEVEL_A },
{ "[ adm3 :v ]", ADMIN_LEVEL_B },
{ "[ adm4 :v ]", ADMIN_LEVEL_G },
{ "[ adm5 :v ]", ADMIN_LEVEL_H }
};
new const CT[][] = { "Go_arctic", "Go_gign", "Go_gsg9" };
new const TT[][] = { "Go_sas", "Go_terror", "Go_urban" };
new const ADMIN_TT[][] = { "adm_go" };
new const ADMIN_CT[][] = { "adm_go2" };
new const g_TutorPrecache[][] = {
"gfx/career/icon_!.tga",
"gfx/career/icon_!-bigger.tga",
"gfx/career/icon_i.tga",
"gfx/career/icon_i-bigger.tga",
"gfx/career/icon_skulls.tga",
"gfx/career/round_corner_ne.tga",
"gfx/career/round_corner_nw.tga",
"gfx/career/round_corner_se.tga",
"gfx/career/round_corner_sw.tga",
"resource/TutorScheme.res",
"resource/UI/TutorTextWindow.res"
}
new const Modelos[][Armas] =
{
{ CSW_KNIFE, "weapon_knife", "models/CsGo_Mexico/v_knifebutterfly.mdl", "knifebutterfly", 3, KNIFES},
{ CSW_KNIFE, "weapon_knife", "models/CsGo_Mexico/v_knifefalchion.mdl", "knifefalchion", 6, KNIFES},
{ CSW_KNIFE, "weapon_knife", "models/CsGo_Mexico/v_knifehuntsman.mdl", "knifehuntsman", 9, KNIFES},
{ CSW_KNIFE, "weapon_knife", "models/CsGo_Mexico/v_knifelore.mdl", "knifelore", 12, KNIFES},
{ CSW_KNIFE, "weapon_knife", "models/CsGo_Mexico/v_knifem9fade.mdl", "knifem9fade", 15, KNIFES},
{ CSW_KNIFE, "weapon_knife", "models/CsGo_Mexico/v_knifem9huntsmanurban.mdl", "knifem9huntsmanurban", 18, KNIFES},
{ CSW_M4A1, "weapon_m4a1", "models/CsGo_Mexico/v_m4a1chanticosfire.mdl", "m4a1chanticosfire", 3, M4A1},
{ CSW_M4A1, "weapon_m4a1", "models/CsGo_Mexico/v_m4a1cyrex.mdl", "m4a1cyrex", 6, M4A1},
{ CSW_M4A1, "weapon_m4a1", "models/CsGo_Mexico/v_m4a1goldencoil.mdl", "m4a1goldencoil", 9, M4A1},
{ CSW_M4A1, "weapon_m4a1", "models/CsGo_Mexico/v_m4a1guardian2.mdl", "m4a1guardian2", 12, M4A1},
{ CSW_M4A1, "weapon_m4a1", "models/CsGo_Mexico/v_m4a1howl.mdl", "m4a1howl", 15, M4A1},
{ CSW_M4A1, "weapon_m4a1", "models/CsGo_Mexico/v_m4a1icarus1.mdl", "m4a1icarus1", 18, M4A1},
{ CSW_M4A1, "weapon_m4a1", "models/CsGo_Mexico/v_m4a1masterpiece.mdl", "m4a1masterpiece", 21, M4A1},
{ CSW_AWP, "weapon_awp", "models/CsGo_Mexico/v_awpboom.mdl", "awpboom", 4, AWP},
{ CSW_AWP, "weapon_awp", "models/CsGo_Mexico/v_awpdragonlore.mdl", "awpdragonlore", 9, AWP},
{ CSW_AWP, "weapon_awp", "models/CsGo_Mexico/v_awpfireblaze.mdl", "awpfireblaze", 12, AWP},
{ CSW_AWP, "weapon_awp", "models/CsGo_Mexico/v_awpgraffiti.mdl", "awpgraffiti", 15, AWP},
{ CSW_AWP, "weapon_awp", "models/CsGo_Mexico/v_awplightningstrike.mdl", "awplightningstrike", 18, AWP},
{ CSW_AWP, "weapon_awp", "models/CsGo_Mexico/v_awptigertooth.mdl", "awptigertooth", 20, AWP},
{ CSW_DEAGLE, "weapon_deagle", "models/CsGo_Mexico/v_deaglealexandria.mdl", "deaglealexandria", 4, DEAGLE},
{ CSW_DEAGLE, "weapon_deagle", "models/CsGo_Mexico/v_deagleblackred.mdl", "deagleblackred", 9, DEAGLE},
{ CSW_DEAGLE, "weapon_deagle", "models/CsGo_Mexico/v_deagleblaze.mdl", "deagleblaze", 12, DEAGLE},
{ CSW_DEAGLE, "weapon_deagle", "models/CsGo_Mexico/v_deagleconspiracy.mdl", "deagleconspiracy", 15, DEAGLE},
{ CSW_DEAGLE, "weapon_deagle", "models/CsGo_Mexico/v_deaglefireelemental.mdl", "deaglefireelemental", 18, DEAGLE},
{ CSW_DEAGLE, "weapon_deagle", "models/CsGo_Mexico/v_deaglewildfire.mdl", "deaglewildfire", 20, DEAGLE},
{ CSW_GLOCK18, "weapon_glock18", "models/CsGo_Mexico/v_glock18candyapple.mdl", "lock18candyapple", 4, GLOCK18},
{ CSW_GLOCK18, "weapon_glock18", "models/CsGo_Mexico/v_glock18element.mdl", "glock18element", 9, GLOCK18},
{ CSW_GLOCK18, "weapon_glock18", "models/CsGo_Mexico/v_glock18fade.mdl", "glock18fade", 12, GLOCK18},
{ CSW_GLOCK18, "weapon_glock18", "models/CsGo_Mexico/v_glock18fireelemental.mdl", "lock18fireelemental", 15, GLOCK18},
{ CSW_GLOCK18, "weapon_glock18", "models/CsGo_Mexico/v_glock18pink.mdl", "glock18pink", 18, GLOCK18},
{ CSW_GLOCK18, "weapon_glock18", "models/CsGo_Mexico/v_glock18TriStrike.mdl", "glock18TriStrike", 20, GLOCK18},
{ CSW_AK47, "weapon_ak47", "models/CsGo_Mexico/v_ak47aquamarine.mdl", "ak47aquamarine", 3, AK47},
{ CSW_AK47, "weapon_ak47", "models/CsGo_Mexico/v_ak47casehardened.mdl", "ak47casehardened", 6, AK47},
{ CSW_AK47, "weapon_ak47", "models/CsGo_Mexico/v_ak47fireserpent.mdl", "ak47fireserpent", 9, AK47},
{ CSW_AK47, "weapon_ak47", "models/CsGo_Mexico/v_ak47fuelinjector.mdl", "ak47fuelinjector", 12, AK47},
{ CSW_AK47, "weapon_ak47", "models/CsGo_Mexico/v_ak47Misty.mdl", "ak47Misty", 15, AK47},
{ CSW_AK47, "weapon_ak47", "models/CsGo_Mexico/v_ak47propaganda.mdl", "ak47propaganda", 18, AK47},
{ CSW_USP, "weapon_usp", "models/CsGo_Mexico/v_uspcaiman.mdl", "uspcaiman", 4, USP},
{ CSW_USP, "weapon_usp", "models/CsGo_Mexico/v_uspcondor.mdl", "uspcondor", 9, USP},
{ CSW_USP, "weapon_usp", "models/CsGo_Mexico/v_uspfuelinjector.mdl", "uspfuelinjector", 12, USP},
{ CSW_USP, "weapon_usp", "models/CsGo_Mexico/v_uspguardian.mdl", "uspguardian", 15, USP},
{ CSW_USP, "weapon_usp", "models/CsGo_Mexico/v_usporion.mdl", "usporion", 18, USP},
{ CSW_USP, "weapon_usp", "models/CsGo_Mexico/v_usppink.mdl", "usppink", 21, USP}
}
new g_isPoint[ 33 ], g_isRango[ 33 ], g_isDivision[ 33 ], g_isElegida[ 33 ];
new g_isTipo[ 33 ][ 30 ], g_isName[ 33 ][ 32 ];
new g_isMsgTutor, g_isMsgTutClose, g_isMaxPlayers;
new MsgHudSync;
new const horas[] = { 00, 04, 08, 12, 16, 20 };
new bool: g_isHappytime, g_isCat[ 33 ];
new iCampos[MAX_FIELDS], iVault;
const TASK_TUTOR = 467666646;
public plugin_init()
{
register_plugin(PLUGIN[0], PLUGIN[1], PLUGIN[2]);
// Add your own code here
RegisterHam(Ham_Killed, "player", "Ham_PlayerKilled", 1);
RegisterHam(Ham_Spawn, "player", "ham_PlayerSpawn_Post", 1);
for(new i = 1; i < sizeof WEAPONENTNAMES; i++)
if(WEAPONENTNAMES[i][0]) RegisterHam(Ham_Item_Deploy, WEAPONENTNAMES[i], "ham_ItemDeploy_AllWeapons", 1)
register_forward(FM_SetModel, "fw_SetModel")
register_event("HLTV", "round_start", "a", "1=0", "2=0");
g_isMsgTutor = get_user_msgid("TutorText");
g_isMsgTutClose = get_user_msgid("TutorClose");
g_isMaxPlayers = get_maxplayers();
MsgHudSync = CreateHudSyncObj();
register_concmd("go_puntos", "cmd_puntos", ADMIN_RCON, "<nombre> <puntos>");
register_clcmd("say test", "cmdMenu");
register_clcmd("say", "BlockSay");
iVault = adv_vault_open("asad", false);
iCampos[PTS] = adv_vault_register_field(iVault, "pts");
adv_vault_init(iVault);
}
public plugin_precache()
{
static i;
for(i = 0; i < sizeof(TT); ++i) precache_player_model(TT[i]);
for(i = 0; i < sizeof(CT); ++i) precache_player_model(CT[i]);
for(i = 0; i < sizeof(ADMIN_TT); ++i) precache_player_model(ADMIN_TT[i]);
for(i = 0; i < sizeof(ADMIN_CT); ++i) precache_player_model(ADMIN_CT[i]);
for(i = 0; i < sizeof g_TutorPrecache; i++) engfunc(EngFunc_PrecacheGeneric,g_TutorPrecache[i]);
for(i = 0; i < sizeof Modelos; i++) precache_model(Modelos[i][V_MDL]);
}
public cmd_puntos (id, puntos, cid)
{
if (!cmd_access(id, puntos, cid, 3)) return PLUGIN_HANDLED;
new arg[33], arg2[10];
read_argv(1, arg, charsmax(arg));
read_argv(2, arg2, charsmax(arg2));
new Player = cmd_target(id, arg,CMDTARGET_ONLY_ALIVE);
if (!Player)
{
client_print(id, print_console, "Player no registrado."); return PLUGIN_HANDLED;
}
g_isPoint[Player] += str_to_num(arg2) ;
chequear_rango(Player);
return PLUGIN_HANDLED;
}
public client_putinserver( index ) {
g_isDivision[ index ] = g_isRango[ index ] = 0;
g_isPoint[ index ] = 100;
set_task(1.0, "ShowHUD", index+TASK_SHOWHUD, _, _, "b" );
get_user_name( index, g_isName[ index ], 31 );
g_isTipo[ index ] = "^0";
if(is_user_admin( index ))
{
static i, flags; flags = get_user_flags( index );
for(i = 0 ; i < sizeof Admins ; i++ )
{
if(flags & Admins[i][ADMIN_FLAGS])
{
formatex(g_isTipo[index], charsmax(g_isTipo), "%s", Admins[i][ADMIN_TYPE]);
break;
}
}
}
Type(index, Cargar);
}
public client_disconnect(index) { remove_task(index+TASK_SHOWHUD); Type(index, Guardar); }
public round_start() {
set_task(0.1,"happyhour");
for(new i = 1; i <= g_isMaxPlayers; ++i)
client_print(i, print_chat, "[%s] Plugin Hecho por Hypnotize.'", PLUGIN[3]);
}
public happyhour(id)
{
new data[12];
get_time("%H", data, 12);
new Tiempo = str_to_num(data);
for(new i=0;i <= sizeof horas - 1;i++)
{
if(Tiempo != horas[i]) continue;
g_isHappytime = true;
break;
}
if(g_isHappytime)
{
tutorMake(id, TUTOR_GREEN, 3.0, "[%s] Estas Jugando La hora feliz", PLUGIN[3]);
client_print(id, print_chat, "Estas en^x04 Happy Hour^x01 disfruta mientas ganas el^x04 Doble^x01 de Puntos");
}
}
public ShowHUD(const taskid)
{
new id
id = ID_SHOWHUD
if (!is_user_alive(id))
{
id = pev(id, pev_iuser2)
if (!is_user_alive(id)) return;
}
set_hudmessage(255, 5, 5, 0.0, 0.20, 0, 6.0, 1.1, 0.0, 0.0)
ShowSyncHudMsg(id, MsgHudSync, "//*===== CS:GO Mexico =====*\\^nRango: %s | Puntos: %d/519995^nDivision: %d^nHH: %sctivado^nSig. Rango: %s^n//*=====================*\\",
rangos[g_isRango[id]][rangos_nombre], g_isPoint[id], g_isDivision[id], g_isHappytime ? "A" : "Desa", rangos[g_isRango[id]+1][rangos_nombre])
}
public Ham_PlayerKilled(const victim, const attacker, const shouldgib) {
if (!is_user_connected(attacker) || (victim == attacker)) return;
if(g_isPoint[ attacker ] >= 519995)
client_print(attacker, print_chat, "%s alcanzaste el maximo de puntos no puedes sumar mas!", PLUGIN[3]);
else{
if( g_isPoint[ victim ] >= 6 )
{
if(get_pdata_int(victim, m_LastHitGroup, 5) == HIT_HEAD){
g_isPoint[ attacker ] += g_isHappytime ? 7 : 5;
client_print(attacker, print_chat, "%s Ganas %s Puntos por matar de HS.", PLUGIN[3], g_isHappytime ? "7" : "5" );
g_isPoint[ victim ] -= g_isHappytime ? 7 : 5;
client_print( victim, print_chat, "%s Perdiste %s puntos por morir de HeadShot.",PLUGIN[3], g_isHappytime ? "7" : "5" );
}
else if (get_user_weapon(attacker) == CSW_KNIFE){
g_isPoint[ attacker ] += g_isHappytime ? 12 : 10;
client_print(attacker, print_chat, "%s Ganas %d Puntos por matar con knife.", PLUGIN[3], g_isHappytime ? 12 : 10);
g_isPoint[ victim ] -= g_isHappytime ? 12 : 10;
client_print( victim, print_chat, "%s Perdiste %s puntos por morir de knife.",PLUGIN[3], g_isHappytime ? "10" : "12" );
}
else{
g_isPoint[ attacker ] += g_isHappytime ? 6 : 3;
client_print(attacker, print_chat, "%s Ganas %d Puntos por matar.", PLUGIN[3], g_isHappytime ? 6 : 3);
g_isPoint[ victim ] -= g_isHappytime ? 6 : 3;
client_print( victim, print_chat, "%s Perdiste %s puntos por morir.",PLUGIN[3], g_isHappytime ? "6" : "3" );
}
}
else if( g_isPoint[ victim ] == 0 )
{
if(get_pdata_int(victim, m_LastHitGroup, 5) == HIT_HEAD){
g_isPoint[ attacker ] += g_isHappytime ? 7 : 5;
client_print(attacker, print_chat, "%s Ganas %s Puntos por matar de HS.", PLUGIN[3], g_isHappytime ? "7" : "5" );
}
else if (get_user_weapon(attacker) == CSW_KNIFE){
g_isPoint[ attacker ] += g_isHappytime ? 12 : 10;
client_print(attacker, print_chat, "%s Ganas %d Puntos por matar con knife.", PLUGIN[3], g_isHappytime ? 12 : 10);
}
else{
g_isPoint[ attacker ] += g_isHappytime ? 6 : 3;
client_print(attacker, print_chat, "%s Ganas %d Puntos por matar.", PLUGIN[3], g_isHappytime ? 6 : 3);
}
}
}
new Float:flHealth, Float:flMaxHealth = 125.0; pev(attacker, pev_health, flHealth);
if( flHealth < flMaxHealth )
{
new Float:flNewHealth; new Float:flBonus = 10.0;
flNewHealth = floatmin(flHealth + flBonus, flMaxHealth);
set_pev(attacker, pev_health, flNewHealth);
ColorChat(attacker, NORMAL, "^4[^3CS:GO^4]^1 En Horabuena Recibiste ^4+%.0f ^1de hp", flNewHealth - flHealth);
}
chequear_rango(attacker);
chequear_rango(victim);
}
public ham_PlayerSpawn_Post(const id)
{
if(!is_user_alive(id)) return;
switch(cs_get_user_team(id)) {
case CS_TEAM_CT:{
if(is_user_admin(id))
cs_set_user_model(id, ADMIN_CT[random(sizeof ADMIN_CT)]);
else
cs_set_user_model(id, CT[random(sizeof CT)]);
}
case CS_TEAM_T: {
if(is_user_admin(id))
cs_set_user_model(id, ADMIN_TT[random(sizeof ADMIN_TT)]);
else
cs_set_user_model(id, TT[random(sizeof TT)]);
}
}
tutorMake(id, TUTOR_GREEN, 3.0, "[%s] Plugin Hecho por Hypnotize.'", PLUGIN[3]);
client_print(id, print_chat, "[%s] Plugin Hecho por Hypnotize.'", PLUGIN[3]);
}
public chequear_rango(const id)
{
static level; level = g_isRango[id];
while(g_isPoint[id] >= rangos[g_isRango[id]][nivel_requerido] && g_isRango[id] < sizeof (rangos)+1 )
++g_isRango[id];
while (g_isPoint[id] < rangos[g_isRango[id]][nivel_requerido] && g_isRango[id] > 0)
--g_isRango[id];
g_isElegida[ id ] = 0;
if (g_isRango[id] > level)
{
tutorMake(id, TUTOR_GREEN, 3.0, "[%s] subiste al rango %s .", PLUGIN[3], rangos[g_isRango[id]][rangos_nombre])
client_print(id, print_chat, "%s subiste al rango %s .", PLUGIN[3], rangos[g_isRango[id]][rangos_nombre]);
}
else if (g_isRango[id] < level)
{
tutorMake(id, TUTOR_GREEN, 3.0, "[%s] bajaste al rango %s .", PLUGIN[3], rangos[g_isRango[id]][rangos_nombre])
client_print(id, print_chat, "%s bajaste al rango %s .", PLUGIN[3], rangos[g_isRango[id]][rangos_nombre]);
}
if(g_isPoint[id] >= 519995)
{
g_isRango[ id ] = 0;
g_isPoint[ id ] = 100;
++g_isDivision[ id ];
client_print(id, print_chat, "Has hecho una Division! :3 Ahora Estas en la Division: %d", g_isDivision[id])
}
}
public cmdMenu(id)
{
new gMenu = menu_create("\rMenu skins", "handlerMenu");
menu_additem(gMenu, "Knives", "1");
menu_additem(gMenu, "m4a1", "2");
menu_additem(gMenu, "Awp", "3") ;
menu_additem(gMenu, "Deagle", "4") ;
menu_additem(gMenu, "Glock18", "5") ;
menu_additem(gMenu, "Ak47", "6") ;
menu_additem(gMenu, "Usp", "7") ;
menu_display(id, gMenu, 0);
}
public handlerMenu(id, menu, item) {
if(item == MENU_EXIT) {
menu_destroy(menu);
return PLUGIN_HANDLED;
}
switch(item) {
case 0: g_isCat[ id ] = KNIFES
case 1: g_isCat[ id ] = M4A1
case 2: g_isCat[ id ] = AWP
case 3: g_isCat[ id ] = DEAGLE
case 4: g_isCat[ id ] = GLOCK18
case 5: g_isCat[ id ] = AK47
case 6: g_isCat[ id ] = USP
}
menu_armas(id)
return PLUGIN_HANDLED;
}
public menu_armas(id)
{
new menu = menu_create("Menu Skins", "handler_skins");
static Item[2];
for(new i = 0; i < sizeof Modelos; i++)
{
if(Modelos[i][CATEGORIA] != g_isCat[ id ]) continue;
Item[0] = i;
if(g_isRango[id] >= Modelos[i][Nivel])
menu_additem(menu, Modelos[i][NAMEE], Item);
else
menu_additem(menu, "\r[Locked]", "");
}
menu_display(id, menu)
}
public handler_skins(id, menu, item) {
if(item == MENU_EXIT) {
menu_destroy(menu);
return;
}
static Item[2], AccessCallBack;
menu_item_getinfo(menu, item, AccessCallBack, Item, charsmax(Item), _, _, AccessCallBack)
if (g_isRango[id] < Modelos[Item[0]][Nivel])
return;
g_isElegida[id] = Item[0];
return;
}
public ham_ItemDeploy_AllWeapons(wpn)
{
static id; id = fm_cs_get_weapon_ent_owner(wpn);
if (!pev_valid(id)) return;
static WeaponID, WeaponConstID; WeaponID = cs_get_weapon_id(wpn);
WeaponConstID = get_weapon_const_id(WeaponID, id/*, 1*/)
if(!is_user_alive(id) || WeaponConstID == -1) return;
/*if(g_isElegida[id] > -1)
set_pev(id, pev_viewmodel2, Modelos[get_weapon_const_id(WeaponID, id, 2)][V_MDL]);
else
*/
set_pev(id, pev_viewmodel2, Modelos[WeaponConstID][V_MDL]);
}
get_weapon_const_id(weapon, id/*, iTipo*/)
{
new wpn = -1;
for(new i; i < sizeof Modelos; i++){
if(weapon == Modelos[i][CSW_NAME] && g_isRango[id] >= Modelos[i][Nivel])
wpn = i;
}
/*if(iTipo == 1){
for(new i; i < sizeof Modelos; i++){
if(weapon == Modelos[i][CSW_NAME] && g_isRango[id] >= Modelos[i][Nivel])
return i;
}
}else if(iTipo == 2){
for(new i; i < sizeof Modelos; i++){
if(Modelos[i][CATEGORIA] != g_isCat[ id ]) continue;
if(g_isRango[id] >= Modelos[i][Nivel] && g_isElegida[id] > -1)
return i;
}
}
return PLUGIN_HANDLED;
*/
return wpn;
}
public BlockSay( index )
{
static said[191];
read_args(said, charsmax(said));
remove_quotes(said);
replace_all(said, charsmax(said), "%", " "); replace_all(said, charsmax(said), "#", " ");
if (!ValidMessage(said, 1)) return PLUGIN_CONTINUE;
static color[11], prefix[91]
get_user_team(index, color, charsmax(color))
formatex(prefix, charsmax(prefix), "%s ^x04%s^x01[ ^x04%s ^x01] ^x03%s",
is_user_alive( index ) ? "^x01" : "^x01*MUERTO* ", g_isTipo[ index ], rangos[ g_isRango[ index ] ][ rangos_nombre ], g_isName[ index ])
if (is_user_admin(index)) format(said, charsmax(said), "^x04%s", said)
format(said, charsmax(said), "%s^x01 : %s", prefix, said)
static i, team[11];
for (i = 1; i <= g_isMaxPlayers; i++)
{
if (!is_user_connected(i)) continue;
if (is_user_admin(i) || is_user_alive(index) && is_user_alive(i) || !is_user_alive(index) && !is_user_alive(i))
{
get_user_team(i, team, charsmax(team))
changeTeamInfo(i, color)
writeMessage(i, said)
changeTeamInfo(i, team)
}
}
return PLUGIN_HANDLED_MAIN;
}
public changeTeamInfo(player, team[])
{
message_begin(MSG_ONE, get_user_msgid( "TeamInfo" ), _, player)
write_byte(player)
write_string(team)
message_end()
}
public writeMessage(player, message[])
{
message_begin(MSG_ONE, get_user_msgid( "SayText" ), {0, 0, 0}, player)
write_byte(player)
write_string(message)
message_end()
}
public fw_SetModel(entity, const model[])
{
static class[10] ;
pev(entity, pev_classname, class, sizeof class - 1) ;
if (equal(class, "weaponbox"))
{
set_pev(entity, pev_nextthink, get_gametime() + 1.0) ;
return;
}
}
stock ValidMessage(text[], maxcount)
{
static len, i, count;
len = strlen(text);
count = 0;
if (!len) return false;
for (i = 0; i < len; i++)
{
if (text[i] != ' ')
{
count++
if (count >= maxcount)
return true;
}
}
return false;
}
stock tutorMake(id,TutorColor:Colorz,Float:fTime = 0.0,const szText[],any:...){
new szMessage[512];
vformat(szMessage, charsmax(szMessage), szText, 5);
if(!id){
message_begin(MSG_ALL,g_isMsgTutor);
write_string(szMessage);
write_byte(0);
write_short(0);
write_short(0);
write_short(1<<_:Colorz);
message_end();
}
else if(is_user_connected(id))
{
message_begin(MSG_ONE_UNRELIABLE,g_isMsgTutor,_,id);
write_string(szMessage);
write_byte(0);
write_short(0);
write_short(0);
write_short(1<<_:Colorz);
message_end();
}
if(fTime != 0.0){
if(!id){
for(new i = 1; i <= g_isMaxPlayers; ++i)
remove_task(i+TASK_TUTOR);
set_task(fTime,"tutorClose",TASK_TUTOR);
}
else
{
remove_task(id+TASK_TUTOR);
set_task(fTime,"tutorClose",id+TASK_TUTOR);
}
}
}
public tutorClose(iTask){
new id = iTask - TASK_TUTOR;
if(!id){
message_begin(MSG_ALL,g_isMsgTutClose);
message_end();
}
else if(is_user_connected(id))
{
message_begin(MSG_ONE_UNRELIABLE,g_isMsgTutClose,_,id);
message_end();
}
}
Type(id, iTipo){
if(!is_user_connected(id))
return;
if(iTipo == Cargar){
if(!adv_vault_get_prepare(iVault, _, g_isName[id]))
return;
g_isPoint[id] = adv_vault_get_field(iVault, iCampos[PTS]);
}
if(iTipo == Guardar){
adv_vault_set_start(iVault);
adv_vault_set_field(iVault, iCampos[PTS], g_isPoint[id]);
adv_vault_set_end(iVault, 0, g_isName[id]);
}
}
stock fm_cs_get_weapon_ent_owner(ent)
{
if (pev_valid(ent) != 2)
return -1;
return get_pdata_cbase(ent, 41, 4);
}
stock precache_player_model(const modelname[])
{
static longname[128];
formatex(longname, charsmax(longname), "models/player/%s/%s.mdl", modelname, modelname);
precache_model(longname);
copy(longname[strlen(longname)-4], charsmax(longname) - (strlen(longname)-4), "T.mdl");
if (file_exists(longname)) precache_model(longname);
}