Raised This Month: $ Target: $400
 0% 

no arrays or too many subscripts


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 04-09-2006 , 02:13   no arrays or too many subscripts
Reply With Quote #1

well...
this is my first time coding and now i need help
Code:
public  weaponChange(id) {     if (get_cvar_num("amx_claws"))         (get_user_flags(id)) {         {             new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)             if (wpnid == CSW_KNIFE) {                 entity_set_string(id, EV_SZ_viewmodel, "claws.mdl")             }         }         new CsTeams:userTeam = cs_get_user_team(id)         if (userTeam == CS_TEAM_T) {                        cs_set_user_model(id, "claws")         }                               else {                                  cs_reset_user_model(id)                 }                           }
when i try to compile it
it gives me 2 error messages
first one is on the 3rd line and it says that it has no arrays or too many subscripts
the 2nd error is on like 4 about loose indentation
thxs in advance
__________________
It's a mystery.
Mini_Midget is offline
capndurk
Senior Member
Join Date: Feb 2006
Old 04-09-2006 , 02:55   Re: no arrays or too many subscripts
Reply With Quote #2

Code:
public  weaponChange(id) {     if (get_cvar_num("amx_claws"))         (get_user_flags(id)) {

Your weaponChange(id) function opens with that first bracket, then you have the if statement. However, you just have (get_user_flags(id)) out there alone. Without the white space, it would look like this:

Code:
public  weaponChange(id) {     if (get_cvar_num("amx_claws"))  (get_user_flags(id)) {

So you should either put the { right after the if statement or put (get_user_flags(id)) inside the parentheses.
__________________
I have left these forums because a certain respected member has been acting immaturely lately and has decided that I am not welcome in this community.
capndurk is offline
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 04-09-2006 , 03:09  
Reply With Quote #3

thxs capndurk but now I have one error and its something different
Code:
 public  weaponChange(id) {     if (get_cvar_num("amx_claws"))    (get_user_flags(id)) {
something wrong with the 2nd line
the error says
error 001: expected token: "(", but found "{"

cheers Midget
__________________
It's a mystery.
Mini_Midget is offline
capndurk
Senior Member
Join Date: Feb 2006
Old 04-09-2006 , 03:21  
Reply With Quote #4

Quote:
Originally Posted by Mini_Midget
thxs capndurk but now I have one error and its something different
Code:
 public  weaponChange(id) {     if (get_cvar_num("amx_claws"))    (get_user_flags(id)) {
something wrong with the 2nd line
the error says
error 001: expected token: "(", but found "{"

cheers Midget
No I just meant that get_user_flags(id) is usually used like this:

Code:
(get_user_flags(id)&ADMIN_CHAT)

This statement would return true if the player has access to admin chat. What are you intending to do with this get_user_flags(id)?
__________________
I have left these forums because a certain respected member has been acting immaturely lately and has decided that I am not welcome in this community.
capndurk is offline
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 04-09-2006 , 04:40  
Reply With Quote #5

i'm currently trying to make a model changer
__________________
It's a mystery.
Mini_Midget is offline
capndurk
Senior Member
Join Date: Feb 2006
Old 04-09-2006 , 04:48  
Reply With Quote #6

Quote:
Originally Posted by Mini_Midget
i'm currently trying to make a model changer
So are you trying to limit a player's ability to change models through his access level, or do you want to include that in the if statement at all?
__________________
I have left these forums because a certain respected member has been acting immaturely lately and has decided that I am not welcome in this community.
capndurk is offline
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 04-09-2006 , 04:53  
Reply With Quote #7

i'll tell you what im' trying to do
i want a plugin where the plugin changes one side of the team's models such as the knife
i dont really want to change the whole skin
just to note this is for cs and i want to change the terroist knife
__________________
It's a mystery.
Mini_Midget is offline
capndurk
Senior Member
Join Date: Feb 2006
Old 04-09-2006 , 05:09  
Reply With Quote #8

here is the code for the plugin you want, and this should do the trick.

credits: http://ghw-amxx.com/viewtopic.php?t=18
(thanks v3x!)

Code:
#include <amxmodx> #include <engine> #include <cstrike> public plugin_init() {     register_plugin("TerroristKnife" , "1.0" , "Mini Midget");     register_event("CurWeapon" , "set_models" , "be" , "1=1"); } public plugin_precache() {     precache_model("models/claws.mdl"); } public set_models(id) {     if(!is_user_alive(id))     {         return PLUGIN_CONTINUE;     }     new CsTeams:team = cs_get_user_team(id);     if(team != CS_TEAM_T)     {         return PLUGIN_CONTINUE;     }     new weapid = read_data(2);     switch(weapid)     {         case CSW_KNIFE:         {             entity_set_string(id, EV_SZ_weaponmodel, "models/claws.mdl");         }     }     return PLUGIN_CONTINUE; }

if it doesn't work, you might have to change the directory to something other than "models/claws.mdl"
__________________
I have left these forums because a certain respected member has been acting immaturely lately and has decided that I am not welcome in this community.
capndurk is offline
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 04-09-2006 , 05:17  
Reply With Quote #9

sweet as
thxs for your time capn
and here's a +Karma
now time to study
__________________
It's a mystery.
Mini_Midget is offline
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 04-09-2006 , 08:31  
Reply With Quote #10

hmm
your last post with the script doesn't work for some reason...
the model isn't showing up but it compiles fine...

[EDIT]
i have a screen shot of what is happening
Attached Images
File Type: jpg lol.jpg (133.0 KB, 176 views)
__________________
It's a mystery.
Mini_Midget 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:42.


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