Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Will this break anything except include my CMAKE_JS_INC libraries in all subprojects?
    This is the subproject I am trying to include these new CMake libs
    Muhamed Krlić
    @l0oky
    Anyways this project is my humble attempt to make a wrapper for Node.js. Feel free to share your thoughts about it :D
    Dima Octavian
    @WopsS
    Hello, is this chat active? :D
    Tim Potze
    @ikkentim
    sort of
    Dima Octavian
    @WopsS
    Great :)
    How are you?
    Tim Potze
    @ikkentim
    alright
    Dima Octavian
    @WopsS
    :+1:
    Dima Octavian
    @WopsS
    Can somebody tell me if there is a clean way to call Streamer callbacks in C++, right now I to with with OnPublicCall
    PLUGIN_EXPORT bool PLUGIN_CALL OnPublicCall(AMX *amx, const char *name, cell *params, cell *retval) 
    {
        auto Name = std::string(name);
    
        if (Name.compare("OnPlayerSelectDynamicObject") == 0) // or strcmp.
        {
            OnPlayerSelectDynamicObject(params[1], params[2], params[3], amx_ctof(params[4]), amx_ctof(params[5]), amx_ctof(params[6]));
        }
        else if (Name.compare("OnPlayerEditDynamicObject") == 0)
        {
            OnPlayerEditDynamicObject(params[1], params[2], params[3], amx_ctof(params[4]), amx_ctof(params[5]), amx_ctof(params[6]), amx_ctof(params[7]), amx_ctof(params[8]), amx_ctof(params[9]));
        }
    
        return true;
    }
    Tim Potze
    @ikkentim
    Do you mean call or let be called?
    Dima Octavian
    @WopsS
    Let be called, ops.
    Tim Potze
    @ikkentim
    There is a way, hang on
    Dima Octavian
    @WopsS
    Ok :)
    Tim Potze
    @ikkentim

    Could you try:

    SAMPGDK_CALLBACK_EXPORT bool SAMPGDK_CALLBACK_CALL OnPlayerSelectDynamicObject (the parameters)
    {
        return true;
    }

    And adding the callback to the export file (if you are on windows)

    I currently have no access to a samp server/windows so you’d have to try that out
    Dima Octavian
    @WopsS
    Thanks, I will try it :)
    It works, thank you. I tried with PLUGIN_EXPORT and PLUGIN_CALL. Thank you again!
    Tim Potze
    @ikkentim
    Np
    Dima Octavian
    @WopsS
    Ah, I'm an idiot ... I forget to comment what I write in OnPublicCall, after that it doesn't work. I remember I tried that (with SAMPGDK_CALLBACK, SAMPGDK_CALLBACK_EXPORT and SAMPGDK_CALLBACK_CALL, that's why I was a little bit surprised).
    What I did:
    SAMPGDK_CALLBACK(bool, OnPlayerSelectDynamicObject(int playerid, int objectid, int modelid, float x, float y, float z));
    
    
    SAMPGDK_CALLBACK_EXPORT bool SAMPGDK_CALLBACK_CALL OnPlayerSelectDynamicObject(int playerid, int objectid, int modelid, float x, float y, float z)
    {
        sampgdk::logprintf("OnPlayerSelectDynamicObject: %i | %i | %i | %f | %f | %f", playerid, objectid, modelid, x, y, z);
    
        return true;
    }
    Dima Octavian
    @WopsS
    That's strange, in streamer plugin it will find the public OnPlayerSelectDynamicObject and push the parameters and execute it, but it won't call it in the plugin.
    Tim Potze
    @ikkentim
    Either returning false or true (can't remember) in on public call prevents further calls of the callback. Make sure that isn't stopping it
    Dima Octavian
    @WopsS
    I already tried with return false;, that's really odd, anyway thank you for the reponses
    Tim Potze
    @ikkentim
    I think false is actually the one that blocks further calls... I'll check when home
    Dima Octavian
    @WopsS
    Ok, thank you :)
    Tim Potze
    @ikkentim
    Yes, you need to return true, quote from docs “Returns true if the callback is allowed to execute” http://zeex.github.io/sampgdk/doc/html/group__interop.html#ga9957c2761fb2016db71c9d8a3b42cb75
    Dima Octavian
    @WopsS
    Ok thank you. But if I do the code above, it doesn't work. I can compare them at OnPublicCall and them call it manually, but I think there may be a cleaner way to do it
    Raefaldhi Amartya Junior
    @raefaldhia
    Hello, can someone help me?, when i was compiling my project through Mingw, i received error Can't figure computer byte order, what does it mean? i tried to build shared object ( Linux ) in my windows computer using MinGW.
    Raefaldhi Amartya Junior
    @raefaldhia
    And in cygwin happened too
    Marvin Haschker
    @123marvin123
    Is it possible to hook all native function calls just like OnPublicCall ?
    samphunter
    @samphunter
    Hi, sorry if this is a bit off-topic but I don't know, where else to ask. Is it possible to call public functions by their address?
    I would like to do something similar to what Y_Less did in y_hooks for my command processor (delete publics asociated with commands from the lookup table to speed up other lookups)
    Dima Octavian
    @WopsS
    @samphunter I don't know how Y_Less did, but what functions do you want to call?
    samphunter
    @samphunter
    @WopsS Just normal publics in amx scripts. But I want to call them by address, not name or index. As I said, I want to delete them from the public lookup table and Amx_Execute only takes id.
    Oleg
    @5LICK
    Hello, i have question about sampgdk
    can i use c++ containers like a list's, map's, multimap's with samgdk?
    Tim Potze
    @ikkentim
    You can use any/all c++ language features
    Oleg
    @5LICK
    Hello @ikkentim :) Its cool, i will try samgdk too :)
    Oleg
    @5LICK
    I compiled test helloworld plugin for linux, and when i started the server with my .so plugin i got error - Segmentation fault (core dumped)
    Whats wrong?
    Tim Potze
    @ikkentim
    Oleg
    @5LICK
    ok, thanks
    Starting program: /home/getright/gdk/hw/helloworld.so 
    
    Program received signal SIGSEGV, Segmentation fault.
    x00000001 in ?? ()
    thats all what i have
    Oleg
    @5LICK
    i found this issue about this problem - Zeex/sampgdk#169
    but i dont know, it is solution?
    Tim Potze
    @ikkentim
    There is a solution i n the pull request
    Oleg
    @5LICK
    I solved problem, i used sampgdk-amalgamation 4.4.0 and recompiled my plugin
    Kriptex1337
    @Kriptex1337
    tutorial from github is for linux machines?
    Zeex
    @Zeex
    it's for both Linux and WIndows