Raised This Month: $ Target: $400
 0% 

unviseral admin weapon plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Girthesniper
Senior Member
Join Date: Mar 2004
Location: Maryland
Old 05-09-2004 , 13:29   unviseral admin weapon plugin
Reply With Quote #1

I want to make all my admin_weapon plugins into one plugin. I wana do it sortof like this, if mod = {cstrike} use the line below, if mod = {svencoop} use the line below etc etc. can someone help me out?
__________________
BANNED
Girthesniper is offline
Send a message via AIM to Girthesniper Send a message via MSN to Girthesniper
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 05-09-2004 , 15:39  
Reply With Quote #2

try using get_modname native to get the modname and then equali to test which mod is running...
__________________
hello, i am pm
PM is offline
Girthesniper
Senior Member
Join Date: Mar 2004
Location: Maryland
Old 05-09-2004 , 15:43  
Reply With Quote #3

Quote:
Originally Posted by PM
try using get_modname native to get the modname and then equali to test which mod is running...
could i get a code example?
__________________
BANNED
Girthesniper is offline
Send a message via AIM to Girthesniper Send a message via MSN to Girthesniper
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 05-09-2004 , 15:53  
Reply With Quote #4

oh well xD

Code:
#define MOD_UNSUPPORTED 0 #define MOD_CSTRIKE 1 #define MOD_SVENCOOP 2 new g_Mod; is_cstrike() {    return (g_Mod == MOD_CSTRIKE) ? 1 : 0; } is_svencoop() {    return (g_Mod == MOD_SVENCOOP) ? 1 : 0; } supported_mod() {    return (g_Mod != MOD_UNSUPPORTED) ? 1 : 0; } public plugin_init() {    // stuff...    new modname[32];    get_modname(modname, 31);    if (equali(modname, "cstrike") || equali(modname, "czero"))       g_Mod = MOD_CSTRIKE;    else if (equali(modname, "svencoop")       g_Mod = MOD_SVENCOOP;    else    {       g_Mod = MOD_UNSUPPORTED;       log_amx("This plugin only runs on cstrike or svencoop.");    }    // stuff } public sumthing() {    if (!supported_mod())       return PLUGIN_HANDLED;    if (is_cstrike())    {       // cstrike specific stuff    } }

could work; not compiled, not tested
__________________
hello, i am pm
PM is offline
Girthesniper
Senior Member
Join Date: Mar 2004
Location: Maryland
Old 05-09-2004 , 15:59  
Reply With Quote #5

did you write that up in like 5 seconds? if you did, thats amazing!
__________________
BANNED
Girthesniper is offline
Send a message via AIM to Girthesniper Send a message via MSN to Girthesniper
Ingram
Veteran Member
Join Date: May 2004
Old 05-09-2004 , 16:08  
Reply With Quote #6

Girthesniper i thought u didn't understand the plugins, if not then how do u plan to do this?
Ingram is offline
Girthesniper
Senior Member
Join Date: Mar 2004
Location: Maryland
Old 05-09-2004 , 16:10  
Reply With Quote #7

Quote:
Originally Posted by JJkiller
Girthesniper i thought u didn't understand the plugins, if not then how do u plan to do this?
by using Sniper Beamers Admin Weapons II plugin that i converted. I'm gonna try to just slap a buch of code together and pray that it works
__________________
BANNED
Girthesniper is offline
Send a message via AIM to Girthesniper Send a message via MSN to Girthesniper
QwertyAccess
Veteran Member
Join Date: Feb 2004
Location: Enjiru Layer
Old 05-09-2004 , 16:11  
Reply With Quote #8

looks fine to me but i wouldnt do that would be a waste, loading up all that extra stuff.
__________________
QwertyAccess is offline
Ingram
Veteran Member
Join Date: May 2004
Old 05-09-2004 , 16:15  
Reply With Quote #9

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??)
Ingram is offline
Girthesniper
Senior Member
Join Date: Mar 2004
Location: Maryland
Old 05-09-2004 , 16:16  
Reply With Quote #10

and of course, it doesnt work . I really need to lear SMALL, but I cant.
__________________
BANNED
Girthesniper is offline
Send a message via AIM to Girthesniper Send a message via MSN to Girthesniper
Reply


Thread Tools
Display Modes

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 15:16.


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