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

Solved [CS:GO] Autofire pistol


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 03-29-2018 , 11:06   [CS:GO] Autofire pistol
Reply With Quote #1

When i test AutoPistol on lan (windows) server with bots
it works, even i can kill bots with autofire
When i add this to server with players (linux)
it works only on client side, other players dont see even shots and 0 damage



Code:
HookEvent("weapon_fire", Event_WeaponFire, EventHookMode_Pre);

public Action Event_WeaponFire(Handle:event, const String:name[], bool:dontBroadcast)
{
	new client = GetClientOfUserId(GetEventInt(event, "userid"));
	
	RequestFrame(FirePostFrame, client);
}
public FirePostFrame(client)
{
	if(IsValidClient(client))
	{
		new weapon = GetEntPropEnt(client, Prop_Data, "m_hActiveWeapon");
		if(IsValidEntity(weapon))
		{
			SetEntProp(client, Prop_Send, "m_iShotsFired", 0);
		}
	}
}

Last edited by Indarello; 03-31-2018 at 02:12.
Indarello is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 03-31-2018 , 02:13   Re: [CS:GO] Autofire pistol
Reply With Quote #2

Sorry, that was my error in another part of code
this autopistol is working normaly

Last edited by Indarello; 03-31-2018 at 05:09.
Indarello is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 03-31-2018 , 13:44   Re: [CS:GO] Autofire pistol
Reply With Quote #3

Quote:
Originally Posted by Indarello View Post
Sorry, that was my error in another part of code
this autopistol is working normaly
In any case, try changing it from Pre to Post, doesn't make any sense and might have the possibility to malfunction.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 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 10:57.


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