Raised This Month: $ Target: $400
 0% 

[SOLVED] Convert zombie class to human class


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gamestar110
Member
Join Date: Sep 2011
Location: india
Old 02-02-2013 , 08:38   [SOLVED] Convert zombie class to human class
Reply With Quote #1

Someone plz convert below zombie class to human class for zp 5.0.8

Main plugin link → [ZP] Zombie Class : Invisible Cat
PHP Code:
/*================================================================================
    
    -----------------------------------
    -*- [ZP] Zombie Class : Invisible Cat -*-
    -----------------------------------
    Created by Anggara_nothing. ^_^
    
    Description:
    The cat will be invisible if not move/jump.
    
    Credit:
    Hello-World -> Cat model.
    
================================================================================*/

#include <amxmodx>
#include <fun>
#include <fakemeta>
#include <zombieplague>

// Zombie Attributes
new const zclass_name[] = { "Invisible cat" // name
new const zclass_info[] = { "--HP ++SPEED" // description
new const zclass_model[] = { "cat_zombie" // model
new const zclass_clawmodel[] = { "cat_claw.mdl" // claw model
const zclass_health 350 // health
const zclass_speed 270 // speed
const Float:zclass_gravity 1.0 // gravity
const Float:zclass_knockback 1.0 // knockback

new g_pcvaramount
// Class IDs
new g_cat_class

public plugin_init()
{
    
register_plugin("[ZP] Poison Cat Zombie""1.2""Anggara_nothing")
    
register_forward(FM_PlayerPreThink"fw_PlayerPreThink")
    
    
g_pcvaramount register_cvar("zp_inviscat_amount""45")
    
// Register the new class and store ID for reference
    
g_cat_class zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)    
}

// User Infected forward
public zp_user_infected_post(idinfector)
{
    if(!
zp_get_user_zombie(id))
        return;
    
    
// Check if the infected player is using our custom zombie class
    
if (zp_get_user_zombie_class(id) == g_cat_class)
    {
        
give_item(id"item_longjump")
    }

}

public 
fw_PlayerPreThink(id)
{
    if(!
is_user_alive(id) || !zp_get_user_zombie(id))
        return 
PLUGIN_CONTINUE;
    
    if(
zp_get_user_zombie_class(id) != g_cat_class)
        return 
PLUGIN_CONTINUE;
    
    new 
button pev(idpev_button)
    
    if(
button&IN_ATTACK || button&IN_ATTACK2 || button&IN_BACK || button&IN_FORWARD || button&IN_RUN || button&IN_JUMP || button&IN_MOVELEFT || button&IN_MOVERIGHT || button&IN_LEFT || button&IN_RIGHT)
        
set_user_rendering(idkRenderFxNone0,0,0kRenderNormal255)
    else
        
set_user_rendering(idkRenderFxGlowShell000kRenderTransAlphaget_pcvar_num(g_pcvaramount))
    
    
    return 
PLUGIN_HANDLED

__________________
Trying to learn coding for amxx plugins

Last edited by gamestar110; 04-28-2013 at 06:03.
gamestar110 is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 02-02-2013 , 09:56   Re: [REQ] Convert zombie class to human class
Reply With Quote #2

Try.
Attached Files
File Type: sma Get Plugin or Get Source (zp50_human_class_invisable.sma - 562 views - 1.7 KB)
__________________

Last edited by H.RED.ZONE; 02-02-2013 at 22:43.
H.RED.ZONE is offline
gamestar110
Member
Join Date: Sep 2011
Location: india
Old 02-02-2013 , 22:31   Re: [REQ] Convert zombie class to human class
Reply With Quote #3

Quote:
Originally Posted by H.RED.ZONE View Post
Try.
Not working
__________________
Trying to learn coding for amxx plugins
gamestar110 is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 02-02-2013 , 22:43   Re: [REQ] Convert zombie class to human class
Reply With Quote #4

Edited code on top. Still would not suggest useing it it may cause lag.. im not shure if i can escape useing prethink on this type of code. I can lower usage with bits if you get problems or try to test Ham To detect moveing entity.
__________________
H.RED.ZONE is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 02-03-2013 , 22:11   Re: [REQ] Convert zombie class to human class
Reply With Quote #5

Can u make with bits.. thx
wicho is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 02-04-2013 , 10:05   Re: [REQ] Convert zombie class to human class
Reply With Quote #6

Quote:
Originally Posted by wicho View Post
Can u make with bits.. thx
Here.
Attached Files
File Type: sma Get Plugin or Get Source (zp50_human_class_invisable.sma - 552 views - 3.7 KB)
__________________
H.RED.ZONE is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 02-04-2013 , 21:59   Re: [REQ] Convert zombie class to human class
Reply With Quote #7

thx, i test and work but the zombie turn invisible too..
wicho is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 02-05-2013 , 06:40   Re: [REQ] Convert zombie class to human class
Reply With Quote #8

Quote:
Originally Posted by wicho View Post
thx, i test and work but the zombie turn invisible too..
Hmm that should not happen and i don't think it will. I blocked if user is zombie. Check again that other plugin is not causing that problem.

PHP Code:
~_IsPlayerZombie(id
__________________

Last edited by H.RED.ZONE; 02-05-2013 at 06:40.
H.RED.ZONE is offline
Reply



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 16:24.


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