Raised This Month: $248 Target: $400
 62% 

Solved Fun - HookEvent(Weapon) Slap Player with SteamID


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SkinnyBruv
AlliedModders Donor
Join Date: Feb 2013
Location: Straya
Old 09-11-2020 , 00:49   Fun - HookEvent(Weapon) Slap Player with SteamID
Reply With Quote #1

Hey Guys and Girls,

Im trying to hook a CSGO event ("weapon_fire"), to slap or kill a person with a unique steamID instantly on shooting any gun.

PHP Code:
public OnPluginStart()
{
    
HookEvent("weapon_fire"Event_AidenWillDie);
}

public 
void Event_AidenWillDie(Handle:event, const String:name[],bool:dontBroadcast)
{
    new 
String:aidenSteamID[64];
    new 
victim GetClientOfUserId(GetEventInt(event"userid"));
    
    
GetClientAuthId(victimAuthId_Steam2aidenSteamIDsizeof(aidenSteamID));
    
    if (
aidenSteamID[victim] == "STEAM_1:1:165530312")
    {
        
SlapPlayer(victim99true);
    }

Just wondering where i am going wrong with it,
Im getting error 033: Array must be indexed (variable "-unknown-") - (If(aidenSteamID) Line
error 035: argument type mismatched (argument 1) - (SlapPlayer line)

PS: This is for educational purposes only!

Kind Regards

SkinnyBruv

EDIT:

Hi Guys fixed
please see below
PHP Code:
public void Event_AidenWillDie(Handle:event, const String:name[],bool:dontBroadcast)
{
    new 
String:aidenSteamID[64];
    new 
victim GetClientOfUserId(GetEventInt(event"userid"));
    
    
GetClientAuthId(victimAuthId_Steam2aidenSteamIDsizeof(aidenSteamID));
    
    if (
StrEqual (aidenSteamID"STEAM_1:1:165530312"))
    {
        
SlapPlayer(victim100true);
    }

__________________
www.ancientgaming.net is my story.
Everything happens for a reason.
Nothing is random...
#Do you even AGN...

Last edited by SkinnyBruv; 09-11-2020 at 01:13. Reason: Fixed and solved myself
SkinnyBruv is offline
Send a message via Skype™ to SkinnyBruv
Reply


Thread Tools
Display Modes

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


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