View Single Post
Author Message
SamuraiBarbi
Senior Member
Join Date: Aug 2006
Location: United States
Old 05-21-2009 , 11:55   Why Can't I return a String?
Reply With Quote #1

Does anyone have any idea why I can't return this string value? This is something I wrote real quick just to make sure I could return string values, but when I compile it says tag mismatch on line 43.

Code:
#pragma semicolon 1



#include <sourcemod>
#include <sdktools>
#include <sdktools_trace>
#include <clients>
#include <hacks>


    public OnPluginStart()
    {
        HookEvent("weapon_fire", Event_WeaponFire, EventHookMode_Pre);

    }

    public Action:Event_WeaponFire(Handle:event, const String:name[], bool:dontBroadcast)
    {
        new target_playerID = GetEventInt(event,"userid");
        new target_playerClient = GetClientOfUserId(target_playerID);
        
        PrintToChatAll("%s", GetPlayerName(target_playerClient));
    }

    GetPlayerName(any:target_playerClient)
    {
        new String:target_playerName[20];
        GetClientName(target_playerClient,target_playerName,sizeof(target_playerName));

        return target_playerName;
    }
SamuraiBarbi is offline
Send a message via AIM to SamuraiBarbi Send a message via MSN to SamuraiBarbi Send a message via Yahoo to SamuraiBarbi