Código:
/* ///////////////////////////||\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|| ||
|| Guia de : Modo L4D Mejorado ||
|| Autor : BlackFur ||
|| Plugin Necesitado : ZP 4.3 ||
|| ||
\\\\\\\\\\\\\\\\\\\\\\\\\\\||//////////////////////////////////////
*/
"Por Razones de tiempo no le pude agregar Cvars
"Para hacer este L4D se necesita tener el L4D basico
"Se recomienda leer no hacer copy y paste , si se me
"Fue algo me dicen y lo agrego/* Se va a [Global Variables] y registran 4 variables ( 1 para cada personaje),
en este caso las use con el respectivo nombre de cada uno de los L4D */
new g_bill[33] , g_zoey[33] , g_francis[33] , g_luis[33]/* Ahora las setearemos en falso para eliminar algun posible bug*/
/* Ahora abajo de g_survivor[id] = false , ponemos lo siguiente*/
g_luis[id] = false
g_zoey[id] = false
g_francis[id] = false
g_bill[id] = false/*En total hay 3
Para hacer lo siguiente primero busquen todos los humanme y le agregan 4 numeros 0 ejemplo
humanme(id , 1 , 0) y lo cambian por humanme( id , 1 , 0 , 0 , 0 , 0 , 0)/* Ahora se van a */
humanme(id, survivor, silentmode)/*y lo remplazan por */
humanme(id, survivor, silentmode , bill , francis , zoey , luis)/* Luego adentro de humanme ponemos lo siguiente */
if (bill)
{
g_bill[id] = true // Le seteamos la variable en true para usar luego
g_weapon[id] = 0
zp_colored_print(id , "^x04[ZP]^x01 Has Sido Escojido Como^x04 Bill^x01 , Refugiate Con Tus Companeros") // Le mandamos un mensaje diciendelo que sobreviviente es
zp_colored_print(id , "^x04[ZP]^x01 Has Sido Escojido Como^x04 Bill^x01 , Refugiate Con Tus Companeros") // Le mandamos un mensaje diciendelo que sobreviviente es
zp_colored_print(id , "^x04[ZP]^x01 Has Sido Escojido Como^x04 Bill^x01 , Refugiate Con Tus Companeros") // Le mandamos un mensaje diciendelo que sobreviviente es
fm_set_user_health(id , 200 * fnGetAlive())
g_canbuy[id] = false // Para que no pueda comprar armas
fm_strip_user_weapons(id) // Le removemos todas las armas y les damos las de abajo
fm_give_item(id, "weapon_knife")
fm_give_item(id, "weapon_m3")
fm_give_item(id, "weapon_mp5navy")
fm_give_item(id, "weapon_m4a1")
fm_give_item(id, "weapon_usp")
fm_give_item(id, "weapon_g3sg1")
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_flashbang")
cs_set_user_bpammo(id, CSW_HEGRENADE, 3)
cs_set_user_bpammo(id, CSW_FLASHBANG, 3)
turn_off_flashlight(id) // Esto es para la linterna en realidad no se muy bien para que sirve
}
if (francis)
{
g_francis[id] = true
zp_colored_print(id , "^x04[ZP]^x01 Has Sido Escojido Como^x04 Francis^x01 , Refugiate Con Tus Companeros")
zp_colored_print(id , "^x04[ZP]^x01 Has Sido Escojido Como^x04 Francis^x01 , Refugiate Con Tus Companeros")
zp_colored_print(id , "^x04[ZP]^x01 Has Sido Escojido Como^x04 Francis^x01 , Refugiate Con Tus Companeros")
g_weapon[id] = 0
fm_set_user_health(id , 200 * fnGetAlive())
g_canbuy[id] = false
fm_give_item(id, "weapon_knife")
fm_give_item(id, "weapon_m3")
fm_give_item(id, "weapon_mp5navy")
fm_give_item(id, "weapon_m4a1")
fm_give_item(id, "weapon_usp")
fm_give_item(id, "weapon_g3sg1")
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_flashbang")
cs_set_user_bpammo(id, CSW_HEGRENADE, 3)
cs_set_user_bpammo(id, CSW_FLASHBANG, 3)
turn_off_flashlight(id)
if (g_isbot[id]) fm_set_bot_nvg(id, 1);
}
if (zoey)
{
g_zoey[id] = true
g_weapon[id] = 0
zp_colored_print(id , "^x04[ZP]^x01 Has Sido Escojido Como^x04 Zoey^x01 , Refugiate Con Tus Companeros")
zp_colored_print(id , "^x04[ZP]^x01 Has Sido Escojido Como^x04 Zoey^x01 , Refugiate Con Tus Companeros")
zp_colored_print(id , "^x04[ZP]^x01 Has Sido Escojido Como^x04 Zoey^x01 , Refugiate Con Tus Companeros")
fm_set_user_health(id , 200 * fnGetAlive())
g_canbuy[id] = false
fm_strip_user_weapons(id)
fm_give_item(id, "weapon_knife")
fm_give_item(id, "weapon_m3")
fm_give_item(id, "weapon_mp5navy")
fm_give_item(id, "weapon_m4a1")
fm_give_item(id, "weapon_usp")
fm_give_item(id, "weapon_g3sg1")
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_flashbang")
cs_set_user_bpammo(id, CSW_HEGRENADE, 3)
cs_set_user_bpammo(id, CSW_FLASHBANG, 3)
turn_off_flashlight(id)
if (g_isbot[id]) fm_set_bot_nvg(id, 1);
}
if (luis)
{
g_luis[id] = true
zp_colored_print(id , "^x04[ZP]^x01 Has Sido Escojido Como^x04 Luis^x01 , Refugiate Con Tus Companeros")
zp_colored_print(id , "^x04[ZP]^x01 Has Sido Escojido Como^x04 Luis^x01 , Refugiate Con Tus Companeros")
zp_colored_print(id , "^x04[ZP]^x01 Has Sido Escojido Como^x04 Luis^x01 , Refugiate Con Tus Companeros")
fm_set_user_health(id , 200 * fnGetAlive())
g_canbuy[id] = false
fm_set_user_health( id , 300 * fnGetAlive())
fm_strip_user_weapons(id)
fm_give_item(id, "weapon_knife")
fm_give_item(id, "weapon_m3")
fm_give_item(id, "weapon_mp5navy")
fm_give_item(id, "weapon_m4a1")
fm_give_item(id, "weapon_usp")
fm_give_item(id, "weapon_g3sg1")
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_flashbang")
cs_set_user_bpammo(id, CSW_HEGRENADE, 3)
cs_set_user_bpammo(id, CSW_FLASHBANG, 3)
set_task(0.1, "l4d_aura", id)
turn_off_flashlight(id)
if (g_isbot[id]) fm_set_bot_nvg(id, 1);
}/* Ahora nos vamos a [Menu Handlers] y en menu_game cambiamos*/
case 1:
{
if (get_pcvar_num(cvar_extraitems))
{
// Check whether the player is able to buy anything
if (is_user_alive(id))
show_menu_extras(id)
else
zp_colored_print(id, "^x04[ZP]^x01 %L", id ,"CMD_NOT")
}
else
zp_colored_print(id, "^x04[ZP]^x01 %L", id ,"CMD_NOT_EXTRAS")
}/* Por Esto Basicamente si eres uno de los l4d no podras comprar item */
case 1: // Extra Items
{
// Extra items enabled?
if(!g_l4dround) // Variable sacada del MODO L4D BASICO por eso lo pedi
{
if (get_pcvar_num(cvar_extraitems))
{
// Check whether the player is able to buy anything
if (is_user_alive(id))
show_menu_extras(id)
else
zp_colored_print(id, "^x04[ZP]^x01 %L", id ,"CMD_NOT")
}
else
zp_colored_print(id, "^x04[ZP]^x01 %L", id ,"CMD_NOT_EXTRAS")
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////* Ahora Remplazan */
else if ((mode == MODE_NONE && (!preventconsecutive || g_lastmode != MODE_L4D) && random_num(1, get_pcvar_num(cvar_l4dchance)) == get_pcvar_num(cvar_l4d) && floatround((iPlayersnum-2)*get_pcvar_float(cvar_l4dratio), floatround_ceil) >= 1 && iPlayersnum >= get_pcvar_num(cvar_l4dminplayers)) || mode == MODE_L4D)//[registramos si no es alguno de los otros modos realiza una pregunta si es compatible con todas las cvars creadas por nosotros (pd. pcvar_float es una cvar permanente, pcvar_num es una cvar numerica)]
{
g_l4dround = true
g_swarmround = true
for (id = 1; id <= g_maxplayers; id++)
{
if (!is_user_alive(id))
continue;
if (g_zombie[id])
continue;
zombieme(id, 0, 0, 1)
}for ( new i = 0; i < 4; i++ )
{
id = fnGetRandomAlive( random_num( 1, iPlayersnum ) )
if ( g_zombie[id] )
humanme( id, 0 )
else
i--
}
PlaySound(sound_plague[random_num(0, sizeof sound_plague -1)]);
set_hudmessage(0, 50, 200, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1)
ShowSyncHudMsg(0, g_MsgSync, "%L", LANG_PLAYER, "NOTICE_L4D")
ExecuteForward(g_fwRoundStart, g_fwDummyResult, MODE_L4D, 0);
}
/* por */
else if ((mode == MODE_NONE && (!get_pcvar_num(cvar_preventconsecutive) || g_lastmode != MODE_L4D) && random_num(1, get_pcvar_num(cvar_l4dchance)) == get_pcvar_num(cvar_l4d) && floatround((iPlayersnum-2)*get_pcvar_float(cvar_l4dratio), floatround_ceil) >= 1 && iPlayersnum >= get_pcvar_num(cvar_l4dminplayers)) || mode == MODE_L4D)
{
g_swarmround = true
g_l4dround = true
for (id = 1; id <= g_maxplayers; id++)
{
if (!is_user_alive(id))
continue;
if (g_zombie[id])
continue;
zombieme(id, 0, 0, 1, 0)
}
for ( new i = 0; i < 1; i++ )
{
id = fnGetRandomAlive( random_num( 1, iPlayersnum ) )
if (g_zombie[id])
{
humanme(id, 0, 0 , 1 , 0 , 0 , 0) // Convertimo a un zombie en un l4d
}
else i--
}
for ( new i = 0; i < 1; i++ )
{
id = fnGetRandomAlive( random_num( 1, iPlayersnum ) )
if (g_zombie[id])
{
humanme(id, 0, 0 , 0 , 1 , 0 , 0) // Convertimo a un zombie en un l4d
}
else i--
}
for ( new i = 0; i < 1; i++ )
{
id = fnGetRandomAlive( random_num( 1, iPlayersnum ) )
if (g_zombie[id])
{
humanme(id, 0, 0 , 0 , 0 , 1 , 0) // Convertimo a un zombie en un l4d
}
else i--
}
for ( new i = 0; i < 1; i++ )
{
id = fnGetRandomAlive( random_num( 1, iPlayersnum ) )
if (g_zombie[id])
{
humanme(id, 0, 0 , 0 , 0 , 0 , 1) // Convertimo a un zombie en un l4d
}
else i--
}
set_hudmessage(0, 50, 200, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1)
ShowSyncHudMsg(0, g_MsgSync, "%L", LANG_PLAYER, "NOTICE_L4D")
PlaySound(sound_plague[random_num(0, sizeof sound_plague -1)]);
ExecuteForward(g_fwRoundStart, g_fwDummyResult, MODE_L4D, 0); // Ejecutamos el Modo L4D
}
/* Referente a lo Anterior */humanme(id , 0 , 0 , 1 , 0 , 0 , 0) // Bill
humanme(id , 0 , 0 , 0 , 1 , 0 , 0) // Francis
humanme(id , 0 , 0 , 0 , 0 , 1 , 0) // Zoey
humanme(id , 0 , 0 , 0 , 0 , 0 , 1) // Luis
/*
/////////////////////////////////////||\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
||Lo que viene abajo no lo podre explicar ya que no se como funcionada cada cosa solo me ||
||guie por lo del survivor. ||
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\||////////////////////////////////////////////////////
*//* Primero que todo en zombieplague.ini agregan lo siguiente
LUIS = [Nombre del Modelo]
ZOEY = [Nombre del Modelo]
FRANCIS = [Nombre del Modelo]
BILL = [Nombre del Modelo]Ahora en Customization vars agregan lo siguiente*/
new Array:model_bill , Array:model_luis , Array:model_francis , Array:model_zoey
new Array:g_modelindex_bill , Array:g_modelindex_luis , Array:g_modelindex_francis , Array:g_modelindex_zoey/* en plugin_precache() agregan lo siguiente */
model_bill = ArrayCreate(32, 1)
model_zoey = ArrayCreate(32, 1)
model_francis = ArrayCreate(32, 1)
model_luis = ArrayCreate(32, 1)
g_modelindex_bill = ArrayCreate(1, 1)
g_modelindex_francis = ArrayCreate(1, 1)
g_modelindex_zoey = ArrayCreate(1, 1)
g_modelindex_luis = ArrayCreate(1, 1)
for (i = 0; i < ArraySize(model_bill); i++)
{
ArrayGetString(model_bill, i, buffer, sizeof buffer - 1)
format(buffer, sizeof buffer - 1, "models/player/%s/%s.mdl", buffer, buffer)
ArrayPushCell(g_modelindex_bill, engfunc(EngFunc_PrecacheModel, buffer))
}
for (i = 0; i < ArraySize(model_francis); i++)
{
ArrayGetString(model_francis, i, buffer, sizeof buffer - 1)
format(buffer, sizeof buffer - 1, "models/player/%s/%s.mdl", buffer, buffer)
ArrayPushCell(g_modelindex_francis, engfunc(EngFunc_PrecacheModel, buffer))
}
for (i = 0; i < ArraySize(model_zoey); i++)
{
ArrayGetString(model_zoey, i, buffer, sizeof buffer - 1)
format(buffer, sizeof buffer - 1, "models/player/%s/%s.mdl", buffer, buffer)
ArrayPushCell(g_modelindex_zoey, engfunc(EngFunc_PrecacheModel, buffer))
}
for (i = 0; i < ArraySize(model_luis); i++)
{
ArrayGetString(model_luis, i, buffer, sizeof buffer - 1)
format(buffer, sizeof buffer - 1, "models/player/%s/%s.mdl", buffer, buffer)
ArrayPushCell(g_modelindex_luis, engfunc(EngFunc_PrecacheModel, buffer))
}/* abajo de else if (equal(key, "SURVIVOR")) agregan lo siguiente */
else if (equal(key, "BILL"))
{
// Parse models
while (value[0] != 0 && strtok(value, key, sizeof key - 1, value, sizeof value - 1, ','))
{
// Trim spaces
trim(key)
trim(value)
// Add to models array
ArrayPushString(model_bill , key)
}
}
else if (equal(key, "ZOEY"))
{
// Parse models
while (value[0] != 0 && strtok(value, key, sizeof key - 1, value, sizeof value - 1, ','))
{
// Trim spaces
trim(key)
trim(value)
// Add to models array
ArrayPushString(model_zoey , key)
}
}
else if (equal(key, "FRANCIS"))
{
// Parse models
while (value[0] != 0 && strtok(value, key, sizeof key - 1, value, sizeof value - 1, ','))
{
// Trim spaces
trim(key)
trim(value)
// Add to models array
ArrayPushString(model_francis , key)
}
}
else if (equal(key, "LUIS"))
{
// Parse models
while (value[0] != 0 && strtok(value, key, sizeof key - 1, value, sizeof value - 1, ','))
{
// Trim spaces
trim(key)
trim(value)
// Add to models array
ArrayPushString(model_luis, key)
}
}/* No quedaria asi */
case SECTION_PLAYER_MODELS:
{
if (equal(key, "HUMAN"))
{
// Parse models
while (value[0] != 0 && strtok(value, key, sizeof key - 1, value, sizeof value - 1, ','))
{
// Trim spaces
trim(key)
trim(value)
// Add to models array
ArrayPushString(model_human, key)
}
}
else if (equal(key, "NEMESIS"))
{
// Parse models
while (value[0] != 0 && strtok(value, key, sizeof key - 1, value, sizeof value - 1, ','))
{
// Trim spaces
trim(key)
trim(value)
// Add to models array
ArrayPushString(model_nemesis, key)
}
}
else if (equal(key, "SURVIVOR"))
{
// Parse models
while (value[0] != 0 && strtok(value, key, sizeof key - 1, value, sizeof value - 1, ','))
{
// Trim spaces
trim(key)
trim(value)
// Add to models array
ArrayPushString(model_survivor, key)
}
}
else if (equal(key, "BILL"))
{
// Parse models
while (value[0] != 0 && strtok(value, key, sizeof key - 1, value, sizeof value - 1, ','))
{
// Trim spaces
trim(key)
trim(value)
// Add to models array
ArrayPushString(model_bill , key)
}
}
else if (equal(key, "ZOEY"))
{
// Parse models
while (value[0] != 0 && strtok(value, key, sizeof key - 1, value, sizeof value - 1, ','))
{
// Trim spaces
trim(key)
trim(value)
// Add to models array
ArrayPushString(model_zoey , key)
}
}
else if (equal(key, "FRANCIS"))
{
// Parse models
while (value[0] != 0 && strtok(value, key, sizeof key - 1, value, sizeof value - 1, ','))
{
// Trim spaces
trim(key)
trim(value)
// Add to models array
ArrayPushString(model_francis , key)
}
}
else if (equal(key, "LUIS"))
{
// Parse models
while (value[0] != 0 && strtok(value, key, sizeof key - 1, value, sizeof value - 1, ','))
{
// Trim spaces
trim(key)
trim(value)
// Add to models array
ArrayPushString(model_luis, key)
}
}
else if (equal(key, "ADMIN ZOMBIE"))
{
// Parse models
while (value[0] != 0 && strtok(value, key, sizeof key - 1, value, sizeof value - 1, ','))
{
// Trim spaces
trim(key)
trim(value)
// Add to models array
ArrayPushString(model_admin_zombie, key)
}
}
else if (equal(key, "ADMIN HUMAN"))
{
// Parse models
while (value[0] != 0 && strtok(value, key, sizeof key - 1, value, sizeof value - 1, ','))
{
// Trim spaces
trim(key)
trim(value)
// Add to models array
ArrayPushString(model_admin_human, key)
}
}
else if (equal(key, "SAME MODELS FOR ALL"))
g_same_models_for_all = str_to_num(value)
else if (g_same_models_for_all && equal(key, "ZOMBIE"))
{
// Parse models
while (value[0] != 0 && strtok(value, key, sizeof key - 1, value, sizeof value - 1, ','))
{
// Trim spaces
trim(key)
trim(value)
// Add to models array
ArrayPushString(g_zclass_playermodel, key)
// Precache model and retrieve its modelindex
formatex(linedata, sizeof linedata - 1, "models/player/%s/%s.mdl", key, key)
ArrayPushCell(g_zclass_modelindex, engfunc(EngFunc_PrecacheModel, linedata))
}
}
}/* Ahora en humanme borran todo lo siguiente */
if (g_handle_models_on_separate_ent)
{
// Set the right model
if (g_survivor[id])
{
iRand = random_num(0, ArraySize(model_survivor) - 1)
ArrayGetString(model_survivor, iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_survivor, iRand))
}
else
{
if (get_pcvar_num(cvar_adminmodelshuman) && (get_user_flags(id) & g_access_flag[12]))
{
iRand = random_num(0, ArraySize(model_admin_human) - 1)
ArrayGetString(model_admin_human, iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_admin_human, iRand))
}
else
{
iRand = random_num(0, ArraySize(model_human) - 1)
ArrayGetString(model_human, iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_human, iRand))
}
}
// Set model on player model entity
fm_set_playermodel_ent(id)
// Set survivor glow / remove glow on player model entity, unless frozen
if (!g_frozen[id])
{
if (g_survivor[id] && get_pcvar_num(cvar_survglow))
fm_set_rendering(g_ent_playermodel[id], kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 25)
else
fm_set_rendering(g_ent_playermodel[id])
}
}
else
{
// Get current model for comparing it with the current one
fm_get_user_model(id, currentmodel, sizeof currentmodel - 1)
// Set the right model, after checking that we don't already have it
if (g_survivor[id])
{
for (i = 0; i < ArraySize(model_survivor); i++)
{
ArrayGetString(model_survivor, i, tempmodel, sizeof tempmodel - 1)
if (equal(currentmodel, tempmodel)) already_has_model = true
}
if (!already_has_model)
{
iRand = random_num(0, ArraySize(model_survivor) - 1)
ArrayGetString(model_survivor, iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_survivor, iRand))
}
}
else
{
if (get_pcvar_num(cvar_adminmodelshuman) && (get_user_flags(id) & g_access_flag[12]))
{
for (i = 0; i < ArraySize(model_admin_human); i++)
{
ArrayGetString(model_admin_human, i, tempmodel, sizeof tempmodel - 1)
if (equal(currentmodel, tempmodel)) already_has_model = true
}
if (!already_has_model)
{
iRand = random_num(0, ArraySize(model_admin_human) - 1)
ArrayGetString(model_admin_human, iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_admin_human, iRand))
}
}
else
{
for (i = 0; i < ArraySize(model_human); i++)
{
ArrayGetString(model_human, i, tempmodel, sizeof tempmodel - 1)
if (equal(currentmodel, tempmodel)) already_has_model = true
}
if (!already_has_model)
{
iRand = random_num(0, ArraySize(model_human) - 1)
ArrayGetString(model_human, iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_human, iRand))
}
}
}
/* y pegan esto */if(!g_l4dround)
{
if (g_handle_models_on_separate_ent)
{
// Set the right model
if (g_survivor[id])
{
iRand = random_num(0, ArraySize(model_survivor) - 1)
ArrayGetString(model_survivor, iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_survivor, iRand))
}
else
{
if (get_pcvar_num(cvar_adminmodelshuman) && (get_user_flags(id) & g_access_flag[12]))
{
iRand = random_num(0, ArraySize(model_admin_human) - 1)
ArrayGetString(model_admin_human, iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_admin_human, iRand))
}
else
{
iRand = random_num(0, ArraySize(model_human) - 1)
ArrayGetString(model_human, iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_human, iRand))
}
}
// Set model on player model entity
fm_set_playermodel_ent(id)
// Set survivor glow / remove glow on player model entity, unless frozen
if (!g_frozen[id])
{
if (g_survivor[id] && get_pcvar_num(cvar_survglow))
fm_set_rendering(g_ent_playermodel[id], kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 25)
else
fm_set_rendering(g_ent_playermodel[id])
}
}
else
{
// Get current model for comparing it with the current one
fm_get_user_model(id, currentmodel, sizeof currentmodel - 1)
// Set the right model, after checking that we don't already have it
if (g_survivor[id])
{
for (i = 0; i < ArraySize(model_survivor); i++)
{
ArrayGetString(model_survivor, i, tempmodel, sizeof tempmodel - 1)
if (equal(currentmodel, tempmodel)) already_has_model = true
}
if (!already_has_model)
{
iRand = random_num(0, ArraySize(model_survivor) - 1)
ArrayGetString(model_survivor, iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_survivor, iRand))
}
}
else
{
if (get_pcvar_num(cvar_adminmodelshuman) && (get_user_flags(id) & g_access_flag[12]))
{
for (i = 0; i < ArraySize(model_admin_human); i++)
{
ArrayGetString(model_admin_human, i, tempmodel, sizeof tempmodel - 1)
if (equal(currentmodel, tempmodel)) already_has_model = true
}
if (!already_has_model)
{
iRand = random_num(0, ArraySize(model_admin_human) - 1)
ArrayGetString(model_admin_human, iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_admin_human, iRand))
}
}
else
{
for (i = 0; i < ArraySize(model_human); i++)
{
ArrayGetString(model_human, i, tempmodel, sizeof tempmodel - 1)
if (equal(currentmodel, tempmodel)) already_has_model = true
}
if (!already_has_model)
{
iRand = random_num(0, ArraySize(model_human) - 1)
ArrayGetString(model_human, iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_human, iRand))
}
}
}
// Need to change the model?
if (!already_has_model)
{
// An additional delay is offset at round start
// since SVC_BAD is more likely to be triggered there
if (g_newround)
set_task(5.0 * g_modelchange_delay, "fm_user_model_update", id+TASK_MODEL)
else
fm_user_model_update(id+TASK_MODEL)
}
// Set survivor glow / remove glow, unless frozen
if (!g_frozen[id])
{
if (g_survivor[id] && get_pcvar_num(cvar_survglow))
fm_set_rendering(id, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 25)
else
fm_set_rendering(id)
}
}
}
else
{
if (g_handle_models_on_separate_ent)
{
if (g_bill[id] && !g_zombie[id])
{
iRand = random_num(0, ArraySize(model_bill) - 1)
ArrayGetString(model_bill , iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_bill, iRand))
}
if (g_zoey[id] && !g_zombie[id])
{
iRand = random_num(0, ArraySize(model_zoey) - 1)
ArrayGetString(model_zoey , iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_zoey , iRand))
}
if (g_francis[id] && !g_zombie[id])
{
iRand = random_num(0, ArraySize(model_francis) - 1)
ArrayGetString(model_francis, iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_francis , iRand))
}
if (g_luis[id] && !g_zombie[id] )
{
iRand = random_num(0, ArraySize(model_luis) - 1)
ArrayGetString(model_luis , iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_luis, iRand))
}
if (!g_zombie[id] && !g_zoey[id] && !g_bill[id] && !g_francis[id] && !g_luis[id])
{
for (i = 0; i < ArraySize(model_human); i++)
{
ArrayGetString(model_human, i, tempmodel, sizeof tempmodel - 1)
if (equal(currentmodel, tempmodel)) already_has_model = true
}
if (!already_has_model)
{
iRand = random_num(0, ArraySize(model_human) - 1)
ArrayGetString(model_human, iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_human, iRand))
}
}
}
else
{
if (g_bill[id])
{
for (i = 0; i < ArraySize(model_bill); i++)
{
ArrayGetString(model_bill , i, tempmodel, sizeof tempmodel - 1)
if (equal(currentmodel, tempmodel)) already_has_model = true
}
if (!already_has_model)
{
iRand = random_num(0, ArraySize(model_bill) - 1)
ArrayGetString(model_bill, iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_bill , iRand))
}
}
if (g_luis[id])
{
for (i = 0; i < ArraySize(model_luis); i++)
{
ArrayGetString(model_luis, i, tempmodel, sizeof tempmodel - 1)
if (equal(currentmodel, tempmodel)) already_has_model = true
}
if (!already_has_model)
{
iRand = random_num(0, ArraySize(model_luis) - 1)
ArrayGetString(model_luis , iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_luis, iRand))
}
}
if (g_francis[id])
{
for (i = 0; i < ArraySize(model_francis); i++)
{
ArrayGetString(model_francis, i, tempmodel, sizeof tempmodel - 1)
if (equal(currentmodel, tempmodel)) already_has_model = true
}
if (!already_has_model)
{
iRand = random_num(0, ArraySize(model_francis) - 1)
ArrayGetString(model_francis, iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_francis, iRand))
}
}
if (g_zoey[id])
{
for (i = 0; i < ArraySize(model_zoey); i++)
{
ArrayGetString(model_zoey, i, tempmodel, sizeof tempmodel - 1)
if (equal(currentmodel, tempmodel)) already_has_model = true
}
if (!already_has_model)
{
iRand = random_num(0, ArraySize(model_zoey) - 1)
ArrayGetString(model_zoey, iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_zoey, iRand))
}
}
if (!g_zombie[id] && !g_zoey[id] && !g_bill[id] && !g_francis[id] && !g_luis[id])
{
for (i = 0; i < ArraySize(model_human); i++)
{
ArrayGetString(model_human, i, tempmodel, sizeof tempmodel - 1)
if (equal(currentmodel, tempmodel)) already_has_model = true
}
if (!already_has_model)
{
iRand = random_num(0, ArraySize(model_human) - 1)
ArrayGetString(model_human, iRand, g_playermodel[id], sizeof g_playermodel[] - 1)
if (g_set_modelindex_offset) fm_set_user_model_index(id, ArrayGetCell(g_modelindex_human, iRand))
}
}
if (!already_has_model)
{
if (g_newround)
set_task(5.0 * g_modelchange_delay, "fm_user_model_update", id+TASK_MODEL)
else
fm_user_model_update(id+TASK_MODEL)
}
if (!g_frozen[id])
{
if (g_survivor[id] && get_pcvar_num(cvar_survglow))
fm_set_rendering(id, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 25)
else
fm_set_rendering(id)
}
}
}
/* Ahora en check_round(leaving_player) y abajo de */
if(g_survivor[leaving_player])
humanme(id, 1 , 0 , 0 , 0 , 0 , 0)
/* Ponen lo siguiente */
if(g_bill[leaving_player])
humanme(id, 0, 0 , 1 , 0 , 0 , 0)
if(g_zoey[leaving_player])
humanme(id, 0, 0 , 0 , 0 , 1 , 0)
if(g_francis[leaving_player])
humanme(id, 0, 0 , 0 , 1 , 0 , 0)
if(g_luis[leaving_player])
humanme(id, 0, 0 , 0 , 0 , 0 , 1)
/* Si quieren que tenga balas infinitas se van a */ç
public event_ammo_x(id)/* y donde dice */
if (g_survivor[id] ? get_pcvar_num(cvar_survinfammo) : get_pcvar_num(cvar_infammo))
{
if (amount < MAXBPAMMO[weapon])
{
set_msg_block(g_msgAmmoPickup, BLOCK_ONCE)
ExecuteHamB(Ham_GiveAmmo, id, MAXBPAMMO[weapon], AMMOTYPE[weapon], MAXBPAMMO[weapon])
}
}
}if (g_survivor[id] ? get_pcvar_num(cvar_survinfammo) : get_pcvar_num(cvar_infammo) || g_l4dround)
{
if (amount < MAXBPAMMO[weapon])
{
set_msg_block(g_msgAmmoPickup, BLOCK_ONCE)
ExecuteHamB(Ham_GiveAmmo, id, MAXBPAMMO[weapon], AMMOTYPE[weapon], MAXBPAMMO[weapon])
}
}
}
/* lo remplazan por /*
/* Aqui basicamente si se retira algunos de los l4d y es el ultimo se escoje uno al azar para remplazarlo
por el mismo personaje */
/*
Bueno esta seria mi guia como mejorar tu modo l4d
Personalmente yo soy muy desordenado asi que si hay alguien
Que pueda ordernas mi post se lo agradeceria mucho
La parte de los modelos no la pude explicar muy bien ya que
Solo me guie por lo del survivor ( estuve como 2 horas) y sin
Guias previamente leidaspara mas informacion :
el_caritax@hotmail.com
o en Facebook :
Angel Jesus Araya Carcamo