Raised This Month: $ Target: $400
 0% 

Set_task problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 12-11-2005 , 06:04   Set_task problem
Reply With Quote #1

I've been trying to get this fixed, if anybody can help me

Code:
public cmdSpawn(id) {     new Float:curOrigin[3]     entity_get_vector(id, EV_VEC_origin, curOrigin)         new data[1]     data[0] = curOrigin         client_print(id, print_chat, "[AMXX] You got 5 seconds to move")     set_task(5.0, "createEnt", 0, data, 1)         return PLUGIN_HANDLED } public createEnt(data[]) {     new Float:origin[3]     origin = data[0]         //some entity creation code, doesnt matter right now     //Just declare the origin to make a good example ^^     entity_set_origin(ent, origin)         //Done :)     return PLUGIN_HANDLED }
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 12-11-2005 , 06:33   Re: Set_task problem
Reply With Quote #2

I know here are is a tag mismatch but it would work.
Code:
public cmdSpawn(id) {     new Float:curOrigin[3]     entity_get_vector(id, EV_VEC_origin, curOrigin)         client_print(id, print_chat, "[AMXX] You got 5 seconds to move")     set_task(5.0, "createEnt", 0, curOrigin, 3)         return PLUGIN_HANDLED } public createEnt(Float:origin[3]) {     //some entity creation code, doesnt matter right now     //Just declare the origin to make a good example ^^     entity_set_origin(ent, origin)         //Done :)     return PLUGIN_HANDLED }
VEN is offline
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 12-11-2005 , 07:26  
Reply With Quote #3

Thnx for the solution

But, is there any way to get around the warning?
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 12-11-2005 , 07:54  
Reply With Quote #4

Use global float and store origin to it and then get it back.
VEN is offline
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 12-11-2005 , 07:58  
Reply With Quote #5

Quote:
Originally Posted by VEN
Use global float and store origin to it and then get it back.
Thats what I was thinking of before I asked it here.

But I don't like 'global var function hacking', it not neat, and it can easy create bugs.

---

But thnx for the answer
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
Basic-Master
Veteran Member
Join Date: Apr 2005
Location: hello pm
Old 12-11-2005 , 08:33  
Reply With Quote #6

Code:
public cmdSpawn(id) {     new Float:curOrigin[3]     entity_get_vector(id, EV_VEC_origin, curOrigin)         new data[3]     FVecIVec(curOrigin, data)         client_print(id, print_chat, "[AMXX] You got 5 seconds to move")     set_task(5.0, "createEnt", 0, data, 3)         return PLUGIN_HANDLED } public createEnt(data[]) {     new Float:origin[3]     origin[0] = float(data[0])     origin[1] = float(data[1])     origin[2] = float(data[2])         //some entity creation code, doesnt matter right now     //Just declare the origin to make a good example ^"     entity_set_origin(ent, origin)         //Done :)     return PLUGIN_HANDLED }

that should work.
Basic-Master is offline
Send a message via ICQ to Basic-Master Send a message via MSN to Basic-Master
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 12-11-2005 , 11:08  
Reply With Quote #7

There is a IVecFVec function too you know.

Code:
public cmdSpawn(id)
{
    new Float:curOrigin[3]
    entity_get_vector(id, EV_VEC_origin, curOrigin)
    
    new data[3]
    FVecIVec(curOrigin, data)
    
    client_print(id, print_chat, "[AMXX] You got 5 seconds to move")
    set_task(5.0, "createEnt", 0, data, 3)
    
    return PLUGIN_HANDLED
}

public createEnt(data[])
{
    new Float:origin[3]
    IVecFVec(data, origin)

    //some entity creation code, doesnt matter right now
    //Just declare the origin to make a good example ^"
    entity_set_origin(ent, origin)
    
    //Done Smile
    return PLUGIN_HANDLED
}
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Basic-Master
Veteran Member
Join Date: Apr 2005
Location: hello pm
Old 12-12-2005 , 08:35  
Reply With Quote #8

I know, but the array size doesn't match. it would return something like:

Error: Array sizes do not match, or destination array is too small on line gaben
Basic-Master is offline
Send a message via ICQ to Basic-Master Send a message via MSN to Basic-Master
Jordan
Veteran Member
Join Date: Aug 2005
Old 12-12-2005 , 16:54  
Reply With Quote #9

Change got to have please thanks
Jordan is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-12-2005 , 21:40  
Reply With Quote #10

Quote:
Originally Posted by Basic-Master
I know, but the array size doesn't match. it would return something like:

Error: Array sizes do not match, or destination array is too small on line gaben
The only problem is that one doesn't have a size specifically stated. Just change this:

Code:
public createEnt(data[])

to this:

Code:
public createEnt(data[3])
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX 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 16:08.


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