Raised This Month: $12 Target: $400
 3% 

How to pass multi data by using CreateTimer() function?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
_COLOURFUL
Member
Join Date: May 2017
Location: Hong Kong
Old 08-07-2017 , 05:31   How to pass multi data by using CreateTimer() function?
Reply With Quote #1

PHP Code:
public Action:cmdsay(clientargs)
{
    
decl String:arg1[200];
    
    
GetCmdArg(1arg1sizeof(arg1));
    
    for(new 
0;sizeof(Words);i++)
    {
        if(!
StrEqual(Words[i][0], "") && !StrEqual(Words[i][1], ""))
        {
            if(
StrContains(arg1Words[i][0], false) != -1)
            {
                
CreateTimer(0.5ChatClientclient);
            } else continue;
        }else continue;
    }
    
    return 
Plugin_Continue;
}

public 
Action:ChatClient(Handle:timerany:data)
{
    
PrintToChatAll("test");

I want CreateTimer pass more data such as args and arg1 but how?
__________________
Love Dodgeball
_COLOURFUL is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 08-07-2017 , 05:35   Re: How to pass multi data by using CreateTimer() function?
Reply With Quote #2

Create a datapack: https://sm.alliedmods.net/new-api/datapack/DataPack
Fill the datapack with data you want to pass through, pass in datapack then read data back on other end.

More info: https://wiki.alliedmods.net/Timers_(...ng)#Data_Packs
hmmmmm is offline
_COLOURFUL
Member
Join Date: May 2017
Location: Hong Kong
Old 08-07-2017 , 05:40   Re: How to pass multi data by using CreateTimer() function?
Reply With Quote #3

Holy shit, You're my god <333
__________________
Love Dodgeball
_COLOURFUL is offline
_COLOURFUL
Member
Join Date: May 2017
Location: Hong Kong
Old 08-07-2017 , 05:54   Re: How to pass multi data by using CreateTimer() function?
Reply With Quote #4

But I have 2 integer such as "i" and "client" so how to include those in 1 datapack? :O
__________________
Love Dodgeball
_COLOURFUL is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 08-07-2017 , 06:24   Re: How to pass multi data by using CreateTimer() function?
Reply With Quote #5

Call WriteCell twice.

The order you put data in is the same order it comes out.
__________________
Neuro Toxin is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:16.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode