Jump to content

[#1] [ZP] Creare clase zombii [AMXX] [TUT]


LondoN eXtream

Recommended Posts

Prima data, vom avea nevoie de 2 librarii. Vom trece in codul nostru:

 

#include < fakemeta >
#include < zombieplague >

 

Acum vom face calitatile/defectele Clasei

 

new const zclass_name[] = "My #1 zClass" // Numele Clasei
new const zclass_info[] = "HP+ Speed -" //Calitatile & Defectele
new const zclass_model[] = "zclass_test" // Modelul : models/players/zclass_test/zclass_test.mdl
new const zclass_clawmodel[] = "v_knife_zclass.mdl" // Cum vor arata ghiarele
const zclass_healt = 8000 // Viata default setata.
const zclass_speed = 150 // Viteza default
const Float:zclass_gravity = 1.0 // Gravitatea
const Float:zclass_knockback = 1.0 // Knockback

 

Acum facem o variablia care ne va ajuta sa inregistram clasa.

 

 

new g_zclassid1

 

Acum o intregistram in public plugin_precache()

 

g_zclassid1 = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback) 

 

Acum un mic bonus pentru cei ce va vor folosi clasa (nu este obligatorie de trecut in cod)

 

public zp_user_infected_post(id, infector)
{
// Check if the infected player is using our custom zombie class
if (zp_get_user_zombie_class(id) == g_zclassid1)
{
client_print(id, print_chat, "[ZP] You're using a custom zombie class! Enjoy 100 extra HP!")
set_pev(id, pev_health, float(pev(id, pev_health)) + 100.0)
}
}
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...