Raised This Month: $ Target: $400
 0% 

Arguments question..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 01-10-2013 , 05:08   Arguments question..
Reply With Quote #1

Hello.
For example, a have this code:

public stage_a() {
new a, b, c
execfunc(a, b, c)
}

public stage_b() {
new a, b, D
execfunc(a, b, D)
}

Help me with true variant (code).. Using arguments: a, b, c OR D

public execfunc(a, b, c, D) {} - compile error
public execfunc(a, b, c:D) {} - compile warning
public execfunc(a, b, c or D) {} ?
__________________
sorry my bad english...

Last edited by alonelive; 01-10-2013 at 05:08.
alonelive is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-10-2013 , 05:14   Re: Arguments question..
Reply With Quote #2

inside public execfunc(<<HERE>>);
it is local variables, and it doesn't matter what names of that.
PHP Code:
public stage_a() {
         new 
bla1bbrasplsr
         execfunc
(bla1bbrasplsr)
}

public 
stage_b() {
         new 
abc
         execfunc
(abc)
}

public 
execfunc(local1,local2,local3) {} 
also you dont send a variable by "name". program send a variable by link or by value
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 01-10-2013 , 05:46   Re: Arguments question..
Reply With Quote #3

Thank you again

public asfd() {

new mapname[32]
get_mapname(mapname, 31)
new Float:OriginT[3];
new Float:OriginCT[3];

OriginT[0] = 40.0;
OriginT[1] = 2030.0;
OriginT[2] = 36.0;

OriginCT[0] = 37.0;
OriginCT[1] = 2042.5;
OriginCT[2] = 82.0;

set_maps(mapname, OriginCT, OriginT)
}


stock set_maps(local1[], local2[], local3[]) {
..asdf
}

I have a tag mismatch error in compiler logs on line " set_maps(mapname, OriginCT, OriginT) "
__________________
sorry my bad english...

Last edited by alonelive; 01-10-2013 at 05:53.
alonelive is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-10-2013 , 06:49   Re: Arguments question..
Reply With Quote #4

try
stock set_maps(local1[],Float:local2[],Float:local3[])
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
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 13:47.


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