Raised This Month: $51 Target: $400
 12% 

Showing your legs


Post New Thread Reply   
 
Thread Tools Display Modes
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-28-2015 , 14:03   Re: Showing your legs
Reply With Quote #11

Yes, and this is not too much in my opinion, considering that it's an array(or a big one). About this ideea, it's interesting

Edit: one more thing, you can just remove static ent and work directly with g_feet[id]
__________________

Last edited by HamletEagle; 02-28-2015 at 14:04.
HamletEagle is offline
BB.O.
Member
Join Date: Feb 2011
Old 02-28-2015 , 14:11   Re: Showing your legs
Reply With Quote #12

Quote:
Originally Posted by HamletEagle View Post
Yes, and this is not too much in my opinion, considering that it's an array(or a big one). About this ideea, it's interesting

Edit: one more thing, you can just remove static ent and work directly with g_feet[id]
Thank you for spending so much time for giving such nice opinions to improve my mini plugin!

I hope you guys will like the plugin
__________________
Your face, your fate.
BB.O. is offline
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 02-28-2015 , 16:31   Re: Showing your legs
Reply With Quote #13

Video:

Last edited by Phant; 02-28-2015 at 16:32.
Phant is offline
Send a message via ICQ to Phant
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 02-28-2015 , 17:01   Re: Showing your legs
Reply With Quote #14

I am not really sure about it, but you can do some further check to avoid 'engfunc' native being overused.

PHP Code:
..ClientInfoChangedPost(ID)
{
  static 
Model[32], oldModel[MAXPLAYERS 1][32];

  if (
is_user_connected(ID))
  {
     
get_user_info(ID"model"Modelcharsmax(Model));

     if (!
equali(ModeloldModel[ID])) // I guess 'equali' is the best way. Windows is case insensitive.
     
{
        
UpdateModel(IDModel); // "Model", which means the newer model.
        
oldModel[ID] = Model// I guess this works. If not, use 'copy(oldModel[ID], charsmax(oldModel[]), Model);'.
     
}
  }
}.. 
Anyways, give it a try before upgrading, and you can do this in the next version. It's strongly recommended so the code it's very well and reliable organized even for strongly populated game servers.

Overall, in my opinion, the video is cute and the script seems fine for now.

Oh, and include Video link/ frame into the first message.
__________________

Last edited by claudiuhks; 02-28-2015 at 17:12.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
BB.O.
Member
Join Date: Feb 2011
Old 03-01-2015 , 07:17   Re: Showing your legs
Reply With Quote #15

Quote:
Originally Posted by Phant View Post
Video:
Thank's so much for making a video of demostration!!
The video looks very nice
__________________
Your face, your fate.
BB.O. is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 03-01-2015 , 08:48   Re: Showing your legs
Reply With Quote #16

register_cvar("show_feet_version", "1.0")
If this cvar is only for seeing what servers runs your plugin(when searching by server variables) I would say that you need to use FCVAR_SPONLY flag to block it from being changed by silly admins during the game.

Another thing that I saw is:
PHP Code:
format(modelcharsmax(model), "models/player/%s/%s.mdl"feet_mdlfeet_mdl
formatex is faster than format and should be used when you don't format in the same buffer from where you get data.

In your case formatex can be used without problems. An example where you can't use it is:
PHP Code:
formatex(modelcharsmax(model), "%s/%s"modelsome_other_string
It's wrong, here format should be used. This is because formatex doesn't create a copy of the string(you can see natives code here: https://github.com/alliedmodders/amx...odx/string.cpp)

Also, to prevent the model being applied all the time you should do as claudihks said. The ideea is to check if he has a different model from the one you want to be used. If so, set it again, if no, do nothing, the right model is set already. The only thing is that I will go with copy native(if the arrays have the same dimension it doesn't matter much, but this is what I would choose).
__________________

Last edited by HamletEagle; 03-01-2015 at 08:50.
HamletEagle is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 03-01-2015 , 08:56   Re: Showing your legs
Reply With Quote #17

As a completion,

PHP Code:
FCVAR_EXTDLL FCVAR_UNLOGGED FCVAR_SPONLY FCVAR_SERVER 
are recommended for a Version CVar.

As Hamlet said,

PHP Code:
    static model[128]
    
format(modelcharsmax(model), "models/player/%s/%s.mdl"feet_mdlfeet_mdl
Must be

PHP Code:
    static model[128]
    
formatex(modelcharsmax(model), "models/player/%s/%s.mdl"feet_mdlfeet_mdl
__________________
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 03-01-2015 , 13:32   Re: Showing your legs
Reply With Quote #18

One question: Why are you getting entity's origin in create_feet()?
__________________
Currently offline for study.

Last edited by RateX; 03-01-2015 at 13:32.
RateX is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 03-01-2015 , 14:11   Re: Showing your legs
Reply With Quote #19

He is getting player origin, but I think it's by mistake, origin is never used in other places.
PHP Code:
static Float:origin[3]
pev(idpev_originorigin
This can be removed....
__________________
HamletEagle is offline
BB.O.
Member
Join Date: Feb 2011
Old 03-02-2015 , 05:07   Re: Showing your legs
Reply With Quote #20

Quote:
Originally Posted by HamletEagle View Post
He is getting player origin, but I think it's by mistake, origin is never used in other places.
PHP Code:
static Float:origin[3]
pev(idpev_originorigin
This can be removed....
lol.. I hasn't even noticed that
__________________
Your face, your fate.
BB.O. 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 14:32.


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