Raised This Month: $ Target: $400
 0% 

model stuff again ><


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 03-15-2006 , 19:18   model stuff again ><
Reply With Quote #1

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "Clothesmod" #define VERSION "1.0" #define AUTHOR "Author" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_srvcmd("item_clothes","item_clothes")     } public plugin_precache() {     precache_model("models/player/collector-civilian/collector-civilian.mdl") } public client_connect(id) {     client_cmd(id,"model collector-civilian") } public client_infochanged(id)     {     new oldmodel[32]     new newmodel[32]         get_user_info(id, "model", newmodel, 31)         if(!equali(newmodel, oldmodel))         {         engclient_cmd(id, "model", oldmodel)         client_print(id,print_chat,"[Clothesmod] You may not change clothes that way.")     }         return PLUGIN_HANDLED }   public item_clothes()     {     new arg[32], arg2[32], id, model     read_argv(1,arg,31)     read_argv(2,arg2,31)        id = str_to_num(arg)     model = str_to_num(arg2)             set_user_info(id,"model",arg2)     client_cmd(id,"model %s",model)     new name[64]     new message[300]     format(message,299,"%s has changed his clothes.",name)     client_print(id,print_chat,"[Clothesmod] You have changed your clothes.")     return PLUGIN_HANDLED }

this is my code and when i use the item it can change the model but also i can use console to change model with i don't want so how do i restrict them from changing from console?
wonsae is offline
Rixorster
Senior Member
Join Date: Jul 2005
Old 03-16-2006 , 01:52  
Reply With Quote #2

Code:
register_clcmd("item_clothes","item_clothes")
__________________
You never know, what will happen the day after tomorrow...

+karma if i helped you!
Rixorster is offline
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 03-21-2006 , 19:43  
Reply With Quote #3

that just made it worse any help?
wonsae is offline
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 03-21-2006 , 20:30  
Reply With Quote #4

Code:
register_clcmd("item_clothes","item_handle") public item_handle(id) {      return PLUGIN_HANDLED }
organizedKaoS is offline
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 03-21-2006 , 21:37  
Reply With Quote #5

Try This.

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "Clothesmod" #define VERSION "1.0" #define AUTHOR "Author" new has_clothes[33] // Does the player have the clothes item on? new new_clothes[33][32] // New Model specified new cur_clothes[33][32] // Clothes Model Stored Here By Items new old_clothes[33][32] // Old model they had new default_model[32] = "collector-civilian" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_srvcmd("item_clothes","item_clothes")   } public plugin_precache() {     precache_model("models/player/collector-civilian/collector-civilian.mdl") } public client_connect(id) {     client_cmd(id,"model %s",default_model) } public client_infochanged(id) {       get_user_info(id,"model",new_clothes[id],31)         if(has_clothes[id] <= 0)     {         client_cmd(id, "model", default_model)         client_print(id,print_chat,"[Clothesmod] You may not change clothes that way.")         return PLUGIN_HANDLED     }     if(!equali(new_clothes[id],cur_clothes[id]))     {         set_user_info(id,"model",cur_clothes[id])         client_print(id,print_chat,"[Clothesmod] You may not change clothes that way.")         return PLUGIN_HANDLED             }         return PLUGIN_HANDLED } public item_clothes()   {     new arg[32], arg2[32], id, model         read_argv(1,arg,31)     read_argv(2,arg2,31)           id = str_to_num(arg)     model = str_to_num(arg2)         if(has_clothes[id] <= 0)     {         get_user_info(id,"model",old_clothes[id],31)             set_user_info(id,"model",arg2)                 format(cur_clothes[id],31,arg2)                 client_cmd(id,"model %s",model)             client_print(id,print_chat,"[Clothesmod] You have changed your clothes.")             new name[32]         get_user_name(id,name,31)         client_print(0,print_chat,"[ClothesMod] %s, has changed his clothes",name)                 has_clothes[id] = 1                 return PLUGIN_HANDLED     }     else     {         client_print(id,print_chat,"[ClothesMod] You've put back on your original uniform.")         engclient_cmd(id, "model", default_model)         has_clothes[id] = 0     }         return PLUGIN_HANDLED }
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 03-21-2006 , 22:47  
Reply With Quote #6

