The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add Function Help
Author Message
Van Glan Bloom
Journeyman
*

Posts: 104
Likes Given: 2
Likes Received: 3 in 3 posts
Joined: Jun 2013
Reputation: 0



Post: #1
Add Function Help
Hi guys,

I'm trying to add a function to all the players participating in an event, but something is going wrong. The Event start but the function is not added.

This is my script :


Code:
[FUNCTION HUNGERGAMES_start]
IF (<VAR.HUNGERGAMES_PLAYERS> > 1)
    SRC.EVENT_HUNGER_GAMES_DM // This function should be added
    SERV.ALLCLIENTS SYSMESSAGE @09c1 [Hunger Games]: The Event has begun! Event Gate is now closed.
...
....

This is the Function

Code:
[FUNCTION EVENT_HUNGER_GAMES_DM]
if !(<src.tag0.events>==e_event_hungergames)
    src.sysmessage @09c1 You have 30 minutes for the Deathmach!
        serv.newitem event_hunger_games_dm_memory
            serv.newitem event_hunger_games_dm_timer
        src.act.equip
    endif
return 1

The Timer and Memory

Code:
[ITEMDEF EVENT_HUNGER_GAMES_DM_memory]
ID=i_memory
TYPE=t_eq_script
NAME=Event Hunger Games DM Memory

on=@create
attr=04

ON=@equip
timer=60

on=@timer
IF (<CONT>)
    IF (<MORE1>)
        CONT.MESSAGE=<EVAL <MORE1>>
        MORE1=<MORE1> +- 1
        TIMER=1
        RETURN 1
    ENDIF
cont.go 6116,1234,1
remove
return 1

[ITEMDEF EVENT_HUNGER_GAMES_DM_TIMER]
ID=i_memory
TYPE=t_eq_script
NAME=Event Hunger Games DM Timer

on=@create
attr=04
more=9

ON=@equip
timer=1

on=@timer
IF ( <CONT> )
    IF ( <MORE1> )
            MORE1=<MORE1>-1
            TIMER=1
            RETURN 1
        ELSE
        REMOVE
    ENDIF
ENDIF
RETURN 1

Someone help me
(This post was last modified: 10-08-2014 07:50 AM by Van Glan Bloom.)
10-08-2014 07:49 AM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #2
RE: Add Function Help
Code:
[FUNCTION HUNGERGAMES_start]
IF (<dVAR0.HUNGERGAMES_PLAYERS> > 1)
    SERV.ALLCLIENTS EVENT_HUNGER_GAMES_DM // This function should be added
    SERV.ALLCLIENTS SYSMESSAGE @09c1 [Hunger Games]: The Event has begun! Event Gate is now closed.
...
....

Code:
[FUNCTION EVENT_HUNGER_GAMES_DM]
if !(<src.isevent.e_event_hungergames>)
    src.sysmessage @09c1 You have 30 minutes for the Deathmach!
    serv.newitem event_hunger_games_dm_memory
    src.equip <new>
    serv.newitem event_hunger_games_dm_timer
    src.equip <new>
    src.events +e_event_hungergames
endif
return 1

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
10-08-2014 08:22 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #3
RE: Add Function Help
Quote:
Code:
[FUNCTION EVENT_HUNGER_GAMES_DM]
if !(<src.isevent.e_event_hungergames>)
    src.sysmessage @09c1 You have 30 minutes for the Deathmach!
    serv.newitem event_hunger_games_dm_memory
    src.equip <new>
    serv.newitem event_hunger_games_dm_timer
    src.equip <new>
    src.events +e_event_hungergames
endif
return 1

SRC should be removed from this function because SRC will be the object calling the 'HUNGERGAMES_start' function and checks/functions will be called on it/him instead of on who you want (the client(s)).
Do NOT use SRC in everything unless you know that you need it.
10-08-2014 08:39 PM
Find all posts by this user Like Post Quote this message in a reply
Van Glan Bloom
Journeyman
*

Posts: 104
Likes Given: 2
Likes Received: 3 in 3 posts
Joined: Jun 2013
Reputation: 0



Post: #4
RE: Add Function Help
I have change the script, but not work =/ I have change to the SRC for SERV dont work to
10-08-2014 10:28 PM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #5
RE: Add Function Help
(10-08-2014 08:39 PM)XuN Wrote:  
Quote:
Code:
[FUNCTION EVENT_HUNGER_GAMES_DM]
if !(<src.isevent.e_event_hungergames>)
    src.sysmessage @09c1 You have 30 minutes for the Deathmach!
    serv.newitem event_hunger_games_dm_memory
    src.equip <new>
    serv.newitem event_hunger_games_dm_timer
    src.equip <new>
    src.events +e_event_hungergames
endif
return 1

SRC should be removed from this function because SRC will be the object calling the 'HUNGERGAMES_start' function and checks/functions will be called on it/him instead of on who you want (the client(s)).
Do NOT use SRC in everything unless you know that you need it.
I know, I just replicate what he sent lol

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
10-09-2014 01:08 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)