Post: Ghosts 1.16 Scr_GetBool
10-11-2018, 11:15 PM #1
microlol
Save Point
(adsbygoogle = window.adsbygoogle || []).push({}); Could someone send me Scr_GetBool
10-12-2018, 02:44 AM #2
Originally posted by microlol View Post
Could someone send me Scr_GetBool


You must login or register to view this content.
its all in this thread Smile
10-12-2018, 06:29 PM #3
microlol
Save Point
Originally posted by KAYLEB
You must login or register to view this content.
its all in this thread Smile


scr_getbool isnt there thats why i am asking for it
10-14-2018, 01:08 PM #4
SyGnUs
Give a F*** About Your Lifestyle
Originally posted by microlol View Post
Could someone send me Scr_GetBool


There is no such function, only these for variable types in script functions:

    
Scr_GetFloat(uint)
Scr_GetIString(uint)
Scr_GetInt(uint)
Scr_GetString(uint)
Scr_GetVector(uint,float * const)


For bool you can just use GetInt/AddInt.
10-14-2018, 01:20 PM #5
microlol
Save Point
i ended up figuring out it isnt so i decided to use Scr_GetInt but cant seem to call it correctly
10-14-2018, 01:27 PM #6
SyGnUs
Give a F*** About Your Lifestyle
Originally posted by microlol View Post
i ended up figuring out it isnt so i decided to use Scr_GetInt but cant seem to call it correctly


Guessing you're using this for an SPRX? If so you don't use gets, that is only for getting parameters from GScr functions called in GSC scripts so not useful unless you are working with GSC Scripts directly.

Anyway, you pass it the index of the parameter you want and it fetches it from the script stack. So unless you are making functions for GSC Scripts to use, don't use them.
10-14-2018, 01:46 PM #7
microlol
Save Point
Yes i'm using this for an SPRX. I want to see when a player is switching weapon using PlayerCMD_isSwitchingWeapon but i think my Scr_GetInt isnt correct

int(*Scr_GetInt)(int index) = (int(*)(int))Scr_GetInt_t;

void PlayerCMD_isSwitchingWeapon(int clientNum, int isSwitchingWeapon)
{
scr_entref_t entref = { clientNum, 0 };
int PlayerCMD_isSwitchingWeapon_t[2] ={ 0x2356CC, TOC };

((void(*)(scr_entref_t))PlayerCMD_isSwitchingWeapon_t)(entref);

Scr_SetNumParam(1);
Scr_GetInt(isSwitchingWeapon);

Scr_ClearOutParams();
}
10-14-2018, 02:11 PM #8
SyGnUs
Give a F*** About Your Lifestyle
Originally posted by microlol View Post
Yes i'm using this for an SPRX. I want to see when a player is switching weapon using PlayerCMD_isSwitchingWeapon but i think my Scr_GetInt isnt correct

int(*Scr_GetInt)(int index) = (int(*)(int))Scr_GetInt_t;

void PlayerCMD_isSwitchingWeapon(int clientNum, int isSwitchingWeapon)
{
scr_entref_t entref = { clientNum, 0 };
int PlayerCMD_isSwitchingWeapon_t[2] ={ 0x2356CC, TOC };

((void(*)(scr_entref_t))PlayerCMD_isSwitchingWeapon_t)(entref);

Scr_SetNumParam(1);
Scr_GetInt(isSwitchingWeapon);

Scr_ClearOutParams();
}


You can't do it like that, are you hooking the PlayerCMD_isSwitchingWeapon? Even then that wouldn't be right. Not sure if you can even get the returns from GSC functions as they don't return anything themselves, they pass there returns using Scr_Add functions.

For a function like that, you are better off recreating it. IsSwitchingWeapon pretty much works like this, just implement it:
    
bool PlayerCMD_isSwitchingWeapon()
{
if (gclient_s + 0x2BC <= 4 || gclient_s + 0x2D8 - 1 <= 4 )
return true;
else
return false
}
Last edited by SyGnUs ; 10-14-2018 at 02:55 PM.
10-15-2018, 03:11 PM #9
SyGnUs
Give a F*** About Your Lifestyle
Originally posted by microlol View Post
Yes i'm using this for an SPRX. I want to see when a player is switching weapon using PlayerCMD_isSwitchingWeapon but i think my Scr_GetInt isnt correct

int(*Scr_GetInt)(int index) = (int(*)(int))Scr_GetInt_t;

void PlayerCMD_isSwitchingWeapon(int clientNum, int isSwitchingWeapon)
{
scr_entref_t entref = { clientNum, 0 };
int PlayerCMD_isSwitchingWeapon_t[2] ={ 0x2356CC, TOC };

((void(*)(scr_entref_t))PlayerCMD_isSwitchingWeapon_t)(entref);

Scr_SetNumParam(1);
Scr_GetInt(isSwitchingWeapon);

Scr_ClearOutParams();
}


Also, you can actually get returns from functions you call like this one. What you want to do is get the return value from a structure called VariableValue, here it is for Ghosts:

    
To get the return should be something like this - return = VariableValue->u.intValue;

struct VariableStackBuffer
{
const char *pos;
unsigned __int16 size;
unsigned __int16 bufLen;
unsigned __int16 localId;
char time;
char buf[1];
};

/* 3663 */
union VariableUnion
{
int intValue;
unsigned int uintValue;
float floatValue;
unsigned int stringValue;
const float *vectorValue;
const char *codePosValue;
unsigned int pointerValue;
VariableStackBuffer *stackValue;
unsigned int entityOffset;
};

/* 3664 */
struct __declspec(align(Cool Man (aka Tustin)) VariableValue
{
VariableUnion u;
int type;
};


If you really want to look into check out CShark from MW3 by Shark - You must login or register to view this content.

That has everything you need to get the returns from GSC functions.
08-18-2019, 07:19 PM #10
Hello, will anyone Have the offsets of SV_SendServerCommandMsg? thank you

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo