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

Undefined Symbol Error


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
mackid
New Member
Join Date: Apr 2012
Old 04-26-2012 , 00:30   Undefined Symbol Error
Reply With Quote #1

I searched on here and on google and I couldn't find a fix that worked for me so I'm posting this here. I'm going through the tutorial for getting started with plugins and I'm getting the following error

/home/groups/sourcemod/upload_tmp/phpiJRzEt.sp(43) : error 017: undefined symbol "SlapPlayer"

I'm not sure what is causing this and I've tried reinstalling SM and using the online Compiler. Did the command for this change? Did I make a stupid mistake? Any help would be much appreciated. Also if I have the wrong sub forum let me know and I will gladly move this to wherever this does belong.


#include <sourcemod>

new Handle:sm_myslap_damage = INVALID_HANDLE

public Plugin:myinfo =
{
name = "My First Plugin",
author = "Me",
description = "My first plugin ever",
version = "1.0.0.0"
}

public OnPluginStart()
{
RegAdminCmd("sm_myslap", Command_MySlap, ADMFLAG_SLAY)

sm_myslap_damage = CreateConVar("sm_myslap_damage", "5", "Default slap damage")
AutoExecConfig(true, "plugin_myslap")
}

public Action:Command_MySlap(client, args)
{
new String:arg1[32], String:arg2[32]
new damage = GetConVarInt(sm_myslap_damage)

// get the first arg
GetCmdArg(1,arg1,sizeof(arg1))

//if there are 2 or more args and second fetch is successful convert to int
if (args >= 2 && GetCmdArg(2, arg2, sizeof(arg2)))
{
damage = StringToInt(arg2)
}

//try and find a matching player
new target = FindTarget(client, arg1)
if (target == -1)
{
//auto replies with fail reason
return Plugin_Handled;
}

SlapPlayer(target, damage)

new String:name[MAX_NAME_LENGTH]

ShowActivity2(client, "[SM] ", "Slapped %s for %d damage!", name, damage)
LogAction(client, target, "\"%L\" slapped \"%L\" (damage %d)", client, target, damage)

return Plugin_Handled;
}

Last edited by mackid; 04-26-2012 at 00:31.
mackid is offline
 



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:39.


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