|
Great Tester of Whatever
|
07-27-2021
, 01:15
Re: [L4D2] How to get item that are about to be picked up.
|
#2
|
Spoiler
PHP Code:
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>
#include <sdktools>
Handle g_hUseEntity;
public void OnPluginStart()
{
StartPrepSDKCall(SDKCall_Player);
PrepSDKCall_SetVirtual(439); /* + 1 for linux */
PrepSDKCall_AddParameter(SDKType_Float, SDKPass_Plain);
PrepSDKCall_AddParameter(SDKType_Float, SDKPass_Plain);
PrepSDKCall_AddParameter(SDKType_Float, SDKPass_Plain);
PrepSDKCall_AddParameter(SDKType_Bool, SDKPass_Plain);
PrepSDKCall_AddParameter(SDKType_Bool, SDKPass_Plain);
PrepSDKCall_SetReturnInfo(SDKType_CBaseEntity, SDKPass_Pointer);
g_hUseEntity = EndPrepSDKCall();
RegConsoleCmd("sm_usentity", sm_usentity);
}
public Action sm_usentity (int client, int args)
{
PrintToChatAll("%i", GetUseEntity(client, 99999.0));
}
int GetUseEntity (int client, float use_radius = 96.0 /* default of player_use_radius */)
{
return SDKCall(g_hUseEntity, client, use_radius, 0.0, 0.0, 0, 0);
}
__________________
|
|
|
|