Raised This Month: $ Target: $400
 0% 

Maximum of global strings?


Post New Thread Reply   
 
Thread Tools Display Modes
dutchmeat
Senior Member
Join Date: Sep 2006
Old 05-03-2007 , 08:55   Re: Maximum of global strings?
Reply With Quote #11

No, multiple sounds...
I have to read out a file which includes soundpaths.
I use those soundpaths for emitsound, but I do need a delay, so that's why I needed the set_task to function2.
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 05-03-2007 , 09:40   Re: Maximum of global strings?
Reply With Quote #12

So each player can have 0 to x sounds? And you want to pass to the task, the player and which of that player's sounds?
__________________
Brad is offline
dutchmeat
Senior Member
Join Date: Sep 2006
Old 05-03-2007 , 09:50   Re: Maximum of global strings?
Reply With Quote #13

Well, it's pretty simple...

the player get's one command, test for example...

'test' is referring to function1 which retrieves string from a file...
those strings are split in two, one called the soundpath, and the other is the time.

There can be multiple soundpaths in one file, so that's why I need the 'number' variable aswell.
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 05-03-2007 , 11:34   Re: Maximum of global strings?
Reply With Quote #14

You're not making sense to me.
__________________
Brad is offline
dutchmeat
Senior Member
Join Date: Sep 2006
Old 05-03-2007 , 11:36   Re: Maximum of global strings?
Reply With Quote #15

Well, can you give me an example of how to create and set a global multidimensional array ?
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 05-03-2007 , 12:27   Re: Maximum of global strings?
Reply With Quote #16

Code:
new array[32][32]
?
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 05-03-2007 , 18:03   Re: Maximum of global strings?
Reply With Quote #17

Something tells me he wants to make another "saysound" plugin...
Anyway...
PHP Code:
new one[33]            // 1D array
new two[33][33]            // 2D array
new three[33][33][33]        // 3D array
new four[33][33][33][33]    // ILLEGAL IN PAWN (MAX IS 3D) 
_Master_ is offline
Old 05-04-2007, 04:55
dutchmeat
This message has been deleted by dutchmeat. Reason: double post
dutchmeat
Senior Member
Join Date: Sep 2006
Old 05-04-2007 , 05:02   Re: Maximum of global strings?
Reply With Quote #18

I've now used a 3d variable, and I get the same thing again.

Code:
new soundcommand[33][10][64] function1(id){ new num new command[64] new params[2] params[0] = id   //do some file reading while loop and get the var 'command' //it gets two file paths   if (!equali(soundcommand[id][num],"")) num++   //copy 'command' into the soundcommand[id][num][] ? copy(soundcommand[id][num], 63, command)   //test the variable we just have set for(new x = 0; x < 10; x++){ console_print(id,"TESTVAR[%d] '%s'",x,soundcommand[id][x]) }   /* output:   TESTVAR[0] 'vegetassj4/ssj4trans.wav' TESTVAR[1] 'gokussj4/ssj4trans.wav' TESTVAR[2] '' TESTVAR[3] '' TESTVAR[4] '' TESTVAR[5] '' TESTVAR[6] '' TESTVAR[7] '' TESTVAR[8] '' TESTVAR[9] '' */   set_task(2.0,function2,1111+id,params)   }   function2(params[]){ new id = params[0]   //test the soundcommand variable again: for(new x = 0; x < 10; x++){ console_print(id,"TESTVAR[%d] '%s'",x,soundcommand[id][x]) }   /*output:   TESTVAR[0] '' TESTVAR[1] '' TESTVAR[2] '' TESTVAR[3] '' TESTVAR[4] '' TESTVAR[5] '' TESTVAR[6] '' TESTVAR[7] '' TESTVAR[8] '' TESTVAR[9] '' */ }
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.

Last edited by dutchmeat; 05-04-2007 at 05:07.
dutchmeat is offline
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 05-04-2007 , 10:29   Re: Maximum of global strings?
Reply With Quote #19

Hope this helps, I use this technique in ATAC 3 RC2+ for punishment naming scheme.

Requires FakeMeta:
Code:
function1(id) {     new params[2]     new string[33]     formatex(string, 32, "DEBUG")     params[0] = id     params[1] = engfunc(EngFunc_AllocString, string) // String Encoder     set_task(3.0, "function2", 1111+id, params, 2) } function2(params[]) {     new id = params[0], iStr = params[1]     new string[33]     global_get(glb_pStringBase, iStr, string, 32) // String Decoder     console_print(id, string) }
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd

Last edited by Orangutanz; 05-04-2007 at 10:32.
Orangutanz is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 05-04-2007 , 11:43   Re: Maximum of global strings?
Reply With Quote #20

Oh monkey...

While your way is awesome and everyone should use it, you just jumped like 143 levels above where he is right now.

Nothing wrong that per se. I just laughed so I wanted to share it.
__________________
Brad 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 06:35.


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