|
Yes, you can try this tutorial here:
https://sampforum.blast.hk/showthread.php?tid=508509 |
private PlayerCommandManager commandManager;
eventManager = rootEventManager.createChildNode(); commandManager = new PlayerCommandManager(eventManager); commandManager.installCommandHandler(HandlerPriority.NORMAL); commandManager.registerCommands(new PlayerCommands())
|
Код:
private PlayerCommandManager commandManager; Код:
eventManager = rootEventManager.createChildNode(); commandManager = new PlayerCommandManager(eventManager); commandManager.installCommandHandler(HandlerPriority.NORMAL); commandManager.registerCommands(new PlayerCommands()) |
repositories:
- id: central
url: http://repo1.maven.org/maven2/
- id: gtaun-public-repo
url: http://repo.gtaun.net/content/groups/public
- id: sonatype-oss-snapshots
url: https://oss.sonatype.org/content/repositories/snapshots/
# When to update cache?
# Options: always / daily / interval:[minutes]
cacheUpdatePolicy: always
# If Maven checks for Updates or use old artifacts
offlineMode: false
# Your needed runtimes
runtimes:
- net.gtaun:shoebill-runtime:1.0-SNAPSHOT
# Additional plugins
#plugins:
# - net.gtaun.mk:mk-plugin-manager:1.0-SNAPSHOT
# - net.gtaun.shoebill:example-vehicle-manager-plugin:1.0-SNAPSHOT
# Your gamemode
gamemode: newdimension-0.0.1-SNAPSHOT
# Shoebill foldername
shoebillPath: shoebill
folder:
bootstrap: bootstrap
repository: repository
libraries: libraries
plugins: plugins
gamemodes: gamemodes
# Let dependencymanager try to resolve needed dependencies
resolveDependencies: true
# Allows to override the artifact from maven repo with local file
allowArtifactOverrideIgnoreGroupId: true
# See: http://en.wikipedia.org/wiki/Windows_code_pages#List
serverCodepage: 1252
# Custom maven path
#customRepositoryPath: ''
hoebill-common:1.0-SNAPSHOT

eventManager.registerHandler(PlayerWeaponShotEvent.class, (e) -> {
Player pPlayer = e.getPlayer();
pPlayer.sendMessage(Color.GREEN, "SHOT!!!");
WeaponModel wModel = e.getWeapon();
PlayerInventory playerInventory = Inventories.pInventory.get(pPlayer.getId());
pPlayer.sendMessage(Color.GREEN, "SHOT!!!");
pPlayer.sendMessage(Color.GREEN, "Before: %d", playerInventory.getWeapon(wModel).getAmmo());
if (playerInventory.getWeapon(wModel).getAmmo() <= 0) {
playerInventory.giveWeapon(pPlayer, wModel, 0);
pPlayer.sendMessage(Color.GREEN, "Out of ammo.");
} else {
playerInventory.giveWeapon(pPlayer, wModel, playerInventory.getWeapon(wModel).getAmmo() - 1);
}
pPlayer.sendMessage(Color.GREEN, "After: %d", playerInventory.getWeapon(wModel).getAmmo());
});
|
resources.yml
Код:
repositories:
- id: central
url: http://repo1.maven.org/maven2/
- id: gtaun-public-repo
url: http://repo.gtaun.net/content/groups/public
- id: sonatype-oss-snapshots
url: https://oss.sonatype.org/content/repositories/snapshots/
# When to update cache?
# Options: always / daily / interval:[minutes]
cacheUpdatePolicy: always
# If Maven checks for Updates or use old artifacts
offlineMode: false
# Your needed runtimes
runtimes:
- net.gtaun:shoebill-runtime:1.0-SNAPSHOT
# Additional plugins
#plugins:
# - net.gtaun.mk:mk-plugin-manager:1.0-SNAPSHOT
# - net.gtaun.shoebill:example-vehicle-manager-plugin:1.0-SNAPSHOT
# Your gamemode
gamemode: newdimension-0.0.1-SNAPSHOT
Код:
# Shoebill foldername
shoebillPath: shoebill
folder:
bootstrap: bootstrap
repository: repository
libraries: libraries
plugins: plugins
gamemodes: gamemodes
# Let dependencymanager try to resolve needed dependencies
resolveDependencies: true
# Allows to override the artifact from maven repo with local file
allowArtifactOverrideIgnoreGroupId: true
# See: http://en.wikipedia.org/wiki/Windows_code_pages#List
serverCodepage: 1252
# Custom maven path
#customRepositoryPath: ''
|
runtimes: - net.gtaun:shoebill-runtime:1.0-SNAPSHOT - net.gtaun:shoebill-common:1.0-SNAPSHOT