Raised This Month: $32 Target: $400
 8% 

[INC] NMRiH VScript Proxy


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MsDysphie
AlliedModders Donor
Join Date: Dec 2017
Old 06-02-2022 , 14:21   [INC] NMRiH VScript Proxy
Reply With Quote #1

This is an include for No More Room in Hell that allows you to call VScript functions from Sourcemod.

Source: https://github.com/dysphie/nmrih-vsc...ript_proxy.inc

Usage:
  • Drag and drop `vscript_proxy.inc` into spcomp's `include` directory
  • #include <vscript_proxy> in your script

Natives List:
All natives are documented in the .inc
  • RunEntVScript
  • RunEntVScriptEnt
  • RunEntVScriptBool
  • RunEntVScriptFloat
  • RunEntVScriptVector
  • RunEntVScriptString

Example script:

PHP Code:
#include <sdktools>
#include <vscript_proxy>

public void OnPluginStart()
{
    
RegConsoleCmd("test_proxy"test_proxy);
}

Action test_proxy(int clientint args)
{
    
PrintToServer("GetOwner(): %d"RunEntVScriptEnt(client"GetOwner()"));

    
RunEntVScript(client"ViewPunch(Vector(10, 0, 0))");

    
PrintToServer("IsAlive(): %d"RunEntVScriptBool(client"IsAlive()"));
    
PrintToServer("GetJumpStaminaCost(): %f"RunEntVScriptFloat(client"GetJumpStaminaCost()"));

    
float vec[3];
    
RunEntVScriptVector(client"GetAngles()"vec);
    
PrintToServer("GetAngles(): %f %f %f"vec[0], vec[1], vec[2]);

    
char str[32];
    
RunEntVScriptString(client"GetClassname()"strsizeof(str));
    
PrintToServer("GetClassname(): %s"str);

    return 
Plugin_Handled;

Special Thanks:
__________________
Discord: @dysphie
Donations: ko-fi.com/dysphie

Last edited by MsDysphie; 06-02-2022 at 14:22.
MsDysphie is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 06-02-2022 , 17:32   Re: [INC] NMRiH VScript Proxy
Reply With Quote #2

AcceptEntityInput "Kill" is more safer than RemoveEntity()
Bacardi is offline
MsDysphie
AlliedModders Donor
Join Date: Dec 2017
Old 06-02-2022 , 18:09   Re: [INC] NMRiH VScript Proxy
Reply With Quote #3

Quote:
Originally Posted by Bacardi View Post
AcceptEntityInput "Kill" is more safer than RemoveEntity()
You must be thinking RemoveEdict, RemoveEntity is a wrapper around the Kill input, with extra safeguards
Source: https://cs.alliedmods.net/sourcemod/...tities.cpp#293
__________________
Discord: @dysphie
Donations: ko-fi.com/dysphie

Last edited by MsDysphie; 06-02-2022 at 18:10.
MsDysphie is offline
F1F88
Junior Member
Join Date: Nov 2022
Old 03-02-2023 , 22:48   Re: [INC] NMRiH VScript Proxy
Reply With Quote #4

Can you tell me how to get more VScript functions information? For example, other VScript functions, parameters and return
F1F88 is offline
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 10:18.


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