AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Vaulting to integrate between plugins? (https://forums.alliedmods.net/showthread.php?t=11032)

lunarwolfx 03-07-2005 22:29

Vaulting to integrate between plugins?
 
I was thinking the other day as I was messing around with vaulting. When you load data from a vault, you're basically drawing info. from a file right?

So that would mean, multiple plugins can load the same data from a vault, thus integrating between one another.

Since I'm suspended from my pc, I was wondering if anyone with experience may input me on this idea.

I was also wondering if it is possible to get whether a player is touching a wall or not, since a wall isn't an entity(most of the time), is there another way to do this?

XxAvalanchexX 03-07-2005 22:30

Re: Vaulting to integrate between plugins?
 
Quote:

Originally Posted by lunarwolfx
I was thinking the other day as I was messing around with vaulting. When you load data from a vault, you're basically drawing info. from a file right?

So that would mean, multiple plugins can load the same data from a vault, thus integrating between one another.

That is correct.

lunarwolfx 03-07-2005 22:36

YAY, thanks for confirming that for me, now I can come up with some more fun ideas.

Twilight Suzuka 03-08-2005 01:33

Of course, the fact vault lags like hell might dampen you a bit.

And there is a whole SLEW of commands and such used for integrating plugins together. vault really isn thtat useful for it.

lunarwolfx 03-09-2005 00:17

any chance you may point them out? I want an efficient way to share arrays between plugins.

Twilight Suzuka 03-09-2005 00:39

try writing to files, transfering it directly through conc cmds, mysql will work, cvault would help, maybe even array module.

cvault: Might actually be faster then normal vault now

Code:
stock set_cvaultdata(file[],key[],data[]){     new currline[192],free[128]     new line = cvaultdata_exists(file,key,free)     format(currline,191,"%s %s",key,data)     write_file(file,currline,line)     return line; } stock get_cvaultdata(file[],key[],data[]){     new line = cvaultdata_exists(file,key,data)     return line; } stock remove_cvaultdata(file[],key[]){     new data[128]     new line = cvaultdata_exists(file,key,data)     write_file(file,"",line)     return line; } public cvaultdata_exists(file[],key[],data[]){     new currline[192]     new currvalue[128];     new currkey[64];     new line = 0;     new txt;     new free_line = -1;     if( file_exists(file) ) {         while( ( line = read_file(file,line,currline,192,txt ) ) ){             if( !equal( currline,"//", strlen("//") ) && !equal( currline,";",strlen(";") ) ) {                 strtok(currline, currkey, sizeof(currkey), currvalue, sizeof(currvalue),'   ',1);                 if(equal(currkey,key)){                     copy(data,128,currvalue);                     return line;                 }                 else if( equal(currkey,"") ) free_line = line;             }         }     }     else write_file(file, "// **** Cvault V1.117 Storage Method ****", 0);     return free_line; }

All in all, vault isnt the way to go.

XxAvalanchexX 03-09-2005 15:11

Also, the callfunc_* functions can be used to call functions in one plugin from another, if you need to do that.


All times are GMT -4. The time now is 14:01.

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