[Plugin] Shoebill 1.1 - SA-MP Java Development Kit

Can you show me your implementation of your commands, please?

If you don't use the commandManager from shoebill-common, then you have to use

event.setProcessed()

when your command was handled correctly
Reply

I use the commandManager. It worked before the last update. I didn't change anything in my code (in cmds part)
Reply

also clearAnimations isn't working for me
Reply

I tried the command manager in my project, and it's working fine. I downloaded all the artifacts from server and native from updater. Maybe you have some old version of shoebill-common, runtime or plugin? Please use the provided update-shoebill.bat/sh file and download newest plugin / launcher. I will take a look at clearAnimations later, please post your code here. Maybe you have some samp related bug in there.
Reply

Код:
eventManagerNode.registerHandler(PlayerTextEvent.class, HandlerPriority.BOTTOM, (e) ->
{
...
                player.applyAnimation("PED", "IDLE_chat", 4.1f, 1, 1, 1, 1, 1, 1);

                Timer.create(text.length() * 100 + 1000, 1, (factualInterval) ->
                {
                    player.clearAnimations(1);
                }).start();
});
Reply

I see your problem. If you create a Timer in a function, it will be destroyed by GC even before it has been executed.
You need to make a global variable and then assign it, so it won't be destroyed by Garbage Collector.
Reply

I used this construction in another places and it works well. I tested my code with println() messages in console and a timer works right
Reply

This is a bug in samp I think -> https://github.com/Y-Less/sa-mp-fixes/issues/4

You can use this to cancel the animation:

player.clearAnimations(1);
player.applyAnimation("CARRY", "crry_prtial", 1.0f, 0, 0, 0, 0, 0, 0);
Reply

Thank you! Bun now I have another problem.. In IDEA I can't resolve shoebill-common. I checked pom.xml, but everything is ok. Is the problem in my side?
Reply

I pushed a update, you can add this repo to your repositories:

<repository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</repository>

then you should received it now
Reply

ok, thanks, I got it!
Reply

I can't fix "Unknown command" messages, so here is my cmds handler:

Код:
		eventManagerNode.registerHandler(PlayerCommandEvent.class, HandlerPriority.MONITOR, (e) ->
		{
			Player player = e.getPlayer();
			PlayerData playerData = playerLifecycleHolder.getObject(player, PlayerData.class);

			if(!playerData.isAllowedCmds())
			{
				e.setProcessed();
			}
		});
		
		eventManagerNode.registerHandler(PlayerCommandEvent.class, HandlerPriority.BOTTOM, (e) ->
		{
			Player player = e.getPlayer();
			player.sendMessage(Color.RED, "Неизвестная команда. Введите /help для помощи.");
			e.setProcessed();
		});
I'm also using commangManager and in differrent handlers add smth like that: commandManager.registerCommands(new AdminCommands(rootEventManager, playerLifecycleHolder));

I updated all, that I can
Reply

At first, this is how to implement a custom check before the command is executed (e.g. for a admin level check):

Код:
class AdminCommands {
    private HashMap<String, Integer> adminLevels;

    public AdminCommands() {
        adminLevels = new WeakHashMap<>();
        adminLevels.put("kick", 2);
    }

    @BeforeCheck
    public boolean beforeCheck(Player p, String cmd, String params) {
        if(!adminLevels.containsKey(cmd))
            return false;
        //Get player data
        if(playerData.getAdminLevel() >= adminLevels.get(cmd)) return true;  //Return true = command is allowed to execute
        //Maybe write some message that he's not allowed:
        p.sendMessage(Color.GRAY, "You are not allowed to execute command /" + cmd);        
        return false; // return false, command is not allowed to execute
    }

    @Command
    public boolean kick(Player player, Player target) {....}
}
Do you use the provided amx files in your server.cfg?
Reply

Quote:
Originally Posted by mk124
Посмотреть сообщение
Do you use the provided amx files in your server.cfg?
in full server package there are no any amx files (connects with shoebill) in server.cfg and in folders or I'm not right?
Reply

great
Reply

@kapilb: Thank you
@SetupDLL: There should be a filter script and a gamemode, your server.cfg should contain this:

gamemode0 bare 1
filterscripts base
Reply

I can't remove them? (I removed fs and changed gm to a blank gm)
And will the repo.gtaun.net work?
Reply

no, if you remove them, you have to use some other pawn gamemode which includes all callbacks or use a fully working one.
Reply

Can I delete repo.gtaun.net? It is not available
Reply

oh, sorry, now it works)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)