AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Zombie class name (https://forums.alliedmods.net/showthread.php?t=126763)

Oneshox 05-13-2010 09:31

Zombie class name
 
hey,
someone can tell me how i can get zombie class name
example:
You are now using %d class

but in sub plugin

abdul-rehman 05-13-2010 10:05

Re: Zombie class name
 
Not possible bcoz the native has not been biuld..
You can get the id of the class if you want..[ Id is basically a number]

For eg:
The id of a classic zombie is 0
The id of a raptor zombie is 1
similiarly every id is a consecutive number

Oneshox 05-13-2010 10:07

Re: Zombie class name
 
Quote:

Originally Posted by abdul-rehman (Post 1179101)
Not possible bcoz the native has not been biuld..
You can get the id of the class if you want..[ Id is basically a number]

For eg:
The id of a classic zombie is 0
The id of a raptor zombie is 1
similiarly every id is a consecutive number

and included in zombie plague?

g_zclass_name ?

abdul-rehman 05-13-2010 10:09

Re: Zombie class name
 
Ya but there is not native which returns the classname..
I will be adding support for it in my new version..:)

Oneshox 05-13-2010 10:13

Re: Zombie class name
 
Quote:

Originally Posted by abdul-rehman (Post 1179104)
Ya but there is not native which returns the classname..
I will be adding support for it in my new version..:)

and how i can make plugin somethink like that, that it print class?

if (zp_get_user_zombie_class = g_zclass6)
{
client_print("You are now (what comes here) ?
}

abdul-rehman 05-13-2010 11:51

Re: Zombie class name
 
Quote:

Originally Posted by Oneshox (Post 1179108)
and how i can make plugin somethink like that, that it print class?

if (zp_get_user_zombie_class = g_zclass6)
{
client_print("You are now (what comes here) ?
}

You can do it like this:
PHP Code:

 
// This number is your zombie class id you want to test
// 3 is usually the id of "Poison Zombie"
#define ID 3
 
public zp_user_infected_post(id infector)
{
        if (
zp_get_user_zombie_class == ID)
                
client_printid," your id is %d" ,ID


Oneshox 05-13-2010 14:01

Re: Zombie class name
 
and for your chat plugin how i can include there ? :/ thats what i want all the time..

abdul-rehman 05-13-2010 15:54

Re: Zombie class name
 
1- Get the id's of every zombie by using the plugin i have provided above
2- While in-game when your checking id's check which name of zombie represents the id for eg you got this in game:
Your id is 4
Now check which zombie class you have chosen for eg you have chosen Rage Zombie so it means that Rage Zombie's id is 4
3- In the chat plugin do it like this:
PHP Code:

    else if (zp_get_user_zombie_class(id) == 4)
    {
          
ColorChat(0RED"[Rage Zombie] ^x04%s^x01: %s"name,chat);
    }
   else
          
ColorChat(0RED"[ZOMBIE] ^x04%s^x01: %s"namechat); 

Hope you understand my time-consuming idea.

Oneshox 05-14-2010 01:20

Re: Zombie class name
 
Quote:

Originally Posted by abdul-rehman (Post 1179328)
1- Get the id's of every zombie by using the plugin i have provided above
2- While in-game when your checking id's check which name of zombie represents the id for eg you got this in game:
Your id is 4
Now check which zombie class you have chosen for eg you have chosen Rage Zombie so it means that Rage Zombie's id is 4
3- In the chat plugin do it like this:
PHP Code:

    else if (zp_get_user_zombie_class(id) == 4)
    {
          
ColorChat(0RED"[Rage Zombie] ^x04%s^x01: %s"name,chat);
    }
   else
          
ColorChat(0RED"[ZOMBIE] ^x04%s^x01: %s"namechat); 

Hope you understand my time-consuming idea.

ye man good idea i hope it works..

abdul-rehman 05-14-2010 03:30

Re: Zombie class name
 
It WILL WORK..:up:


All times are GMT -4. The time now is 03:41.

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