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

Need help with a plugin I downloaded.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eco3576
Senior Member
Join Date: Jul 2010
Old 07-28-2010 , 23:33   Need help with a plugin I downloaded.
Reply With Quote #1

I apologize if this is in the wrong section but I cant get this plugin to work. I dont have access to the server logs so I tested it out on my own local server
PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <ctfplayersharedcond>
#include <tf2>

public Plugin:myinfo =
{
    
name "CTFPlayerShared Conditions Examples",
    
author "Wazz",
    
description "CTFPlayerShared Conditions examples",
    
version "0.0.9.0",
    
url "http://www.sourcemod.net/"
};

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

    
RegAdminCmd("sm_addcondition"cmd_AddConditionADMFLAG_KICK"Adds a condition to the target");
    
RegAdminCmd("sm_removecondition"cmd_RemoveConditionADMFLAG_KICK"Removes a condition from the target");
}

public 
OnConditionAdded(ClientPlayerCondition:condition)
{
    
PrintToChatAll("OnConditionAdded for %N: %i"Clientcondition);
    
    return;
}

public 
OnConditionRemoved(ClientPlayerCondition:condition)
{
    
PrintToChatAll("OnConditionRemoved for %N: %i"Clientcondition);
    
    return;
}

public 
Action:cmd_AddCondition(Clientargs)
{
    if (
args != 2)
    {
        
ReplyToCommand(Client"[SM] Usage: sm_addcondition <target> <condition>");
        return 
Plugin_Handled;    
    }    
    
    
decl String:buffer[64];
    
decl String:target_name[MAX_NAME_LENGTH];
    
decl target_list[MAXPLAYERS];
    
decl target_count;
    
decl bool:tn_is_ml;
    
    
GetCmdArg(1buffersizeof(buffer));
    
    if ((
target_count ProcessTargetString(
            
buffer,
            
Client,
            
target_list,
            
MAXPLAYERS,
            
COMMAND_FILTER_ALIVE,
            
target_name,
            
sizeof(target_name),
            
tn_is_ml)) <= 0)
    {
        
ReplyToTargetError(Clienttarget_count);
        return 
Plugin_Handled;
    }
    
    new 
PlayerCondition:cond;
    
    
GetCmdArg(2buffersizeof(buffer));
    
cond PlayerCondition:StringToInt(buffer);
    
    for (new 
0target_counti++)
    {
        
AddCondition(target_list[i], cond);
        
ShowActivity2(Client"[SM] ""given %N condition %i."target_list[i], cond);
    }
    
    return 
Plugin_Handled;
}

public 
Action:cmd_RemoveCondition(Clientargs)
{
    if (
args != 2)
    {
        
ReplyToCommand(Client"[SM] Usage: sm_removecondition <target> <condition>");
        return 
Plugin_Handled;    
    }    
    
    
decl String:buffer[64];
    
decl String:target_name[MAX_NAME_LENGTH];
    
decl target_list[MAXPLAYERS];
    
decl target_count;
    
decl bool:tn_is_ml;
    
    
GetCmdArg(1buffersizeof(buffer));
    
    if ((
target_count ProcessTargetString(
            
buffer,
            
Client,
            
target_list,
            
MAXPLAYERS,
            
COMMAND_FILTER_ALIVE,
            
target_name,
            
sizeof(target_name),
            
tn_is_ml)) <= 0)
    {
        
ReplyToTargetError(Clienttarget_count);
        return 
Plugin_Handled;
    }
    
    new 
PlayerCondition:cond;
    
    
GetCmdArg(2buffersizeof(buffer));
    
cond PlayerCondition:StringToInt(buffer);
    
    for (new 
0target_counti++)
    {
        
RemoveCondition(target_list[i], cond);
        
ShowActivity2(Client"[SM] ""removed condition %i from %N."condtarget_list[i]);
    }
    
    return 
Plugin_Handled;

For the record, the topic this was on was really old so I didnt want to be impolite and bump an old thread.

The error I get is this

PHP Code:
 07/28/2010 20:02:49: [SMNative "AddCondition" reportedFailed to locate function
L 07/28/2010 20:02:49: [SMDisplaying call stack trace for plugin "Addcond.smx":
L 07/28/2010 20:02:49: [SM]   [0]  Line 75Addcond.sp::cmd_AddCondition() 
eco3576 is offline
eco3576
Senior Member
Join Date: Jul 2010
Old 07-29-2010 , 01:15   Re: Need help with a plugin I downloaded.
Reply With Quote #2

Can someone please tell me what this error means or what I need to do I've been wanting to get this to work but I have no idea what to do...
eco3576 is offline
noodleboy347
AlliedModders Donor
Join Date: Mar 2009
Old 07-29-2010 , 03:13   Re: Need help with a plugin I downloaded.
Reply With Quote #3

Are you meaning to use TF2_AddCondition/TF2_RemoveCondition?
noodleboy347 is offline
dirka_dirka
Veteran Member
Join Date: Nov 2009
Old 07-29-2010 , 10:48   Re: Need help with a plugin I downloaded.
Reply With Quote #4

just like the error says.. line 75 is calling AddCondition()
well your code has no AddCondition - so as the error says: failed to locate it.
dirka_dirka is offline
eco3576
Senior Member
Join Date: Jul 2010
Old 07-29-2010 , 11:27   Re: Need help with a plugin I downloaded.
Reply With Quote #5

So what do i put in line 75 I'm still new to this kind of stuff?
eco3576 is offline
dirka_dirka
Veteran Member
Join Date: Nov 2009
Old 07-29-2010 , 14:04   Re: Need help with a plugin I downloaded.
Reply With Quote #6

its not line 75 - its THE MISSING FUNCTION
you need a while block of code called AddCondition

and after that problem is solved, youll be back asking about an identical problem on another line looking for RemoveCondition
dirka_dirka is offline
eco3576
Senior Member
Join Date: Jul 2010
Old 07-29-2010 , 14:42   Re: Need help with a plugin I downloaded.
Reply With Quote #7

So can anyone fix this for me I cant code plugins for crap or fix them for that matter....
eco3576 is offline
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 07-29-2010 , 15:33   Re: Need help with a plugin I downloaded.
Reply With Quote #8

Quote:
Originally Posted by dirka_dirka View Post
just like the error says.. line 75 is calling AddCondition()
well your code has no AddCondition - so as the error says: failed to locate it.
The code wouldn't compile if the function didn't exist. Obviously its declared, but throws a runtime error because of a failed sig scan or something in that direction.

The plugin must be using some outdated extension. noodleboy347 already suggested using TF2_AddCondition and TF2_RemoveCondition instead, but you ignored him.
__________________
plop
p3tsin is offline
eco3576
Senior Member
Join Date: Jul 2010
Old 07-29-2010 , 15:37   Re: Need help with a plugin I downloaded.
Reply With Quote #9

Yeah but those are just natives aren't they? I don't understand how to use them if there isn't a plugin out there that they're used for.
eco3576 is offline
eco3576
Senior Member
Join Date: Jul 2010
Old 07-29-2010 , 15:46   Re: Need help with a plugin I downloaded.
Reply With Quote #10

Im sorry I don't understand what to do at all. Do i replace the cmd_addcondition with tf2_AddCondition or what?
eco3576 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 19:44.


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