Raised This Month: $51 Target: $400
 12% 

[L4D2] Help with GetZombieType


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
diorfo
Member
Join Date: Dec 2013
Old 11-22-2016 , 08:43   [L4D2] Help with GetZombieType
Reply With Quote #1

Hello,

I'm making some modifications in plugin below to put in my L4D2 versus server.

I'm trying to filter the class to player can use the char color mod but i'm having the error undefined symbol GetZombieType while compiling when i use the function below.

Anyone could help me with the right usage of it?


PHP Code:
//////////////////////////////////////////////////////////////////
// SM COLOUR By MoggieX
//////////////////////////////////////////////////////////////////

#include <sourcemod>
#include <sdktools>
#pragma semicolon 1
#define PLUGIN_VERSION "1.3"

//////////////////////////////////////////////////////////////////
// Plugin Info
//////////////////////////////////////////////////////////////////

public Plugin:myinfo 
{
    
name "sm_colour",
    
author "MoggieX",
    
description "Set a Players Colour & Rendering",
    
version PLUGIN_VERSION,
    
url "http://www.afterbuy.co.uk"
};

//////////////////////////////////////////////////////////////////
// Start Plugin
//////////////////////////////////////////////////////////////////

public OnPluginStart()
{
    
LoadTranslations("common.phrases");
    
LoadTranslations("smcolour.phrases");

    
CreateConVar("sm_colour_version"PLUGIN_VERSION"SM Colour Version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    
RegAdminCmd("sm_color"Command_SmColourADMFLAG_CUSTOM3"sm_color <name or #userid or all/t/ct> <RED> <GREEN> <BLUE> - Set target's colour.");
    
RegAdminCmd("sm_render"Command_SmRenderADMFLAG_ROOT"sm_render <name or #userid or all/t/ct> <value> - Set target's render.");
}

////////////////////////////////////////////////////////////////////////
// sm_colour
////////////////////////////////////////////////////////////////////////
public Action:Command_SmColour(clientargs)
{
    if (
args 4)
    {
        
ReplyToCommand(client"[SM Colour] Usage: sm_colour <#userid|name|team|all> <RED 0-255> <GREEN 0-255> <BLUE 0-255>");
        return 
Plugin_Handled;    
    }

// Error trapping for R G B O

// #2 Red
    
new red 0;
    
decl String:arg2[20];
    
GetCmdArg(2arg2sizeof(arg2));
    if (
StringToIntEx(arg2red) == 0)
    {
        
ReplyToCommand(client"\x04[SM Colour]\x01 %t""Invalid Amount For Red");
        return 
Plugin_Handled;
    }
    if (
red 0)
    {
        
red 0;
    }
    if (
red 255)
    {
        
red 255;
    }
    if (
GetZombieType(client) != || (GetZombieType(client) != 9)
    {
        
red 255;
    }
    

// #3 Green
    
new green 0;
    
decl String:arg3[20];
    
GetCmdArg(3arg3sizeof(arg3));
    if (
StringToIntEx(arg3green) == 0)
    {
        
ReplyToCommand(client"\x04[SM Colour]\x01 %t""Invalid Amount For Green");
        return 
Plugin_Handled;
    }
    if (
green 0)
    {
        
green 0;
    }
    if (
green 255)
    {
        
green 255;
    }
    if (
GetZombieType(client) != || (GetZombieType(client) != 9)
    {
        
green 255;
    }

// #4 Blue
    
new blue 0;
    
decl String:arg4[20];
    
GetCmdArg(4arg4sizeof(arg4));
    if (
StringToIntEx(arg4blue) == 0)
    {
        
ReplyToCommand(client"\x04[SM Colour]\x01 %t""Invalid Amount For Blue");
        return 
Plugin_Handled;
    }
    if (
blue 0)
    {
        
blue 0;
    }
    if (
blue 255)
    {
        
blue 255;
    }
    if (
GetZombieType(client) != || (GetZombieType(client) != 9)
    {
        
blue 255;
    }

//////// Find player and SET Colours

// get their name
    
decl String:arg[65];
    
GetCmdArg(1argsizeof(arg));

    
decl String:target_name[MAX_TARGET_LENGTH];
    
decl target_list[MAXPLAYERS], target_countbool:tn_is_ml;
    
    if ((
target_count ProcessTargetString(
            
arg,
            
client,
            
target_list,
            
MAXPLAYERS,
            
COMMAND_FILTER_ALIVE,
            
target_name,
            
sizeof(target_name),
            
tn_is_ml)) <= 0)
    {
        
ReplyToTargetError(clienttarget_count);
        return 
Plugin_Handled;
    }
    
    for (new 
0target_counti++)
    {        
        
SetEntityRenderColor(clientredgreenblue);    
    }

    if (
tn_is_ml)
    {
        
ShowActivity2(client"x04[SM Colour]\x03 ""%t""Set colour on target"clientclientredgreenblue);
    }
    else
    {
        
ShowActivity2(client"\x04[SM Colour]\x03 ""%t""Set colour on target""_s"clientclientredgreenblue);
    }

    return 
Plugin_Handled;
}

////////////////////////////////////////////////////////////////////////
// sm_render
////////////////////////////////////////////////////////////////////////

public Action:Command_SmRender(clientargs)
{
    if (
args 1)
    {
        
ReplyToCommand(client"[SM Render] Usage: sm_render <#userid|name|team|all> <RENDER 0-26>");
        return 
Plugin_Handled;    
    }

// get their name
    
decl String:arg[65];
    
GetCmdArg(1argsizeof(arg));

        new 
amount 0;
        
decl String:arg2[20];
        
GetCmdArg(2arg2sizeof(arg2));
        if (
StringToIntEx(arg2amount) == 0)
        {
            
ReplyToCommand(client"[SM] %t""Invalid Amount");
            return 
Plugin_Handled;
        }
        
        if (
amount 0)
        {
            
amount 0;
        }
        
        if (
amount 26)
        {
            
amount 26;
        }

//////// Find and Set

    
decl String:target_name[MAX_TARGET_LENGTH];
    
decl target_list[MAXPLAYERS], target_countbool:tn_is_ml;
    
    if ((
target_count ProcessTargetString(
            
arg,
            
client,
            
target_list,
            
MAXPLAYERS,
            
COMMAND_FILTER_ALIVE,
            
target_name,
            
sizeof(target_name),
            
tn_is_ml)) <= 0)
    {
        
ReplyToTargetError(clienttarget_count);
        return 
Plugin_Handled;
    }
    
    for (new 
0target_counti++)
    {
        
SetEntityRenderFx(target_list[i], amount);
    }

    if (
tn_is_ml)
    {
        
ShowActivity2(client"\x04[SM Colour]\x03 ""%t""Set render on target"clienttarget_nameamount);
    }
    else
    {
        
ShowActivity2(client"\x04[SM Colour]\x03 ""%t""Set render on target""_s"clienttarget_nameamount);
    }

    return 
Plugin_Handled;


diorfo is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 11-22-2016 , 12:50   Re: [L4D2] Help with GetZombieType
Reply With Quote #2

what is GetZombieType ?
maybe you forgot an include that defines GetZombieType
__________________
8guawong is offline
xerox8521
Senior Member
Join Date: Sep 2011
Old 11-22-2016 , 14:21   Re: [L4D2] Help with GetZombieType
Reply With Quote #3

GetZombieType probably returns the m_zombieclass netprop. So add this at the bottom of your script

PHP Code:
stock GetZombieType(client)
{
    return 
GetEntProp(clientProp_Send"m_zombieClass");

But the if statements where the GetZombieType is called should be changed to:

PHP Code:
if (GetZombieType(client) != && GetZombieType(client) != 9
Otherwise it will be always true which is not what you wanted

Last edited by xerox8521; 11-22-2016 at 14:24.
xerox8521 is offline
africanspacejesus
Senior Member
Join Date: Nov 2016
Location: Bay Area, CA
Old 02-19-2017 , 16:25   Re: [L4D2] Help with GetZombieType
Reply With Quote #4

How are you able to find the class names for the zombies?
__________________
Taking paid plugin requests
africanspacejesus 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 23:53.


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