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

Control Speed of AI Only?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CryForMe
Junior Member
Join Date: Sep 2014
Old 11-22-2014 , 18:32   Control Speed of AI Only?
Reply With Quote #1

I've really looked, but perhaps I just don't understand as much as I should.
I'm trying to develop a plugin that allows me to control the walking/running speed of the A.I. zombies on my server, but I can't even locate a cvar for it to begin. I thought with sm, I could use some sort of entity control on them to solve this, but I'm having trouble getting started. The game is Contagion. Any advice would be a great help.
CryForMe is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 11-22-2014 , 20:40   Re: Control Speed of AI Only?
Reply With Quote #2

If you can detect fake clients (ie AI players) and change a players speed you just detect all fake clients and change their speed.
__________________
zeroibis is offline
thecount
Veteran Member
Join Date: Jul 2013
Old 11-22-2014 , 23:58   Re: Control Speed of AI Only?
Reply With Quote #3

Quote:
Originally Posted by zeroibis View Post
If you can detect fake clients (ie AI players) and change a players speed you just detect all fake clients and change their speed.
I'm not experienced with this game, but I think the zombies might not be classified as actual clients. I'm thinking it's sort of like L4D2, but I may be wrong. So in that case, the zombies would not be able to be found by looping through all clients. Therefore, you would need to search through all entities of whatever the classname is and then adjust the (keyvalue?) speed that way.

PHP Code:
new ent = -1;
while((
ent FindEntityByClassname(ent"zombie?")) != -1){//For every zombie class
//Change speed here

OR

PHP Code:
public OnEntityCreated(ent, const String:classname[]){
if(
StrEqual(classname"zombie?"false)){
//Change speed here
}


Last edited by thecount; 11-23-2014 at 00:01.
thecount is offline
CryForMe
Junior Member
Join Date: Sep 2014
Old 11-23-2014 , 01:07   Re: Control Speed of AI Only?
Reply With Quote #4

Quote:
Originally Posted by thecount View Post
I'm not experienced with this game, but I think the zombies might not be classified as actual clients. I'm thinking it's sort of like L4D2, but I may be wrong. So in that case, the zombies would not be able to be found by looping through all clients. Therefore, you would need to search through all entities of whatever the classname is and then adjust the (keyvalue?) speed that way.

PHP Code:
new ent = -1;
while((
ent FindEntityByClassname(ent"zombie?")) != -1){//For every zombie class
//Change speed here

OR

PHP Code:
public OnEntityCreated(ent, const String:classname[]){
if(
StrEqual(classname"zombie?"false)){
//Change speed here
}

Ah, this makes it a bit clearer. Thank you, I will work on this.
CryForMe is offline
CryForMe
Junior Member
Join Date: Sep 2014
Old 11-23-2014 , 16:16   Re: Control Speed of AI Only?
Reply With Quote #5

Ok, here's what I've tried so far and I can't seem to get it working.

PHP Code:
/*
* SourceMod Script
*/

#include <sourcemod>
#include <sdktools>

#define PLUGIN_VERSION "1.0"

new Handle:g_Cvar_zSpeed
new Handle:g_Cvar_zWeight

public Plugin:myinfo 
{
    
name "zSpeed",
    
author "",
    
description "Speeds Up Zombies",
    
version PLUGIN_VERSION,
    
url ""
};


public 
OnPluginStart()
{
    
CreateConVar("sm_zspeed_version"PLUGIN_VERSION"zSpeed Version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY)
    
g_Cvar_zspeed    CreateConVar("sm_zspeed_speed""3.0"" Sets the zombies speed "FCVAR_PLUGIN)
    
g_Cvar_zweight   CreateConVar("sm_zspeed_weight""0.0"" Sets the zombies weight"FCVAR_PLUGIN)
   
    
AutoExecConfig();   
    
}

public 
OnEntityCreated(ent, const String:classname[]){
if(
StrEqual(classname"zombie"false)){
   
    
SetEntPropFloat(entProp_Data"m_flLaggedMovementValue"GetConVarFloat(g_cvar_zspeed))
    
SetEntityGravity(entGetConVarFloat(g_Cvar_zWeight))
}  

CryForMe 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 03:58.


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