i dont think
Code:
client_cmd(id, "model %s", default_model)
is a proper client cmd action. At least, if you try it in game nothing happens
organizedKaoS is offline
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 03-21-2006 , 23:02  
Reply With Quote #7

should work

try this:

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "Clothesmod" #define VERSION "1.0" #define AUTHOR "Author" new has_clothes[33] // Does the player have the clothes item on? new new_clothes[33][32] // New Model specified new cur_clothes[33][32] // Clothes Model Stored Here By Items new old_clothes[33][32] // Old model they had new default_model[32] = "collector-civilian" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_srvcmd("item_clothes","item_clothes")   } public plugin_precache() {     precache_model("models/player/collector-civilian/collector-civilian.mdl") } public client_connect(id) {     client_cmd(id,"model %s",default_model) } public client_infochanged(id) {       get_user_info(id,"model",new_clothes[id],31)         if(has_clothes[id] <= 0)     {         set_user_info(id,"model",default_model)         client_print(id,print_chat,"[Clothesmod] You may not change clothes that way.")         return PLUGIN_HANDLED     }     if(!equali(new_clothes[id],cur_clothes[id]))     {         set_user_info(id,"model",cur_clothes[id])         client_print(id,print_chat,"[Clothesmod] You may not change clothes that way.")         return PLUGIN_HANDLED             }         return PLUGIN_HANDLED } public item_clothes()   {     new arg[32], arg2[32], id, model         read_argv(1,arg,31)     read_argv(2,arg2,31)           id = str_to_num(arg)     model = str_to_num(arg2)         if(has_clothes[id] <= 0)     {         get_user_info(id,"model",old_clothes[id],31)             set_user_info(id,"model",arg2)                 format(cur_clothes[id],31,arg2)             client_print(id,print_chat,"[Clothesmod] You have changed your clothes.")             new name[32]         get_user_name(id,name,31)         client_print(0,print_chat,"[ClothesMod] %s, has changed his clothes",name)                 has_clothes[id] = 1                 return PLUGIN_HANDLED     }     else     {         client_print(id,print_chat,"[ClothesMod] You've put back on your original uniform.")         set_user_info(id,"model",default_model)         has_clothes[id] = 0     }         return PLUGIN_HANDLED }
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 03-22-2006 , 00:52  
Reply With Quote #8

Quote:
Originally Posted by organizedKaoS
i dont think
Code:
client_cmd(id, "model %s", default_model)
is a proper client cmd action. At least, if you try it in game nothing happens
I revert to previous statement. A client cannot type in console "model gign" and have it do anything, it simply is not a valid hl command, as far as I know. Just use
Quote:
Originally Posted by organizedKaoS
Code:
register_clcmd("item_clothes", "item_handle") public item_handle(id) {      return PLUGIN_HANDLED }
Like I suggested earlier.
organizedKaoS is offline
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 03-22-2006 , 08:58  
Reply With Quote #9

Quote:
Originally Posted by organizedKaoS
Quote:
Originally Posted by organizedKaoS
i dont think
Code:
client_cmd(id, "model %s", default_model)
is a proper client cmd action. At least, if you try it in game nothing happens
I revert to previous statement. A client cannot type in console "model gign" and have it do anything, it simply is not a valid hl command, as far as I know. Just use
Quote:
Originally Posted by organizedKaoS
Code:
register_clcmd("item_clothes", "item_handle") public item_handle(id) {      return PLUGIN_HANDLED }
Like I suggested earlier.
this is for the specialists and model whatever is a command in it
wonsae is offline
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 03-22-2006 , 10:04  
Reply With Quote #10

I see now, you should've said it was for the specialist, instead of having me give advice on a mod I dont play Oh well, I tried to help
organizedKaoS is offline
Reply



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


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