Raised This Month: $ Target: $400
 0% 

Transfer string arguments in set_task


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 04-04-2009 , 09:59   Transfer string arguments in set_task
Reply With Quote #1

I wanna to execute function restore_targetname( name[1][] ) via set_task

so tryed to do it like this:
PHP Code:
new targetname[1][32]
pev(entpev_targetnametargetname[0],31)

set_task(0.1"restore_targetname"_,targetname1
But I've got compiler error: Array dimensions do not match

Note: I can't use global vars bzc task is in loop and could be executed many times in 0.1second so the var would be rewritten
Any Suggestions?

Last edited by Empowers; 04-04-2009 at 10:24.
Empowers is offline
Send a message via ICQ to Empowers
Old 04-04-2009, 10:04
xPaw
This message has been deleted by xPaw. Reason: wrong.
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 04-04-2009 , 10:11   Re: Transfer string arguments in set_task
Reply With Quote #3

PHP Code:
set_task0.1"restore_targetname"_"szTargetName" ); 
// or this 
set_task0.1"restore_targetname""szTargetName" ); 
O_o I'm sure this 2 would't work for sure, bcz you just transfering string "szTargetName", but not the var szTargetName.

Now gonna try the first one
------------------------------

When using the 1st got server shutdown and error memory can't be "read"

Any suggestions?

Last edited by Empowers; 04-04-2009 at 10:22.
Empowers is offline
Send a message via ICQ to Empowers
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-04-2009 , 10:21   Re: Transfer string arguments in set_task
Reply With Quote #4

try : set_task( 0.1, "restore_targetname", _, szTargetName, 32 );
Arkshine is offline
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 04-04-2009 , 10:30   Re: Transfer string arguments in set_task
Reply With Quote #5

Quote:
Originally Posted by arkshine View Post
try : set_task( 0.1, "restore_targetname", _, szTargetName, 32 );
The same
Server crash

Anyone help plz

Last edited by Empowers; 04-04-2009 at 10:36.
Empowers is offline
Send a message via ICQ to Empowers
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-04-2009 , 11:51   Re: Transfer string arguments in set_task
Reply With Quote #6

Show your whole code. Make sure it crashes because of what I write and nothing else also.
Arkshine is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 04-04-2009 , 11:58   Re: Transfer string arguments in set_task
Reply With Quote #7

Your function is:
PHP Code:
restore_targetnametargetname[32] ) 
or
PHP Code:
restore_targetnametargetname[32], dummy 
right?
SnoW is offline
Send a message via MSN to SnoW
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 04-04-2009 , 12:10   Re: Transfer string arguments in set_task
Reply With Quote #8

snow read his post again.
PHP Code:
restore_targetnamename[1][] ) 
btw try to make it
PHP Code:
restore_targetnamename[] ) 
and really provide code.
__________________
xPaw is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 04-04-2009 , 12:41   Re: Transfer string arguments in set_task
Reply With Quote #9

Quote:
Originally Posted by xPaw View Post
snow read his post again.
PHP Code:
restore_targetnamename[1][] ) 
btw try to make it
PHP Code:
restore_targetnamename[] ) 
I don't need to read it again, I know what code he posted in the thread. Still because a better way was suggested to him(The way I used), I obviously thought that he was testing that one.
SnoW is offline
Send a message via MSN to SnoW
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 04-04-2009 , 12:29   Re: Transfer string arguments in set_task
Reply With Quote #10

I doubt you can pass a two-dimensional array through. Index the first dimension (targetname[0])
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
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 02:17.


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