Sign in to follow this  
FasdAR

[С #] Native functions do not work.

Recommended Posts

 

Commands and commands should indicate that a function should handle a native function. in conditions falls.

 [Command("movecam", "use /movecam [isPlayer]", GreedyArg = true)]
        public void CMD_MoveCam(Client player, String isPlayer)
        {
            NAPI.Chat.SendChatMessageToPlayer(player, "MEss: "+ isPlayer);

            if (isPlayer == "down")
            {
                NAPI.Native.SendNativeToPlayer(player, Hash.IS_PLAYER_SWITCH_IN_PROGRESS, player.Handle);
                NAPI.Chat.SendChatMessageToPlayer(player, "down_s");
            }
            else if (isPlayer == "up")
            {
                NAPI.Native.SendNativeToPlayer(player, Hash._SWITCH_OUT_PLAYER, player.Handle);
                NAPI.Chat.SendChatMessageToPlayer(player, "up_s");
            }
            else if (isPlayer == "sd")
            {
                NAPI.Native.SendNativeToPlayer(player, Hash.START_PLAYER_SWITCH, player.Handle);
                NAPI.Chat.SendChatMessageToPlayer(player, "sd_s");
            }
            else if (isPlayer == "ammo")
            {
                int ammoCount = NAPI.Native.FetchNativeFromPlayer<int>(player, Hash.GET_AMMO_IN_PED_WEAPON, player, WeaponHash.Wrench);
                NAPI.Chat.SendChatMessageToPlayer(player, "LOL " + ammoCount);
            }
            else if (isPlayer == "wa")
            {
                NAPI.Chat.SendChatMessageToPlayer(player, "LOL ");
                NAPI.Native.SendNativeToPlayer(player, Hash.SET_PED_HELMET, player, true);
            }
        }

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.