AlliedModders

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

Da_sk8rboy 11-12-2006 18:28

Scripting Help
 
Could anyone help me find the errors. I cannot seem to find them. Any suggestions.

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #define PLUGIN "amx_model" #define VERSION "1.01b" #define AUTHOR "Da_sk8rboy" public plugin_init() {          register_plugin(PLUGIN, VERSION, AUTHOR)      register_concmd("amx_model", "cmd_model", ADMIN_SLAY, "<target>") } public cmd_model(id, level, cid) {      if (!cmd_access(id, level, cid, 3))         return PLUGIN_HANDLED cs_set_user_model(players[i], "lobster")         }                }           }      } else {           new player = cmd_target(id, Arg1, 1)           if (!player)           {                console_print(id, "[Model Mod], player %s could not be found or targetted!", Arg1)                return PLUGIN_HANDLED           } else {              cs_set_user_model(player, "lobster")           }      }        return PLUGIN_HANDLED          } public plugin_precache() {      precache_model("models/player/lobster/lobster.mdl") }

Da_sk8rboy 11-12-2006 18:43

Re: amx_model 1.01b + amx_hp 1.00a Help!
 
I know that the problem is on line 22, just cant figure out what to do with it.

organizedKaoS 11-12-2006 18:56

Re: amx_model 1.01b + amx_hp 1.00a Help!
 
On line 22 the problem is you haven't "defined" players[i].

Your passing invalid id's.

Da_sk8rboy 11-12-2006 19:03

Re: amx_model 1.01b + amx_hp 1.00a Help!
 
How should i define it?

Code:

cs_set_user_model(player,"lobster");

jim_yang 11-12-2006 22:41

Re: Scripting Help
 
Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #define PLUGIN "amx_model" #define VERSION "1.01b" #define AUTHOR "Da_sk8rboy" public plugin_init() {             register_plugin(PLUGIN, VERSION, AUTHOR)         register_concmd("amx_model", "cmd_model", ADMIN_SLAY, "<target>") } public cmd_model(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 Mod] player %s could not be found or targetted!", Arg1)                 return PLUGIN_HANDLED         }         else         {                 cs_set_user_model(player, "lobster")         }         return PLUGIN_HANDLED } public plugin_precache() {         precache_model("models/player/lobster/lobster.mdl") }


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

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