SphereCommunity
Help room Script need help - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Help room Script need help (/Thread-Help-room-Script-need-help)



Help room Script need help - larmc20 - 05-22-2013 11:19 PM

What Up guys? I'm new in scripting (one week I start Studying in Sphere WIKI) and there is a lack of Knowledge.

I'd like you helping me in a HelpRoom Function Scripting.

My douts are in RED.

The script is working well. When anyone type .helproom it will show a menu. but I wanna put this conditionals to doesn't work in safe area and a delay when the char is alive.



[FUNCTION HelpRoom]
plevel=1
if (<src.region.flags> == region_flag_safe) // How do I do to test if region flag = safe?
src.sysmessage voce nao pode viajar daqui (you cannot travel from here)
return 1
elseif (<SRC.HITS> > 0)
SRC.SYSMESSAGE Voce esta vivo, tera que esperar 1 minuto (You are alive, will have to wait a minut)
wait 60 // How do I do to the char wait 1 minute to travel?
MENU m_helproom
else
menu m_helproom
RETURN 1
ENDIF

[MENU m_helproom]
Help Room

ON=0 Ir para Help Room?
SRC.GO help room

Well, I just noticed that players cannot use .helproom only GM.

I set pleve=1. What's Wrong?


RE: Help room Script need help - darksun84 - 05-22-2013 11:45 PM

For the first question :

Usually flags are represented as "bit" so you have to use the binary operators for checking,removing adding them.
In your case you have to use the bitwise operator & :
PHP Code:
if (<src.region.flags>& region_flag_safe
For more on binary operations : http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8l.doc%2Flanguage%2Fref%2Fbitande.htm

Second question :
There are many way to do that, I think the faster way is to implement it like :
PHP Code:
src.timerf 60,go yourplace 

For the plevel, plevel are set in this way

[PLEVEL 1]
command
command
command

I think you have to restart sphere after adding one or more command


RE: Help room Script need help - larmc20 - 05-22-2013 11:51 PM

(05-22-2013 11:45 PM)darksun84 Wrote:  For the first question :

Usually flags are represented as "bit" so you have to use the binary operators for checking,removing adding them.
In your case you have to use the bitwise operator & :
PHP Code:
if (<src.region.flags>& region_flag_safe
For more on binary operations : http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8l.doc%2Flanguage%2Fref%2Fbitande.htm

Second question :
There are many way to do that, I think the faster way is to implement it like :
PHP Code:
src.timerf 60,go yourplace 

Thanks mate

and why PLEVEL=1 is not working? Still only gms using this


RE: Help room Script need help - darksun84 - 05-22-2013 11:53 PM

[PLEVEL 1]
command
command
command

I think you have to restart sphere after adding one or more command