AlliedModders

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

DarlD 10-19-2005 22:29

Loose identation
 
I keep getting this error when i try to compile.
Code:

/home/users/amxmodx/tmp3/phpYGOtpE.sma(32) : warning 217: loose indentation
/home/users/amxmodx/tmp3/phpYGOtpE.sma(40) : warning 217: loose indentation
/home/users/amxmodx/tmp3/phpYGOtpE.sma(47) : warning 217: loose indentation
/home/users/amxmodx/tmp3/phpYGOtpE.sma(55) : warning 217: loose indentation
/home/users/amxmodx/tmp3/phpYGOtpE.sma(68) : warning 217: loose indentation
/home/users/amxmodx/tmp3/phpYGOtpE.sma(70) : error 001: expected token: "}", but found "-end of file-"

1 Error.
Could not locate output file /home/groups/amxmodx/public_html/websc3/phpYGOtpE.amx (compile failed).

here is the full plugin code
Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <cstrike> #define PLUGIN "Model Rank" #define VERSION "1.0" #define AUTHOR "Author" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_cvar("amx_modelrank", "1")     register_event("ResetHUD", "resetModel", "b")     } public plugin_precache() {         precache_model("models/player/Meta-Skin/leet_t.mdl")         precache_model("models/player/Meta-Skin/leet_ct.mdl")         precache_model("models/player/Meta-Skin/killer_t.mdl")         precache_model("models/player/Meta-Skin/killer_ct.mdl")         precache_model("models/player/Meta-Skin/pro_t.mdl")         precache_model("models/player/Meta-Skin/pro_ct.mdl")         precache_model("models/player/Meta-Skin/newb_t.mdl")         precache_model("models/player/Meta-Skin/newb_ct.mdl")             return PLUGIN_CONTINUE } public resetModel(id, level, cid) {     new frags = get_user_frags(id)     new death = get_user_deaths(id)          if (frags < 19 && death < 9 ) {         new CsTeams:userTeam = cs_get_user_team(id)                 if (userTeam == CS_TEAM_T) {                         cs_set_user_model(id, "newb_t")         }                 else if(userTeam == CS_TEAM_CT) {                         cs_set_user_model(id, "newb_ct")         }      if (frags > 19 && death < 9) {         if (userTeam == CS_TEAM_T) {             cs_set_user_model(id, "killer_t")         }         else if(userTeam == CS_TEAM_CT) {             cs_set_user_model(id, "killer_ct")         }      if (frags > 39 && death < 19) {         if (userTeam == CS_TEAM_T) {             cs_set_user_model(id, "pro_t")         }         else if(userTeam == CS_TEAM_CT) {             cs_set_user_model(id, "pro_ct")                     }      if (frags > 59 && death < 29) {         if (userTeam == CS_TEAM_T){             cs_set_user_model(id, "leet_t")         }         else if(userTeam == CS_TEAM_CT) {             cs_set_user_model(id, "leet_ct")         }         else             cs_reset_user_model(id)         }     }         return PLUGIN_HANDLED } }

v3x 10-19-2005 22:33

Try using the indenter tool in AMXX Studio ( Ctrl+I )

Hawk552 10-19-2005 22:34

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <cstrike> #define PLUGIN "Model Rank" #define VERSION "1.0" #define AUTHOR "Author" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_cvar("amx_modelrank", "1")     register_event("ResetHUD", "resetModel", "b")     } public plugin_precache() {     precache_model("models/player/Meta-Skin/leet_t.mdl")     precache_model("models/player/Meta-Skin/leet_ct.mdl")     precache_model("models/player/Meta-Skin/killer_t.mdl")     precache_model("models/player/Meta-Skin/killer_ct.mdl")     precache_model("models/player/Meta-Skin/pro_t.mdl")     precache_model("models/player/Meta-Skin/pro_ct.mdl")     precache_model("models/player/Meta-Skin/newb_t.mdl")     precache_model("models/player/Meta-Skin/newb_ct.mdl")         return PLUGIN_CONTINUE } public resetModel(id, level, cid) {     new frags = get_user_frags(id)     new death = get_user_deaths(id)     if (frags < 19 && death < 9 )     {         new CsTeams:userTeam = cs_get_user_team(id)         if (userTeam == CS_TEAM_T)         {             cs_set_user_model(id, "newb_t")         }         else if(userTeam == CS_TEAM_CT)         {             cs_set_user_model(id, "newb_ct")         }         if (frags > 19 && death < 9)         {             if (userTeam == CS_TEAM_T)             {                 cs_set_user_model(id, "killer_t")             }             else if(userTeam == CS_TEAM_CT)             {                 cs_set_user_model(id, "killer_ct")             }             if (frags > 39 && death < 19)             {                 if (userTeam == CS_TEAM_T)                 {                     cs_set_user_model(id, "pro_t")                 }                 else if(userTeam == CS_TEAM_CT)                 {                     cs_set_user_model(id, "pro_ct")                                     }                 if (frags > 59 && death < 29)                 {                     if (userTeam == CS_TEAM_T)                     {                         cs_set_user_model(id, "leet_t")                     }                     else if(userTeam == CS_TEAM_CT)                     {                         cs_set_user_model(id, "leet_ct")                     }                     else                     cs_reset_user_model(id)                     }                             }         }     }       return 0 }

DarlD 10-19-2005 22:35

woha nice. fixed it!

im still getting an error on my plugin though

Code:

/home/users/amxmodx/tmp3/phpVqKQKs.sma(70) : error 001: expected token: "}", but found "-end of file-"

Hawk552 10-19-2005 22:36

...use mine?

DarlD 10-19-2005 22:37

yours works yes but i dont see what you changed therefore, i cannot learn how to fix this problem in the future...

Hawk552 10-19-2005 22:38

Added a } at the end, and moved the return PLUGIN_HANDLED down a bit, as well as changing it to PLUGIN_CONTINUE (0) for better form.

DarlD 10-19-2005 22:48

thanks

XxAvalanchexX 10-19-2005 23:00

Quote:

Originally Posted by v3x
Try using the indenter tool in AMXX Studio ( Ctrl+I )

http://www.avalanche.epherion.com/indenter/

;-)

It does discrimate against certain coding styles, though, I suppose.

Brad 10-19-2005 23:27

Quote:

Originally Posted by Hawk552
as well as changing it to PLUGIN_CONTINUE (0) for better form.

You shouldn't use magic numbers. Instead of 0, you should use the PLUGIN_CONTINUE constant.


All times are GMT -4. The time now is 23:36.

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