• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

Custom heal command release

Unholyzz

Enthusiast
Hey there EmuDevs.
I've just made a little script it's a custom command, and I hope that this can help out some of the new people out there.
I've added in a security check to see what rank you are if your gonna use this as a VIP command, otherwise you can just delete it.

Description : Custom command, so when you type .heal it set your health and mana to it's max and checks if you're in combat, or in a BG, or in a arena, or is dead. And the script checks if your a player who uses mana.

Tested : Yes, I've tested it out, and it works just fine as of the date 03-03-2015. BG and Arena checks hasen't been tested, but should work.

Screenshot : B2G4AdV.jpg

Source : http://pastebin.com/nHNDLs7J

And of course, you need to edit the RBAC.h file, and the rbac_permissons and rbac_linked_permissons table.
You could add it to some VIP ranks, so only VIP's can use that command, or you could add more commands and so on.
 
Last edited:

FoxGaming

Exalted Member
Nice release, might want to add in a combat check unless this is GM only command then of course it doesn't matter anyway.
 

Unholyzz

Enthusiast
Yeah, combat check would be good. I just totally forgot that.
Otherwise it would be unfair and undying pvp.
 

Rochet2

Moderator / Eluna Dev
Could add arena & bg checks as well : )
What about classes that dont use mana?

Also make sure it doesnt screw the player up when they are dead and use the command.
I remember being able to become invincible by killing myself, setting my health to something and then hacking a little so I could move again. (dying rooted me)
It is possible this allows the same.



... nothing .. is simple..
Nothing.
 
Last edited:

Unholyzz

Enthusiast
Could add arena & bg checks as well : )
What about classes that dont use mana?

Also make sure it doesnt screw the player up when they are dead and use the command.
I remember being able to become invincible by killing myself, setting my health to something and then hacking a little so I could move again. (dying rooted me)
It is possible this allows the same.



... nothing .. is simple..
Nothing.
I've added all that you said, and it should be working. I haven't tested the BG and Arena checks, but the rest is working now. Thanks for telling me what I could add.
 

Rochet2

Moderator / Eluna Dev
Just a suggestion:
You should try proper identation.
If you use visual studio, it has a built in formatting to help you.
With formatting we can quickly see that reading the code might be difficult for others:
http://prntscr.com/6ccjx0

Even though the code is fine, it is hard to read since all the IF statements are nested in the else blocks.
Also on the last else block you have not encased the whole block inside the braces, which is a possible error, but doesnt matter in the current code.
After removing the "else" keywords and by formatting the code properly again the code looks a lot more readable for me personally at least.
There is also smaller chance of error when you can see that everything goes correctly: http://prntscr.com/6ccmpk

I see you used SendAreaTriggerMessage with red color. You can send a red error message looking notification to player with plr->GetSession()->SendNotification.
Just incase you didnt know.
 

Tommy

Founder
If this is a release, why was it in the support section? Moved to release section.

Thanks for sharing.
 

Unholyzz

Enthusiast
Just a suggestion:
You should try proper identation.
If you use visual studio, it has a built in formatting to help you.
With formatting we can quickly see that reading the code might be difficult for others:
http://prntscr.com/6ccjx0


Even though the code is fine, it is hard to read since all the IF statements are nested in the else blocks.
Also on the last else block you have not encased the whole block inside the braces, which is a possible error, but doesnt matter in the current code.
After removing the "else" keywords and by formatting the code properly again the code looks a lot more readable for me personally at least.
There is also smaller chance of error when you can see that everything goes correctly: http://prntscr.com/6ccmpk

I see you used SendAreaTriggerMessage with red color. You can send a red error message looking notification to player with plr->GetSession()->SendNotification.
Just incase you didnt know.
Cleaned the code up, and used SendNotification.
 
Top