AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Solved [CS:GO] Autofire pistol (https://forums.alliedmods.net/showthread.php?t=306399)

Indarello 03-29-2018 11:06

[CS:GO] Autofire pistol
 
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);
                }
        }
}


Indarello 03-31-2018 02:13

Re: [CS:GO] Autofire pistol
 
Sorry, that was my error in another part of code
this autopistol is working normaly

eyal282 03-31-2018 13:44

Re: [CS:GO] Autofire pistol
 
Quote:

Originally Posted by Indarello (Post 2585410)
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.


All times are GMT -4. The time now is 11:46.

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