Existing user? Sign in
Sign up
Games
Servers
Useful
User
Pass
2FA
Human skins
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Fixed issues
Author
Message
919
extreme18910
[Mentally Stable]
Status: Offline
(since 29-03-2014 10:21)
Joined: 22 May 2013
Posts: 42
,
Topics: 25
Location:
Romania
Reputation:
37.5
Votes
: 2
Posted: 29-03-2014, 11:54:35
| Translate post to:
... (
Click for more languages
)
Cum pot shimba skin-urile la human in functie de lvl daca folosesc Zombie Plague 4.3 ?
Stiu ca am nevoie de un plugin care face sa imi apara fiecare clasa in humanclasses.ini exact ca la zombieclasses.ini.
Ma poate ajuta cineva ?
0
0
Back to top
EDUTz
[HardcoreAmxxScripter]
Status: Offline
(since 15-08-2021 16:34)
Joined: 27 Dec 2010
Posts: 4306
,
Topics: 244
Location:
Jud. Miserupia, sat Bagadanc
Reputation:
4085
Votes
: 179
Posted: 30-03-2014, 00:17:46
| Translate post to:
... (
Click for more languages
)
Presupun ca folosesti zombiexp.amxx .. trebuie modificat sa poti intregistra clasele de humani cu zpxp_register_human_classes()
nativul trebuie modificat mai exact sa execute modelele de la fiecare human, exact cum o face si la zombi.
apoi iti trebuie un zombie_plague40.amxx modificat cu suport pentru clase de human.
Exemplu: in zombiexp:
Code:
public zpxp_register_zombie_class(........)
(
....
g_returnclass_id = zp_register_zombie_class(....)
}
iti trebuie si la human asa ceva.
Code:
public native_register_human_class(const name[], const info[], const model[], const weapons[], hp, speed, Float:gravity, level)
{
// Reached human classes limit
if (g_hclass_i >= sizeof g_hclass_name)
return -1;
// Strings passed byref
param_convert(1)
param_convert(2)
param_convert(3)
param_convert(4)
// Add the class
copy(g_hclass_name[g_hclass_i], sizeof g_hclass_name[] - 1, name)
copy(g_hclass_info[g_hclass_i], sizeof g_hclass_info[] - 1, info)
copy(g_hclass_model[g_hclass_i], sizeof g_hclass_model[] - 1, model)
copy(g_hclass_weapons[g_hclass_i], sizeof g_hclass_weapons[] - 1, weapons)
g_hclass_hp[g_hclass_i] = hp
g_hclass_spd[g_hclass_i] = speed
g_hclass_grav[g_hclass_i] = gravity
g_hclass_lvl[g_hclass_i] = level
// For the load_data and save_data
new tSave[40]
formatex(tSave, sizeof tSave - 1, "%s%s", name, info);
replace_all(tSave, sizeof tSave - 1, ";", "")
replace_all(tSave, sizeof tSave - 1, " ", "")
g_hclass_load[g_hclass_i] = tSave;
new g_returnclass_id;
g_returnclass_id = zp_register_human_class(g_hclass_name[g_hclass_i], g_hclass_info[g_hclass_i], g_hclass_model[g_hclass_i], g_hclass_weapons[g_hclass_i], g_hclass_hp[g_hclass_i], g_hclass_spd[g_hclass_i], g_hclass_grav[g_hclass_i]);
// Make sure there was no error
if( g_returnclass_id == -1 )
{
server_print("%s %L", textHeader, LANG_PLAYER, "ERR_BADRETURN");
return -1
}
// Increase registered classes counter
g_hclass_i++
// Return id under which we registered the class
return g_hclass_i-1;
}
in zombie_plague40.amxx iti trebuie nativul
zp_register_human_class()
altfel nu iti va merge.
Code:
register_native("zp_register_human_class", "native_register_human_class", 1)
Code:
// Native: zp_register_human_class
public native_register_human_class(const name[], const info[], const model[], const handmodel[], hp, speed, Float:gravity)
{
// ZP disabled
if (!g_pluginenabled)
return -1;
// Arrays not yet initialized
if (!g_arrays_created)
{
log_error(AMX_ERR_NATIVE, "[ZP] Can't register zombie class yet (%s)", name)
return -1;
}
// Strings passed byref
param_convert(1)
param_convert(2)
param_convert(3)
param_convert(4)
if (strlen(name) < 1)
{
log_error(AMX_ERR_NATIVE, "[ZP] Can't register human class with an empty name")
return -1;
}
new index, humanclass_name[32]
for (index = 0; index < g_hclass_i; index++)
{
ArrayGetString(g_hclass_name, index, humanclass_name, charsmax(humanclass_name))
if (equali(name, humanclass_name))
{
log_error(AMX_ERR_NATIVE, "[ZP] Human class already registered (%s)", name)
return -1;
}
}
// Add the class
ArrayPushString(g_hclass_name, name)
ArrayPushString(g_hclass_info, info)
// Using same human models for all classes?
if (g_same_models_for_all)
{
ArrayPushCell(g_hclass_modelsstart, 0)
ArrayPushCell(g_hclass_modelsend, ArraySize(g_hclass_playermodel))
}
else
{
ArrayPushCell(g_hclass_modelsstart, ArraySize(g_hclass_playermodel))
ArrayPushString(g_hclass_playermodel, model)
ArrayPushCell(g_hclass_modelsend, ArraySize(g_hclass_playermodel))
ArrayPushCell(g_hclass_modelindex, -1)
}
ArrayPushString(g_hclass_handmodel, handmodel)
ArrayPushCell(g_hclass_hp, hp)
ArrayPushCell(g_hclass_spd, speed)
ArrayPushCell(g_hclass_grav, gravity)
// Set temporary new class flag
ArrayPushCell(g_hclass_new, 1)
// Override human classes data with our customizations
new i, k, buffer[32], Float:buffer2, nummodels_custom, nummodels_default, prec_mdl[100], size = ArraySize(g_hclass2_realname)
for (i = 0; i < size; i++)
{
ArrayGetString(g_hclass2_realname, i, buffer, charsmax(buffer))
// Check if this is the intended class to override
if (!equal(name, buffer))
continue;
// Remove new class flag
ArraySetCell(g_hclass_new, g_hclass_i, 0)
// Replace caption
ArrayGetString(g_hclass2_name, i, buffer, charsmax(buffer))
ArraySetString(g_hclass_name, g_hclass_i, buffer)
// Replace info
ArrayGetString(g_hclass2_info, i, buffer, charsmax(buffer))
ArraySetString(g_hclass_info, g_hclass_i, buffer)
// Replace models, unless using same models for all classes
if (!g_same_models_for_all)
{
nummodels_custom = ArrayGetCell(g_hclass2_modelsend, i) - ArrayGetCell(g_hclass2_modelsstart, i)
nummodels_default = ArrayGetCell(g_hclass_modelsend, g_hclass_i) - ArrayGetCell(g_hclass_modelsstart, g_hclass_i)
// Replace each player model and model index
for (k = 0; k < min(nummodels_custom, nummodels_default); k++)
{
ArrayGetString(g_hclass2_playermodel, ArrayGetCell(g_hclass2_modelsstart, i) + k, buffer, charsmax(buffer))
ArraySetString(g_hclass_playermodel, ArrayGetCell(g_hclass_modelsstart, g_hclass_i) + k, buffer)
// Precache player model and replace its modelindex with the real one
formatex(prec_mdl, charsmax(prec_mdl), "models/player/%s/%s.mdl", buffer, buffer)
ArraySetCell(g_hclass_modelindex, ArrayGetCell(g_hclass_modelsstart, g_hclass_i) + k, engfunc(EngFunc_PrecacheModel, prec_mdl))
if (g_force_consistency == 1) force_unmodified(force_model_samebounds, {0,0,0}, {0,0,0}, prec_mdl)
if (g_force_consistency == 2) force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, prec_mdl)
// Precache modelT.mdl files too
copy(prec_mdl[strlen(prec_mdl)-4], charsmax(prec_mdl) - (strlen(prec_mdl)-4), "T.mdl")
if (file_exists(prec_mdl)) engfunc(EngFunc_PrecacheModel, prec_mdl)
}
// We have more custom models than what we can accommodate,
// Let's make some space...
if (nummodels_custom > nummodels_default)
{
for (k = nummodels_default; k < nummodels_custom; k++)
{
ArrayGetString(g_hclass2_playermodel, ArrayGetCell(g_hclass2_modelsstart, i) + k, buffer, charsmax(buffer))
ArrayInsertStringAfter(g_hclass_playermodel, ArrayGetCell(g_hclass_modelsstart, g_hclass_i) + k - 1, buffer)
// Precache player model and retrieve its modelindex
formatex(prec_mdl, charsmax(prec_mdl), "models/player/%s/%s.mdl", buffer, buffer)
ArrayInsertCellAfter(g_hclass_modelindex, ArrayGetCell(g_hclass_modelsstart, g_hclass_i) + k - 1, engfunc(EngFunc_PrecacheModel, prec_mdl))
if (g_force_consistency == 1) force_unmodified(force_model_samebounds, {0,0,0}, {0,0,0}, prec_mdl)
if (g_force_consistency == 2) force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, prec_mdl)
// Precache modelT.mdl files too
copy(prec_mdl[strlen(prec_mdl)-4], charsmax(prec_mdl) - (strlen(prec_mdl)-4), "T.mdl")
if (file_exists(prec_mdl)) engfunc(EngFunc_PrecacheModel, prec_mdl)
}
// Fix models end index for this class
ArraySetCell(g_hclass_modelsend, g_hclass_i, ArrayGetCell(g_hclass_modelsend, g_hclass_i) + (nummodels_custom - nummodels_default))
}
/* --- Not needed since classes can't have more than 1 default model for now ---
// We have less custom models than what this class has by default,
// Get rid of those extra entries...
if (nummodels_custom < nummodels_default)
{
for (k = nummodels_custom; k < nummodels_default; k++)
{
ArrayDeleteItem(g_hclass_playermodel, ArrayGetCell(g_hclass_modelsstart, g_hclass_i) + nummodels_custom)
}
// Fix models end index for this class
ArraySetCell(g_hclass_modelsend, g_hclass_i, ArrayGetCell(g_hclass_modelsend, g_hclass_i) - (nummodels_default - nummodels_custom))
}
*/
}
// Replace handmodel
ArrayGetString(g_hclass2_handmodel, i, buffer, charsmax(buffer))
ArraySetString(g_hclass_handmodel, g_hclass_i, buffer)
// Precache handmodel
formatex(prec_mdl, charsmax(prec_mdl), "models/%s", buffer)
engfunc(EngFunc_PrecacheModel, prec_mdl)
// Replace health
buffer[0] = ArrayGetCell(g_hclass2_hp, i)
ArraySetCell(g_hclass_hp, g_hclass_i, buffer[0])
// Replace speed
buffer[0] = ArrayGetCell(g_hclass2_spd, i)
ArraySetCell(g_hclass_spd, g_hclass_i, buffer[0])
// Replace gravity
buffer2 = Float:ArrayGetCell(g_hclass2_grav, i)
ArraySetCell(g_hclass_grav, g_hclass_i, buffer2)
}
// If class was not overriden with customization data
if (ArrayGetCell(g_hclass_new, g_hclass_i))
{
// If not using same models for all classes
if (!g_same_models_for_all)
{
// Precache default class model and replace modelindex with the real one
formatex(prec_mdl, charsmax(prec_mdl), "models/player/%s/%s.mdl", model, model)
ArraySetCell(g_hclass_modelindex, ArrayGetCell(g_hclass_modelsstart, g_hclass_i), engfunc(EngFunc_PrecacheModel, prec_mdl))
if (g_force_consistency == 1) force_unmodified(force_model_samebounds, {0,0,0}, {0,0,0}, prec_mdl)
if (g_force_consistency == 2) force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, prec_mdl)
// Precache modelT.mdl files too
copy(prec_mdl[strlen(prec_mdl)-4], charsmax(prec_mdl) - (strlen(prec_mdl)-4), "T.mdl")
if (file_exists(prec_mdl)) engfunc(EngFunc_PrecacheModel, prec_mdl)
}
// Precache default handmodel
formatex(prec_mdl, charsmax(prec_mdl), "models/%s", handmodel)
engfunc(EngFunc_PrecacheModel, prec_mdl)
}
// Increase registered classes counter
g_hclass_i++
// Return id under which we registered the class
return g_hclass_i-1;
}
cu placere.
Pentru pluginuri complicate le fac cu $$ pe paypal/psc. PM
0
0
Back to top
Topic locked
Topic is closed, you cannot post any messages in it anymore
Locked by
Happy =]]
, 21 April 2014 12:47
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Fixed issues
The time now is 13-02-2025, 03:33:48
Copyright info
Based on phpBB
ro
/
com
B
Login
I forgot my password
World of Warcraft
Login for more...
Download WoW 7.3.5
Misc
eSports
Achievements
Buy reputation with votes
Reputation trades
Forum rules
Ban list
Members list
User guide (FAQ)
World of Warcraft
View details