AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   unviseral admin weapon plugin (https://forums.alliedmods.net/showthread.php?t=1815)

Girthesniper 05-09-2004 16:18

Quote:

Originally Posted by JJkiller
Girthesniper good luck

Quote:

looks fine to me but i wouldnt do that would be a waste, loading up all that extra stuff.
thats a good point, y not just have a seperate plugin for each mod, its not like the same amx folder is used. (or r u trying to load svencoop weapons in cs??)

It is seprate. if you look in the plugins fourm, i have one for, CS/CS:CZ, Svencoop, Hostile Intent, and Natural-Selection 3.0. But there is like way to many, and if you read the Hostile Intent one, Kingpin sayd "why dont you just combine all you're plugin into one?

Ingram 05-09-2004 16:32

but whats the point? do u use the same amx folder for every mod?

kingpin 05-09-2004 16:35

Quote:

Originally Posted by kingpin
why not combine all these ports of the same plugin into one thread so everyone can see them at one time and download the correct one for their mod?

I meant post all the seperate ones into one thread so ppl have one reference point, they go into one thread and get the plugin they need for there mod.

AssKicR 05-09-2004 17:17

Quote:

Originally Posted by PM
oh well xD

Code:
CODE

could work; not compiled, not tested :)

well here is an easier way

Code:
#define MOD_UNSUPPORTED 0 #define MOD_CSTRIKE 1 #define MOD_SVENCOOP 2 supported_mod() {    return (g_Mod != MOD_UNSUPPORTED) ? 1 : 0; } public plugin_init() {    // stuff...    if (is_running("cstrike") || is_running("czero")) g_Mod = MOD_CSTRIKE;    else if (is_running("svencoop") g_Mod = MOD_SVENCOOP;    else {       g_Mod = MOD_UNSUPPORTED;       log_amx("This plugin doesn't support this mod.");    }    // stuff } public sumthing() {    if (!supported_mod()) return PLUGIN_HANDLED;    if (MOD_CSTRIKE) {       //CS-STUFF    }    if (MOD_SVENCOOP) {       //SVEN-STUFF    } }

PM 05-10-2004 08:55

Code:
#define MOD_UNSUPPORTED 0 #define MOD_CSTRIKE 1 #define MOD_SVENCOOP 2
okay

Code:
   if (MOD_CSTRIKE) {       //CS-STUFF    }    if (MOD_SVENCOOP) {       //SVEN-STUFF    }
xD?
expands to:
Code:
   if (1) {       //CS-STUFF    }    if (2) {       //SVEN-STUFF    }
so both will be executed...

You could maybe use:
Code:
#define ISMOD_CSTRIKE() (g_Mod == MOD_CSTRIKE) #define ISMOD_SVENCOOP() (g_Mod == MOD_SVENCOOP)
and then use
if (ISMOD_CSTRIKE()) ...
to get rid of some call / proc instructions but i don't understand how your (=AssKicR's) code should work...[/small]

AssKicR 05-10-2004 09:51

Quote:

Originally Posted by amxmisc.inc
Code:
stock is_running(const arg[]) {   new mod_name[32]   get_modname(mod_name,31)   return equal(mod_name,arg) }


QwertyAccess 05-10-2004 11:38

mmm asskicr's code or PM's hard to choose http://www.nsarmslab.com/qwerty/smileys/tongue.gif

PM 05-10-2004 12:09

well, i also thought about using is_running, but then decided to compare the string manually so get_modname doesn't have to be called more times.
Also, i understand that is_running part, but, like i said, i dont understand the code in your public sumthing() function :)

Girthesniper 05-10-2004 16:02

I'm using PM's, because he wrote AMXx, so he probley knows what hes doing :D


All times are GMT -4. The time now is 15:16.

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