AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Combing scripts (https://forums.alliedmods.net/showthread.php?t=47636)

Da_sk8rboy 11-22-2006 19:32

Combing scripts
 
could someone tell me how to combine to of my scripts so there isnt 3 different plugins.

Da_sk8rboy 11-22-2006 19:37

Re: Combing scripts
 
Model_Me_Mod1:

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #define PLUGIN "Model_Me_Mod1" #define VERSION "1.01b" #define AUTHOR "Da_sk8rboy" public plugin_init() {             register_plugin(PLUGIN, VERSION, AUTHOR)         register_concmd("amx_modelme1", "cmd_modelme1",0, "<target>") } public cmd_modelme1(id, level, cid) {         if (!cmd_access(id, level, cid, 2))                 return PLUGIN_HANDLED                 new Arg1[32]         read_argv(1, Arg1, 31)         new player = cmd_target(id, Arg1, 0)         //Flags:         //1 - obey immunity         //2 - allow yourself         //4 - must be alive         //8 - can't be bot                 if (!player)         {                 console_print(id, "[Model_Me_Mod] player %s could not be found or targetted!", Arg1)                 return PLUGIN_HANDLED         }         else         {                 cs_set_user_model(player, "modelme1")         }         return PLUGIN_HANDLED } public plugin_precache() {         precache_model("models/player/modelme1/modelme1.mdl") }

Model_Me_Mod2:

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #define PLUGIN "Model_Me_Mod2" #define VERSION "1.01b" #define AUTHOR "Da_sk8rboy" public plugin_init() {             register_plugin(PLUGIN, VERSION, AUTHOR)         register_concmd("amx_modelme2", "cmd_modelme2",0, "<Target>") } public cmd_modelme2(id, level, cid) {         if (!cmd_access(id, level, cid, 2))                 return PLUGIN_HANDLED                 new Arg1[32]         read_argv(1, Arg1, 31)         new player = cmd_target(id, Arg1, 0)         //Flags:         //1 - obey immunity         //2 - allow yourself         //4 - must be alive         //8 - can't be bot                 if (!player)         {                 console_print(id, "[Model_Me_Mod] player %s could not be found or targetted!", Arg1)                 return PLUGIN_HANDLED         }         else         {                 cs_set_user_model(player, "modelme2")         }         return PLUGIN_HANDLED } public plugin_precache() {         precache_model("models/player/modelme2/modelme2.mdl") }

Model_Me_Mod3:

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #define PLUGIN "Model_Me_Mod3" #define VERSION "1.02b" #define AUTHOR "Da_sk8rboy" public plugin_init() {             register_plugin(PLUGIN, VERSION, AUTHOR)         register_concmd("amx_modelme3", "cmd_modelme3",0, "<target>") } public cmd_modelme1(id, level, cid) {         if (!cmd_access(id, level, cid, 2))                 return PLUGIN_HANDLED                 new Arg1[32]         read_argv(1, Arg1, 31)         new player = cmd_target(id, Arg1, 0)         //Flags:         //1 - obey immunity         //2 - allow yourself         //4 - must be alive         //8 - can't be bot                 if (!player)         {                 console_print(id, "[Model_Me_Mod] player %s could not be found or targetted!", Arg1)                 return PLUGIN_HANDLED         }         else         {                 cs_set_user_model(player, "modelme3")         }         return PLUGIN_HANDLED } public plugin_precache() {         precache_model("models/player/modelme3/modelme3.mdl") }

XxAvalanchexX 11-22-2006 21:50

Re: Combing scripts
 
Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #define PLUGIN "Model_Me_Mod123" #define VERSION "1.01b" #define AUTHOR "Da_sk8rboy" public plugin_init() {             register_plugin(PLUGIN, VERSION, AUTHOR)         register_concmd("amx_modelme", "cmd_modelme",0, "<target> <model num>") } public cmd_modelme1(id, level, cid) {         if (!cmd_access(id, level, cid, 3))                 return PLUGIN_HANDLED                 new Arg1[32], Arg2[3]   read_argv(1, Arg1, 31)         read_argv(1, Arg2, 2) new player = cmd_target(id, Arg1, 0)         //Flags:         //1 - obey immunity         //2 - allow yourself         //4 - must be alive         //8 - can't be bot                 if (!player)         {                 console_print(id, "[Model_Me_Mod] player %s could not be found or targetted!", Arg1)                 return PLUGIN_HANDLED         }         else         {             switch(str_to_num(Arg2)) { case 2: cs_set_user_model(player, "modelme2")       case 3: cs_set_user_model(player, "modelme3")       default: cs_set_user_model(player, "modelme1")         } }         return PLUGIN_HANDLED } public plugin_precache() {         precache_model("models/player/modelme1/modelme1.mdl") precache_model("models/player/modelme2/modelme2.mdl") precache_model("models/player/modelme3/modelme3.mdl") }

Indent next time please. ;)

jim_yang 11-22-2006 21:55

Re: Combing scripts
 
Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #define PLUGIN "Model_Me_Mod1" #define VERSION "1.01b" #define AUTHOR "Da_sk8rboy" public plugin_init() {                     register_plugin(PLUGIN, VERSION, AUTHOR)                 register_concmd("amx_modelme1", "cmd_modelme",0, "<target>")         register_concmd("amx_modelme2", "cmd_modelme",0, "<target>")         register_concmd("amx_modelme3", "cmd_modelme",0, "<target>") } public cmd_modelme(id, level, cid) {                 if (!cmd_access(id, level, cid, 2))                                 return PLUGIN_HANDLED                                 new cmd[13]         read_argv(0, cmd, 12)        //read the command itself                 new Arg1[32]                 read_argv(1, Arg1, 31)                 new player = cmd_target(id, Arg1, 0)                 //Flags:                 //1 - obey immunity                 //2 - allow yourself                 //4 - must be alive                 //8 - can't be bot                                 if (!player)                 {                                 console_print(id, "[Model_Me_Mod] player %s could not be found or targetted!", Arg1)                                 return PLUGIN_HANDLED                 }                 else                 {                 switch(cmd[11])        //check which command is                 {                         case '1':cs_set_user_model(player, "modelme1")                         case '2':cs_set_user_model(player, "modelme2")                         case '3':cs_set_user_model(player, "modelme3")                 }         }                 return PLUGIN_HANDLED } public plugin_precache() {                 precache_model("models/player/modelme1/modelme1.mdl")         precache_model("models/player/modelme1/modelme2.mdl")         precache_model("models/player/modelme1/modelme3.mdl") }
ps: actully these three commands can intergrate in one.
like amx_modelme #whichmodel <target>
i think you can manage it yourself, good luck!

jim_yang 11-22-2006 21:56

Re: Combing scripts
 
god.... beat me, ahhhhhhhhhhhhhh

Da_sk8rboy 11-23-2006 10:54

Re: Combing scripts
 
I love you avalanche. +Karma.
thanks also jim lol.


All times are GMT -4. The time now is 06:55.

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