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

Solved is SDKCall can Call Create()?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ABCDEFGH23
Junior Member
Join Date: Jun 2020
Location: HEEELP!!!
Old 08-18-2020 , 20:24   is SDKCall can Call Create()?
Reply With Quote #1

CBaseEntity::Create(char const* class_name, Vector const& origin, QAngle const& angle, CBaseEntity*);

call Create() function = crashes

Code:
Handle Config;
Handle hCreate;

public void OnPluginStart(){

Config = LoadGameConfigFile("test");

StartPrepSDKCall(SDKCall_Entity);

//window sig: \x55\x8B\xEC\x56\x6A\xFF\xFF\x75\x08\xE8\x2A\x2A\x2A\x2A\x8B\xF0\x83\xC4\x08\x85\xF6\x75\x2A\x56
//linux and mac sig: _ZN11CBaseEntity6CreateEPKcRK6VectorRK6QAnglePS_

PrepSDKCall_SetFromConf(Config, SDKConf_Signature, "CBaseEntity::Create");
PrepSDKCall_AddParameter(SDKType_String, SDKPass_Pointer);
PrepSDKCall_AddParameter(SDKType_Vector, SDKPass_ByValue);
PrepSDKCall_AddParameter(SDKType_QAngle, SDKPass_ByValue);
PrepSDKCall_AddParameter(SDKType_CBaseEntity, SDKPass_Pointer);

hCreate= EndPrepSDKCall();

CloseHandle(Config);

RegConsoleCmd("sm_test", test);

}


public Action test(int client, int args){

float origin[3];
float angle[3];

GetClientAbsOrigin(client, origin);

angle[0] = GetEntPropFloat(client, Prop_Send, "m_angEyeAngles[0]");
angle[1] = GetEntPropFloat(client, Prop_Send, "m_angEyeAngles[1]");

SDKCall(hCreate, "item_currencypack_medium", origin, angle, client); //---crashes---

return Plugin_Handled;

}




Last edited by ABCDEFGH23; 08-18-2020 at 20:52. Reason: forgot the signature
ABCDEFGH23 is offline
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 08-18-2020 , 20:39   Re: is SDKCall can Call Create()?
Reply With Quote #2

CBaseEntity::Create is a static function

if signature is right then this should work and also instead of SDK you can just use CreateEntityByName

Spoiler
__________________
cry

Last edited by BHaType; 08-18-2020 at 20:39.
BHaType is offline
Send a message via AIM to BHaType
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 18:53.


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