Raised This Month: $ Target: $400
 0% 

[solved]set_task with text parameters and taskid


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Owyn
Veteran Member
Join Date: Nov 2007
Old 06-14-2009 , 14:39   [solved]set_task with text parameters and taskid
Reply With Quote #1

hi, I allways had problems with parameters in set_task
if i pass int it works fine but with string it doesnt compile =\

PHP Code:
public one(id)
{
        new 
text[13]="hello";
        new 
args[2];
        
args[0] = text
        
set_task(4.4"tasktwo"id+644,args,12);
}

public 
tasktwo(taskidparam[2])
{
    new 
id taskid-644;
    
log_amx("param is: %s"param[0])

compiler says: must be assigned to an array about line args[0] = text;
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.

Last edited by Owyn; 06-14-2009 at 14:45.
Owyn is offline
Send a message via ICQ to Owyn
Drak
Veteran Member
Join Date: Jul 2005
Old 06-14-2009 , 14:45   Re: set_task wirh parameters and taskid
Reply With Quote #2

Code:
public one(id) {     new text[6] = "hello";     set_task(4.4, "tasktwo", id+644,text,6) } public tasktwo(id,const Text[6]) {     id -= 644     log_amx("param is: %s",Text) }
I'm not competently sure if "set_task" will return Params & The TaskID.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-14-2009 , 14:46   Re: set_task wirh parameters and taskid
Reply With Quote #3

args[0] = text; are you sure you don't see nothing wrong. You try to save a string without "" in a var which can hold only 2 characters.
__________________
Arkshine is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 06-14-2009 , 14:47   Re: set_task wirh parameters and taskid
Reply With Quote #4

oh i thought it was an array with two values not characters)) thx
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-14-2009 , 14:55   Re: set_task wirh parameters and taskid
Reply With Quote #5

I see many people confused with set_task(); the forum can use a thread dedicated to the function. Hawk552 did make a thread for set_task but doesn't really describe the usage.

Topics I see people having the most confusion on:
  • When task-id's are needed
  • Using task-id without player-id
  • Using Task-id with player id
  • Both of the above with additional data\string(s)
__________________

Last edited by Bugsy; 06-14-2009 at 14:59.
Bugsy is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 06-14-2009 , 15:09   Re: [solved]set_task with text parameters and taskid
Reply With Quote #6

some weird errors =\

Quote:
Invalid player id 152863
PHP Code:
public one(id)
{
        new 
text[13]="hello";
        
set_task(4.4"tasktwo"id+644,text,13);
}

public 
tasktwo(taskid, const text[13])
{
    new 
id taskid-644;
    
client_printidprint_chat"o hello with %s!"text);

</span></span>
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-14-2009 , 15:11   Re: [not solved]set_task with text parameters and taskid
Reply With Quote #7

Let me see the function that calls one()
__________________
Bugsy is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 06-14-2009 , 15:15   Re: [not solved]set_task with text parameters and taskid
Reply With Quote #8

one is called by client_authorized and is a task itself but it works fine and id in it is correct

PHP Code:
public client_authorized(id)
{
    
set_task(2.2,"one",328+id);
}

public 
one(taskid)
{
    new 
id taskid-328;
    new 
text[13]="hello";
  
set_task(4.4"tasktwo"id+644,text,13);

}



public 
tasktwo(taskid, const text[13])
{
    new 
id taskid-644;
    
client_printidprint_chat"o hello with %s!"text);

__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-14-2009 , 15:20   Re: [not solved]set_task with text parameters and taskid
Reply With Quote #9

Params in tasktwo need to be switched

PHP Code:
public client_authorized(id)
{
    
set_task(2.2,"one",328+id);
}

public 
one(taskid)
{
    new 
id taskid-328;
    new 
text[13]="hello";
    
set_task(4.4"tasktwo"id+644,text,13);

}  

public 
tasktwo(const text[13] , taskid )
{
    new 
id taskid-644;
    
client_printidprint_chat"o hello with %s!"text);

__________________

Last edited by Bugsy; 06-14-2009 at 15:22.
Bugsy is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 06-14-2009 , 15:24   Re: [not solved]set_task with text parameters and taskid
Reply With Quote #10

thought so, thx
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
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 14:05.


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