Raised This Month: $81 Target: $400
 20% 

API Scripting Help [TUT] How to make a Zombie Class


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zombiezzz
Veteran Member
Join Date: Nov 2009
Location: Nov 2009
Old 12-03-2009 , 18:05   [TUT] How to make a Zombie Class
Reply With Quote #1

Im going to show you how to make a simple zombie class! we are goign to make a Zombie Class called "Gravity Zombie" and will have low gravity.

First step, we need to include ZombiePlague
PHP Code:
#include <amxmodx>
#include <zombieplague> 
2 step. is to make the Zombie Attributes
PHP Code:
// Zombie Attributes
new const zclass_name[] = { "Gravity Zombie" // name
new const zclass_info[] = { "Low grav -HP" // description
new const zclass_model[] = { "zombie_Source" // model
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" // claw model
const zclass_health 800 // health
const zclass_speed 200 // speed
const Float:zclass_gravity 0.4 // gravity
const Float:zclass_knockback 0.6 // knockback 
3 step. make a simple "new" code for the next entry.
PHP Code:
// Class IDs
new g_zclassid1 
4. Now register the Zombie Class so we make this.
PHP Code:
// Zombie Classes MUST be registered on plugin_precache
public plugin_precache()
{
 
register_plugin("[ZP] Zombie Class: Gravity Zombie""1.0""Zombiezzz"
 
 
// Register the new class and store ID for reference
 
g_zclassid1 zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback

5. We are almsot done. Now we make a code that makes something happens when the persone chooses the class. We will use a simple Client_print which will show the player w.e u want when he choose the class.
PHP Code:
public zp_user_infected_post idinfector )
{
              if (
zp_get_user_zombie_class(id) == g_zclassid1)
             {
                  
client_print(idprint_chat"[ZP] You Have Choosen Gravity Zombie"
             }

Now put it all together and you should have it like this ^_^
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <zombieplague>
// Zombie Attributes
new const zclass_name[] = { "Gravity Zombie" // name
new const zclass_info[] = { "Low Grav -HP" // description
new const zclass_model[] = { "zombie_source" // model
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" // claw model
const zclass_health 800 // health
const zclass_speed 200 // speed
const Float:zclass_gravity 0.5 // gravity
const Float:zclass_knockback 0.6 // knockback
// Class IDs
new g_zclassid1
// Zombie Classes MUST be registered on plugin_precache
public plugin_precache()
{
 
register_plugin("[ZP] Zombie Class: Gravity Zombie""1.0""Zombiezzz"
 
 
// Register the new class and store ID for reference
 
g_zclassid1 zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback
}
public 
zp_user_infected_post idinfector )
{
              if (
zp_get_user_zombie_class(id) == g_zclassid1)
             {
                  
client_print(idprint_chat"[ZP] You Have Choosen Gravity Zombie"
             }

__________________

Last edited by Zombiezzz; 12-16-2009 at 19:29.
Zombiezzz is offline
Venganza!
BANNED
Join Date: Nov 2009
Location: Valparaiso, Chile.
Old 12-03-2009 , 19:11   Re: [TUT] How to make a Zombie Class
Reply With Quote #2

lol bad internet? 3 thread O.O
Venganza! is offline
Zombiezzz
Veteran Member
Join Date: Nov 2009
Location: Nov 2009
Old 12-03-2009 , 20:09   Re: [TUT] How to make a Zombie Class
Reply With Quote #3

lol ya, my internet frozed up O.o
__________________
Zombiezzz is offline
vaan123
Veteran Member
Join Date: Sep 2009
Location: Kuwait
Old 12-04-2009 , 08:07   Re: [TUT] How to make a Zombie Class
Reply With Quote #4

nice, thanks =)
__________________

vaan123 is offline
Send a message via MSN to vaan123 Send a message via Yahoo to vaan123 Send a message via Skype™ to vaan123
Zombiezzz
Veteran Member
Join Date: Nov 2009
Location: Nov 2009
Old 12-04-2009 , 11:17   Re: [TUT] How to make a Zombie Class
Reply With Quote #5

Quote:
Originally Posted by vaan123 View Post
nice, thanks =)
Im glad you found it helpful
__________________
Zombiezzz is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 12-05-2009 , 23:02   Re: [TUT] How to make a Zombie Class
Reply With Quote #6

Remove fun include. There's no code in the "Gravity Zombie" is used by fun.inc.
Excalibur.007 is offline
AfteR.
Veteran Member
Join Date: Dec 2008
Location: λ
Old 12-05-2009 , 23:10   Re: [TUT] How to make a Zombie Class
Reply With Quote #7

Quote:
Originally Posted by Excalibur.007 View Post
Remove fun include. There's no code in the "Gravity Zombie" is used by fun.inc.
Yeah its not necesary...
AfteR. is offline
Zombiezzz
Veteran Member
Join Date: Nov 2009
Location: Nov 2009
Old 12-05-2009 , 23:55   Re: [TUT] How to make a Zombie Class
Reply With Quote #8

#include <fun> is necesary because it needs to be in there if you want to add items/glow. Like this for example..
PHP Code:
public zp_user_infected_post idinfector )
{
              if (
zp_get_user_zombie_class(id) == g_zclassid1)
             {
                  
client_print(idprint_chat"[ZP] You Have Choosen Gravity Zombie"
    
set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderNormal,300)  
             }

which gives the zombie red glow ^_^
__________________
Zombiezzz is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 12-06-2009 , 01:42   Re: [TUT] How to make a Zombie Class
Reply With Quote #9

I mean if they are just adding zombies like classic zombie. You should remove the <fun> as those ppl starting to learn scripting will know what function will need what includes.
Excalibur.007 is offline
Zombiezzz
Veteran Member
Join Date: Nov 2009
Location: Nov 2009
Old 12-06-2009 , 17:36   Re: [TUT] How to make a Zombie Class
Reply With Quote #10

well okay! good point i'll remove it. i jsut want everyone to know if they want to add glow/items, they need fun

By the way, if anyone has a request for me to make a zombie class, tell me becuase im out of ideas >.> i only came up with Infecter Zombie.
__________________
Zombiezzz is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode