"Stars / Cops / WANTED LEVEL" from GTA

Discussion in 'Archived: Plugin Requests' started by rawwk, Aug 4, 2013.

  1. Offline

    rawwk

    Hello, I run a GTA Server and it could use something new.

    I was hoping if someone can create "Stars / Cops" from GTA

    Plugin category: Role-Play
    Suggested name: GTA-Wanted
    What I want: Basically, (configurable hopefully) You can choose how many kills (killing other online players) [EX; 10 kills = 1 star, 18 kills = 2 stars, etc.] [EX; 1 star = 4 cops, 2 stars = 12 cop, etc.] [[COPS = Zombies with wooden swords and gold chestplate (or if so configurable)]]
    Ideas for commands: /GTAW KillAll (Kills all the cops on the map) /GTAW Stars (player) (#)
    Ideas for permissions: GTAWBypass, GTAWAdmin, GTAWMember
    When I'd like it by: Possibly, within 1 month

    For any more information please private message me. OR if there is an existing plugin similar to this please post below.
     
  2. Offline

    ToastHelmi

    Sound cool I will see what i can do
     
  3. Offline

    rawwk

    Really? Awesome. I'd be happily to advertise you once we RE-officially open the server ._.
    Anyways, if possible Maybe make the EXP Bar (#) the number of stars you have? Only if possible (or some way to know how many stars you have)

    Thanks.
     
  4. Offline

    snivell

    Sounds like a really good idea. :)
     
  5. Offline

    ToastHelmi

    this ma take a while i have no idear how to custemize the police mobs :D

    http://www22.zippyshare.com/v/17181388/file.html
    here is a early version of it
    To Do
    Show player thier WantedLevel
    Sow other Player the wanted level
    make somethink like [EX; 10 kills = 1 star, 18 kills = 2 stars, etc.] [EX; 1 star = 4 cops, 2 stars = 12 cop, etc.]
    save wantedlevel os shutdown
    and commands

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
  6. Offline

    andrewabosh

    Just an idea, but for displaying the star level, you can use the enderdragon bar and just put some start alt codes :p
     
  7. Offline

    ToastHelmi

    I already played around withh the boss health bar but When I display it it also plays a smoke effect
     
  8. Offline

    RingOfStorms

    What do you mean? The bar doesn't create a smoke effect :?
     
  9. Offline

    ToastHelmi

    Until now I'm using a peace of code which I found in the resources
    I'm not relay familiar with sending packages but it seems it sending a package which displays a boss and after that it sends a package which destroys the entity
     
  10. Offline

    RingOfStorms

    Still don't understand how you see smoke :eek:

    Anyways what i do is I come up with an entity ID, something stupid large so you aren't using one in the game. Like 9087
    Any packet you send with that as the entity ID will be the same thing for the client.

    Packet24MobSpawn is what you use for spawning it in. (I'll call it pack)

    Code:java
    1.  
    2. pack.a = (int) 90087 //Entity ID
    3. pack.b = (int) EntityType.WITHER.getTypeId(); //Mob type ID
    4.  


    Now for the location I do something special to make it as far away from the player but keep it in their view.

    Code:java
    1.  
    2. Location spawn = player.getEyeLocation().clone().add(player.getEyeLocation().clone().getDirection().normalize().multiply(100));
    3. if(spawn.getY() >= spawn.getWorld().getMaxHeight()) { //Make sure it is inside the world
    4. spawn.setY(spawn.getWorld().getMaxHeight()-1);
    5. }else if(spawn.getY() <= 0) {
    6. spawn.setY(1);
    7. }
    8.  
    9. pack.c = (int) Math.floor(spawn.getX() * 32.0D); //loc x
    10. pack.d = (int) Math.floor(spawn.getY() * 32.0D); //loc y
    11. pack.e = (int) Math.floor(spawn.getZ() * 32.0D); //loc z
    12.  


    Now at that point you can send that and it will show up 100 blocks in front of the player. Now I do a little extra reflection and set values to the datawatcher to make it invisible, set the name, and set its hp.

    Code:java
    1.  
    2. DataWatcher w = new DataWatcher();
    3. w.a(0, (Byte) (byte) 0x20); // invi
    4. w.a(6, (Integer) (int) 300*percent); //300 = 100%
    5. w.a(10, "Bomb Timer"); // name
    6.  
    7. try {
    8. Field t = Packet24MobSpawn.class.getDeclaredField("t");
    9. t.setAccessible(true);
    10. t.set(pack, w);
    11. }catch(Exception e) {
    12. //ignore because we just don't care xD jk.. you should probably print this
    13. }
    14.  


    Then after that send the packet :)

    Code:java
    1.  
    2. ((CraftPlayer)player).getHandle().playerConnection.sendPacket(pack);
    3.  


    Also another note, I update this like every tick, sending the destroy packet then re-sending the wither so that it always stays in their view-port. As soon as they look away from it, the wither will not be rendered, including the bar.

    To remove it you can just send Packet29DestroyEntity(90097)

    Edit: Also something nice for datawatcher http://wiki.vg/Entities#Entity
     
    Skye and ToastHelmi like this.
  11. Offline

    ToastHelmi

    Last edited by a moderator: Jun 3, 2016
  12. Offline

    rawwk

    Thank you, I'll be testing it soon!

    Sorry for double-post but.

    I haven't really tested the killing players because my staff are gone for a bit.
    But the only problem I have at the moment is that since "Zombie" are enabled to spawn, where ever it's dark regular zombies spawn in and become the Police Officer. Is there any other plugins to disable Zombie spawns unless command / plugin activated?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
  13. Offline

    Diederikmc

    http://dev.bukkit.org/bukkit-plugins/nonaturalspawns/
     
  14. Online

    timtower Administrator Administrator Moderator

  15. Offline

    ToastHelmi

  16. Offline

    rawwk

    AWESOME! Thank you.
     

Share This Page