THREAD: Ghosts 1.16 Scr_GetBool
  1. 10-11-2018, 11:15 PM
    microlol's Avatar
    microlol
    Save Point
    microlol's Avatar
    microlol
    Save Point
    6
    Posts
    10
    Reputation
    Jul 2017
    NextGenUpdate
    Could someone send me Scr_GetBool
  2. 10-12-2018, 02:44 AM
    18
    Posts
    50
    Reputation
    Oct 2010
    NextGenUpdate
    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
  3. 10-12-2018, 06:29 PM
    microlol's Avatar
    microlol
    Save Point
    microlol's Avatar
    microlol
    Save Point
    6
    Posts
    10
    Reputation
    Jul 2017
    NextGenUpdate
    Originally Posted by KAYLEB View Post
    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
  4. 10-14-2018, 01:08 PM
    SyGnUs's Avatar
    SyGnUs
    Give a F*** About Your Lifestyle
    SyGnUs's Avatar
    SyGnUs
    Give a F*** About Your Lifestyle
    1,184
    Posts
    13,932
    Reputation
    Jan 2012
    NextGenUpdate
    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.
  5. 10-14-2018, 01:20 PM
    microlol's Avatar
    microlol
    Save Point
    microlol's Avatar
    microlol
    Save Point
    6
    Posts
    10
    Reputation
    Jul 2017
    NextGenUpdate
    i ended up figuring out it isnt so i decided to use Scr_GetInt but cant seem to call it correctly
  6. 10-14-2018, 01:27 PM
    SyGnUs's Avatar
    SyGnUs
    Give a F*** About Your Lifestyle
    SyGnUs's Avatar
    SyGnUs
    Give a F*** About Your Lifestyle
    1,184
    Posts
    13,932
    Reputation
    Jan 2012
    NextGenUpdate
    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.
  7. 10-14-2018, 01:46 PM
    microlol's Avatar
    microlol
    Save Point
    microlol's Avatar
    microlol
    Save Point
    6
    Posts
    10
    Reputation
    Jul 2017
    NextGenUpdate
    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();
    }
  8. 10-14-2018, 02:11 PM
    SyGnUs's Avatar
    SyGnUs
    Give a F*** About Your Lifestyle
    SyGnUs's Avatar
    SyGnUs
    Give a F*** About Your Lifestyle
    1,184
    Posts
    13,932
    Reputation
    Jan 2012
    NextGenUpdate
    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.

  9. 10-15-2018, 03:11 PM
    SyGnUs's Avatar
    SyGnUs
    Give a F*** About Your Lifestyle
    SyGnUs's Avatar
    SyGnUs
    Give a F*** About Your Lifestyle
    1,184
    Posts
    13,932
    Reputation
    Jan 2012
    NextGenUpdate
    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.
  10. 08-18-2019, 07:19 PM
    28
    Posts
    50
    Reputation
    Sep 2016
    NextGenUpdate
    Hello, will anyone Have the offsets of SV_SendServerCommandMsg? thank you