Post: [1.16] GSC functions codes list | Random Scripts
03-09-2015, 06:58 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Ok so since I released how to call raw gsc functions, I thought, why not a gsc codes list?

Make sure you call this after each function. Scr_ClearOutParams();

    THIS IS UPDATED AFTER SHARKS POST

void Scr_ClearOutParams(){
VariableValue* Top;
uint Params = *(int*)(0x13C3140 + 0x1Cool Man (aka Tustin);
*(int*)(0x13C3140 + 0x1Cool Man (aka Tustin) = 0;
for(Top -= Params; Params; --Params){
((void(*)(int, VariableUnion))&ParseAddr(0x2DA724))(Top->type, Top->u); // RemoveRefToObject
--Top;
}
return;
}


GScr_Earthquake:

    void GScr_Earthquake(float scale, float duration, float* source, float radius){
Scr_AddFloat(radius);
Scr_AddVector(source);
Scr_AddFloat(duration);
Scr_AddFloat(scale);
Scr_SetParameters(4); //See how I set the parameter number after I finish calling the Scr_Adds?
((void(*)())&ParseAddr(0x268B60))(); //Call the actual function
//((void(*)(int))&ParseAddr(0x268B60))(ClientID << 16); //Only call this one if the one above doesn't work.
Scr_ClearOutParams();
}


Scr_PlayFX:

    void Scr_PlayFX(const char* EffectId, float* Position, float* Forward = 0, float* Up = 0){
Scr_AddVector(Up);
Scr_AddVector(Forward);
Scr_AddVector(Position);
Scr_AddInt(((int(*)(const char*))&ParseAddr(0x324D0))(EffectId));
Scr_SetParameters(4);
((void(*)())&ParseAddr(0x2732D4))();
Scr_ClearOutParams();
}


Scr_MagicBullet:

    void Scr_MagicBullet(int ClientID, const char* Bullet, float* Start, float* End){
Scr_AddEntity(GetEntity(ClientID));
Scr_AddVector(End);
Scr_AddVector(Start);
Scr_AddString(Bullet);
Scr_SetParameters(4);
((void(*)())&ParseAddr(0x264800))();
Scr_ClearOutParams();
}


Scr_PhysicsExplosionCylinder:

    void Scr_PhysicsExplosionCylinder(float* Origin, float OuterRadius, float InnerRadius, float Magnitude){
Scr_AddFloat(Magnitude);
Scr_AddFloat(InnerRadius);
Scr_AddFloat(OuterRadius);
Scr_AddVector(Origin);
Scr_SetParameters(4);
((void(*)())&ParseAddr(0x273770))();
//If it doesn't work, try ((void(*)(int))&ParseAddr(0x273770))(ClientID << 16);
Scr_ClearOutParams();
}


GScr_SetMiniMap:

    void GScr_SetMiniMap(const char* Material, UpperLeftX, UpperLeftY, LowerRightX, LowerRightY){
Scr_AddFloat(LowerRightY);
Scr_AddFloat(LowerRightX);
Scr_AddFloat(UpperLeftY);
Scr_AddFloat(UpperLeftX);
Scr_AddString(Material);
Scr_SetParameters(5);
Scr_ClearOutParams();
}

___________________________Random functions___________________________

VectorScale:

    float* VectorScale(float* Angle, int Scale){
float Result[] = { Angle[0]* Scale, Angle[1]* Scale, Angle[2]* Scale };
return Result;
}


AnglesToForward:

    #define AngleVectors(Angle, Forward, Right, Up) ((void(*)(const float*, float*, float*, float*))&ParseAddr(0x38020Cool Man (aka Tustin))(Angle, Forward, Right, Up)

float* AnglesToForward(const float* Angle){
float Forward[3];
AngleVectors(Angle, Forward, 0, 0);
return Forward;//If this doesn't work, return Angle;
}



GetEye: //Equivalent to GetTagOrigin("tag_eye")

    #define G_GetPlayerViewOrigin(PS, Origin) ((void(*)(int, float*))&ParseAddr(0x231884))(PS, Origin)

float* GetEye(unsigned int ClientID){
float Org[3];
G_GetPlayerViewOrigin(G_Client(ClientID), Org);
return Org;
}


GetCursorPos:

    

#define G_LocationalTrace(Trace, Start, End, PassEnt, ContentMask, PriorityMap) ((void(*)(trace_t*, const float*, const float*, int, int, char*))&ParseAddr(0x250FA4))(Trace, Start, End, PassEnt, ContentMask, PriorityMap)
#define Trace_GetEntityHitId(Trace) ((ushort(*)(trace_t*))&ParseAddr(0x2A9750))(Trace)

struct BulletTraceType{
short entnum;
float Pos[3];
};

struct trace_t{//Xx jAmes t xX
float fraction;
byte Buffer[0x28];
};

void BulletTrace(BulletTraceType* Type, float* Start, float* End, unsigned int ClientID){//Xx jAmes t xX
trace_t trace;
G_LocationalTrace(&trace, Start, End, ClientID, 0x80A831, 0);
for(unsigned char i = 0; i < 3; i++) Type->Pos[i] = (((End[i]-Start[i]) * trace.fraction) + Start[i]);
short Entity = Trace_GetEntityHitId(&trace) & 0xFFFF;
if(Entity < 0x7FE) Type->entnum= Entity;
}

float* GetCursorPos(unsigned int ClientID){
BulletTraceType Type;
BulletTrace(&Type, GetEye(), VectorScale(AnglesToForward((float*)(G_Client(ClientID) + 0x184), 100000), ClientID);
return Type.Pos;
}


___________________________Hooks that you can use___________________________

VM_Execute:

Address location - 0x2E6444

    

int VM_ExecuteStub(){
__asm("li %r3, 0x4");
}

int VM_Execute(){
//Do stuff here
return VM_ExecuteStub();
}
What you can use this for: A loop? Calling Scr_Adds?


Scr_Notify:

Address location - 0x28B73C

    

int Scr_NotifyStub(){
__asm("li %r3, 0x5");
}
#define SL_ConvertToString(StringValue) ((const char*(*)(unsigned short))&ParseAddr(0x2D894C))(StringValue)
#define iClient *(short*)Entity

void Scr_Notify(int Entity, short StringValue, unsigned int Paramcount){
/*
if(!strcmp(SL_ConvertToString(StringValue), "weapon_fired")) MagicBullet(iClient, GetEye(), GetCursorPos());
*/
return Scr_NotifyStub(Entity, StringValue, Paramcount);
}

What you can use this for: Calling Scr_Adds | Waitill. Only use this if you're having crashing problems with VM_Notify



I'll update this more when I find more functions.
Last edited by Ambition sG ; 03-27-2015 at 09:16 PM.

The following 14 users say thank you to Ambition sG for this useful post:

01cedricv2, BaSs_HaXoR, Father Luckeyy, FusionIsDaName, gοd, GFM, ImManga, kiwi_modz, LBK, lutsch1234, Stunz, Swaqq, TotalModzHD, XenonLegend
03-18-2015, 12:16 AM #38
Killer Be
Climbing up the ladder
someone, please make gsc menu for ghosts Happy
03-19-2015, 11:43 PM #39
Originally posted by Black
Okay so I don't care who started what. All of you need to stop arguing. It's just a scripts thread calm yourselves.


I was having a bad day Happy
03-27-2015, 07:29 AM #40
Shark
Retired.
Originally posted by Ambition
Ok so since I released how to call raw gsc functions, I thought, why not a gsc codes list?

Make sure you call this after each function. Scr_ClearOutParams();

    #define Scr_ClearOutParams() ((void(*)(void))&ParseAddr(0x2E005Cool Man (aka Tustin))()


GScr_Earthquake:

    void GScr_Earthquake(float scale, float duration, float* source, float radius){
Scr_AddFloat(radius);
Scr_AddVector(source);
Scr_AddFloat(duration);
Scr_AddFloat(scale);
Scr_SetParameters(4); //See how I set the parameter number after I finish calling the Scr_Adds?
((void(*)())&ParseAddr(0x268B60))(); //Call the actual function
//((void(*)(int))&ParseAddr(0x268B60))(ClientID << 16); //Only call this one if the one above doesn't work.
Scr_ClearOutParams();
}


Scr_PlayFX:

    void Scr_PlayFX(const char* EffectId, float* Position, float* Forward = 0, float* Up = 0){
Scr_AddVector(Up);
Scr_AddVector(Forward);
Scr_AddVector(Position);
Scr_AddInt(((int(*)(const char*))&ParseAddr(0x324D0))(EffectId));
Scr_SetParameters(4);
((void(*)())&ParseAddr(0x2732D4))();
Scr_ClearOutParams();
}


Scr_MagicBullet:

    void Scr_MagicBullet(int ClientID, const char* Bullet, float* Start, float* End){
Scr_AddEntity(GetEntity(ClientID));
Scr_AddVector(End);
Scr_AddVector(Start);
Scr_AddString(Bullet);
Scr_SetParameters(4);
((void(*)())&ParseAddr(0x264800))();
Scr_ClearOutParams();
}


Scr_PhysicsExplosionCylinder:

    void Scr_PhysicsExplosionCylinder(float* Origin, float OuterRadius, float InnerRadius, float Magnitude){
Scr_AddFloat(Magnitude);
Scr_AddFloat(InnerRadius);
Scr_AddFloat(OuterRadius);
Scr_AddVector(Origin);
Scr_SetParameters(4);
((void(*)())&ParseAddr(0x273770))();
//If it doesn't work, try ((void(*)(int))&ParseAddr(0x273770))(ClientID << 16);
Scr_ClearOutParams();
}


GScr_SetMiniMap:

    void GScr_SetMiniMap(const char* Material, UpperLeftX, UpperLeftY, LowerRightX, LowerRightY){
Scr_AddFloat(LowerRightY);
Scr_AddFloat(LowerRightX);
Scr_AddFloat(UpperLeftY);
Scr_AddFloat(UpperLeftX);
Scr_AddString(Material);
Scr_SetParameters(5);
Scr_ClearOutParams();
}

___________________________Random functions___________________________

VectorScale:

    float* VectorScale(float* Angle, int Scale){
float Result[] = { Angle[0]* Scale, Angle[1]* Scale, Angle[2]* Scale };
return Result;
}


AnglesToForward:

    #define AngleVectors(Angle, Forward, Right, Up) ((void(*)(const float*, float*, float*, float*))&ParseAddr(0x38020Cool Man (aka Tustin))(Angle, Forward, Right, Up)

float* AnglesToForward(const float* Angle){
float Forward[3];
AngleVectors(Angle, Forward, 0, 0);
return Forward;//If this doesn't work, return Angle;
}



GetEye: //Equivalent to GetTagOrigin("tag_eye")

    #define G_GetPlayerViewOrigin(PS, Origin) ((void(*)(int, float*))&ParseAddr(0x231884))(PS, Origin)

float* GetEye(unsigned int ClientID){
float Org[3];
G_GetPlayerViewOrigin(G_Client(ClientID), Org);
return Org;
}


GetCursorPos:

    

#define G_LocationalTrace(Trace, Start, End, PassEnt, ContentMask, PriorityMap) ((void(*)(trace_t*, const float*, const float*, int, int, char*))&ParseAddr(0x250FA4))(Trace, Start, End, PassEnt, ContentMask, PriorityMap)
#define Trace_GetEntityHitId(Trace) ((ushort(*)(trace_t*))&ParseAddr(0x2A9750))(Trace)

struct BulletTraceType{
short entnum;
float Pos[3];
};

struct trace_t{//Xx jAmes t xX
float fraction;
byte Buffer[0x28];
};

void BulletTrace(BulletTraceType* Type, float* Start, float* End, unsigned int ClientID){//Xx jAmes t xX
trace_t trace;
G_LocationalTrace(&trace, Start, End, ClientID, 0x80A831, 0);
for(unsigned char i = 0; i < 3; i++) Type->Pos[i] = (((End[i]-Start[i]) * trace.fraction) + Start[i]);
short Entity = Trace_GetEntityHitId(&trace) & 0xFFFF;
if(Entity < 0x7FE) Type->entnum= Entity;
}

float* GetCursorPos(unsigned int ClientID){
BulletTraceType Type;
BulletTrace(&Type, GetEye(), VectorScale(AnglesToForward((float*)(G_Client(ClientID) + 0x184), 100000), ClientID);
return Type.Pos;
}


___________________________Hooks that you can use___________________________

VM_Execute:

Address location - 0x2E6444

    

int VM_ExecuteStub(){
__asm("li %r3, 0x4");
}

int VM_Execute(){
//Do stuff here
return VM_ExecuteStub();
}
What you can use this for: A loop? Calling Scr_Adds?


Scr_Notify:

Address location - 0x28B73C

    

int Scr_NotifyStub(){
__asm("li %r3, 0x5");
}
#define SL_ConvertToString(StringValue) ((const char*(*)(unsigned short))&ParseAddr(0x2D894C))(StringValue)
#define iClient *(short*)Entity

void Scr_Notify(int Entity, short StringValue, unsigned int Paramcount){
/*
if(!strcmp(SL_ConvertToString(StringValue), "weapon_fired")) MagicBullet(iClient, GetEye(), GetCursorPos());
*/
return Scr_NotifyStub(Entity, StringValue, Paramcount);
}

What you can use this for: Calling Scr_Adds | Waitill. Only use this if you're having crashing problems with VM_Notify



I'll update this more when I find more functions.


the Scr_ClearOutParams address is incorrect, but the same process is done within each Scr_Add function meaning you don't even need to call ClearOutParams, if you try to call Scr_ClearOutParams you are gunna freeze so I suggest removing it from any function you are using it in :p
Last edited by Shark ; 03-27-2015 at 07:31 AM.

The following 2 users say thank you to Shark for this useful post:

01cedricv2, TheGreenPlanet
04-06-2015, 07:58 PM #41
cool!
10-02-2015, 03:43 PM #42
Nice post mate
10-04-2015, 12:10 PM #43
TotalModzHD
Bounty hunter
where's the definition for VariableValue in Scr_ClearOutParams? sorry if i'm just being dumb :P
01-23-2017, 12:17 PM #44
kaser
Do a barrel roll!
Nice postKryptus
03-19-2018, 07:57 PM #45
seumJC
Save Point
Can you do an example for PlayerCMD_Suicide and does anyone have GetEntity function please

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo