Raised This Month: $ Target: $400
 0% 

[Solved] Float Task


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 02-01-2009 , 21:27   [Solved] Float Task
Reply With Quote #1

Well I need to pass a float into a Task
But I get "Warning: Tag mismatch"

PHP Code:
 new Float:origin[3]
 
pev(idpev_originorigin)
 
 
set_task(0.1"mystask"456origin3"b"
PHP Code:
public mystaskFloat:origin[3] )
{
     
//

Thanks
__________________

Last edited by AntiBots; 02-01-2009 at 21:48.
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
jim_yang
Veteran Member
Join Date: Aug 2006
Old 02-01-2009 , 21:31   Re: Float Task
Reply With Quote #2

native set_task(Float:time,const function[],id = 0,const parameter[]="",len = 0,const flags[]="", repeat = 0);parameter is not Float array
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 02-01-2009 , 21:44   Re: Float Task
Reply With Quote #3

Code:
set_task(0.1, "mystask", 456, origin, 3, "b"); public mystask(taskid, Float:Params[]) // taskid = 456 {     new origin[3];         for(new i = 0 ; i < 3 ; i++)     {         origin[i] = Params[i];     } }
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 02-01-2009 , 21:47   Re: Float Task
Reply With Quote #4

PHP Code:
 new buffer[50]
 
formatex(buffer127"%f %f %f"origin[0], origin[1], origin[2])
 
set_task(0.1"sirent_task"456buffer50"b"
PHP Code:
public sirent_task(informacion[])
{
 new 
info1[13], info2[13], info3[13]
 
parse(informacioninfo112info212info312)
 new 
Float:origin[3]
 
origin[0] = str_to_float(info1)
 
origin[1] = str_to_float(info2)
 
origin[2] = str_to_float(info3)
 
 
engfunc(EngFunc_EmitAmbientSound0originsound_sirenVOL_NORMATTN_NORM0PITCH_NORM

Solved
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 02-02-2009 , 09:33   Re: Float Task
Reply With Quote #5

Quote:
Originally Posted by AntiBots View Post
PHP Code:
 new buffer[50]
 
formatex(buffer127"%f %f %f"origin[0], origin[1], origin[2]) 
Solved
Why 127, if buffer's size is 50?
And you must pass the id of the task with it's function.

Also, you should use arkshine's method. I got a little confused with the task's parameters' location.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 02-02-2009 , 10:13   Re: Float Task
Reply With Quote #6

Quote:
Originally Posted by Dores View Post
Why 127, if buffer's size is 50?
And you must pass the id of the task with it's function.

Also, you should use arkshine's method. I got a little confused with the task's parameters' location.
No, you don't have to pass an id. You can simply pass "_" (the default parameter token) or 0.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 02-02-2009 , 10:19   Re: Float Task
Reply With Quote #7

Quote:
Originally Posted by Dores View Post
Why 127, if buffer's size is 50?
Sorry I edit wrong then i copy to here.
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
jim_yang
Veteran Member
Join Date: Aug 2006
Old 02-01-2009 , 21:59   Re: [Solved] Float Task
Reply With Quote #8

Code:
public test2(id)
{
    new origin[3]
    get_user_origin(id, origin)
    set_task(0.1, "test3", id, origin, 3)
    return 1
}
public test3(origin[3], id)
{
    new Float:fo[3]
    IVecFVec(origin, fo)
    client_print(id, print_chat, "%f %f %f", fo[0], fo[1], fo[2])
}
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-02-2009 , 04:51   Re: [Solved] Float Task
Reply With Quote #9

Code:
public test2(id) {     new Float:origin[3]     pev ( id, pev_origin, origin );     set_task(0.1, "test3", id, _:origin, 3) } public test3(Float:origin[3], id) {     client_print(id, print_chat, "%f %f %f", origin[0], origin[1], origin[2]) }

Should work.
Arkshine is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 02-02-2009 , 09:17   Re: [Solved] Float Task
Reply With Quote #10

arkshine's is by far the best method. Use that.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
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 01:40.


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