AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   Showing your legs (https://forums.alliedmods.net/showthread.php?t=259076)

BB.O. 02-28-2015 09:28

Showing your legs
 
1 Attachment(s)
It's just a very simple plugin.
The name of this plugin shows what it does already.

OK. With using this plugin, you can see your legs by looking at your bottom in a first person mode!

The codes might not be so efficient!

Thank you for using this plugin :):):):)

CT:
[IMG]http://s9.************/po4e5jr17/cs3.jpg[/IMG]
[IMG]http://s9.************/ktap79spn/cs4.jpg[/IMG]

TE Leet's:
[IMG]http://s9.************/j07siy7iz/cs5.jpg[/IMG]


Supported custom mods too!
[IMG]http://s9.************/5cx4wzo2j/cs1.jpg[/IMG]
[IMG]http://s9.************/r1w10uqaj/cs2.jpg[/IMG]

[IMG]http://s9.************/8l1ma1acb/cs6.jpg[/IMG]
[IMG]http://s9.************/mijsfc8ez/cs7.jpg[/IMG]

The demonstration:

claudiuhks 02-28-2015 09:34

Re: Showing your legs
 
Why random_float, random values?
Add some comments if possible. You are using some values that I have no idea what they are. All constants must be either Defined or commented with '//' or '/* */'.

The idea seems really nice, if it works. A picture would look great in your first message.

You can also register a CVar [show_feet_version] for people to be able to view on GameTracker which servers are currently using this.

HamletEagle 02-28-2015 09:35

Re: Showing your legs
 
PHP Code:

public zp_user_humanized_post(id)
{
    
set_task(random_float(0.14.0), "update_feet"id)
}

public 
zp_user_infected_post(id)
{
    
set_task(random_float(0.14.0), "update_feet"id)


Why are this zp forwards here ? zombieplague.inc is not included.
Are you sure you are the author of this plugin ?

claudiuhks 02-28-2015 09:37

Re: Showing your legs
 
Quote:

Originally Posted by HamletEagle (Post 2267805)
PHP Code:

public zp_user_humanized_post(id)
{
    
set_task(random_float(0.14.0), "update_feet"id)
}

public 
zp_user_infected_post(id)
{
    
set_task(random_float(0.14.0), "update_feet"id)


Why are this zp forwards here ? zombieplague.inc is not included.
Are you sure you are the author of this plugin ?

Zombie Plague INC must not be included. Zombie Plague will automatically execute all forwards in all plug-ins even if they are not defined (their function prototypes).

Also, notice that strlen() returns a size, not just a number. It is never below zero. Just check it with '== 0' or '< 1'.

BB.O. 02-28-2015 10:16

Re: Showing your legs
 
OK. I think out an another solution. Updated the plugin.

claudiuhks 02-28-2015 10:28

Re: Showing your legs
 
PHP Code:

    static ent
    ent 
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target")) 

You must check if the entity is VALID by using pev_valid.
I am pretty sure you might cache 'info_target' Allocated String ID globally.
Also, add '//' comments explaining the following.

PHP Code:

if (angles[0] > 60.0)
angles[0] = 0.0
xs_vec_mul_scalar
(offset, -32.0offset)
xs_vec_mul_scalar(offset0.15offset)
angles[0] = 30.0 

At least, explain what they are/ how they help so I understand.
You didn't have to remove the Zombie Plague forwards if you wish this plug-in to work with Zombie Plague game mod as well.

BB.O. 02-28-2015 10:36

Re: Showing your legs
 
Quote:

Originally Posted by claudiuhks (Post 2267833)
PHP Code:

    static ent
    ent 
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target")) 

You must check if the entity is VALID by using pev_valid.
I am pretty sure you might cache 'info_target' Allocated String ID globally.
Also, add '//' comments explaining the following.

PHP Code:

if (angles[0] > 60.0)
angles[0] = 0.0
xs_vec_mul_scalar
(offset, -32.0offset)
xs_vec_mul_scalar(offset0.15offset)
angles[0] = 30.0 

At least, explain what they are/ how they help so I understand.
You didn't have to remove the Zombie Plague forwards if you wish this plug-in to work with Zombie Plague game mod as well.

Sorry for that bro.
I just made the plugin after I thought out an idea.
That's why the plugin is a little bit messy.
It's just a fast script.

I will modifidy it later :D:D

HamletEagle 02-28-2015 13:26

Re: Showing your legs
 
  • Don't comment everything, just the lines which need an explanations or are confusing.
    • PHP Code:

      // The only variable :D 

      How this help peoples to understand ? We all know that you only have a global variable. Anyway, your comment is wrong, this is the only global variable, not the only variable.
  • In your create_feet function static is not needed
  • engfunc(EngFunc_AllocString, "info_target") allocating a string every time is not the best ideea. Idk how many times a player will join(how many times you create that ent), but you should cache this in plugin_init, since this is a constant value for the same string.
  • As claudiuhks said, please explain why you used this "random ?" values.

BB.O. 02-28-2015 13:39

Re: Showing your legs
 
Quote:

Originally Posted by HamletEagle (Post 2267941)
  • Don't comment everything, just the lines which need an explanations or are confusing.
    • PHP Code:

      // The only variable :D 

      How this help peoples to understand ? We all know that you only have a global variable. Anyway, your comment is wrong, this is the only global variable, not the only variable.
  • In your create_feet function static is not needed
  • engfunc(EngFunc_AllocString, "info_target") allocating a string every time is not the best ideea. Idk how many times a player will join(how many times you create that ent), but you should cache this in plugin_init, since this is a constant value for the same string.
  • As claudiuhks said, please explain why you used this "random ?" values.


::Updated:::wink:
Deleted the unneeded comment.
Added a constant storing the string allocation of info_target.

But I get confused why the static variable in the create_feet function should be changed to new?
An entity is created every time when a player joins the server.
If static is changed to new, will AMXX not always allocate a new memory for [ent] when each of the players joins the server? :?

BB.O. 02-28-2015 13:45

Re: Showing your legs
 
Quote:

Originally Posted by claudiuhks (Post 2267833)
PHP Code:

    static ent
    ent 
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target")) 

You must check if the entity is VALID by using pev_valid.
I am pretty sure you might cache 'info_target' Allocated String ID globally.
Also, add '//' comments explaining the following.

PHP Code:

if (angles[0] > 60.0)
angles[0] = 0.0
xs_vec_mul_scalar
(offset, -32.0offset)
xs_vec_mul_scalar(offset0.15offset)
angles[0] = 30.0 

At least, explain what they are/ how they help so I understand.
You didn't have to remove the Zombie Plague forwards if you wish this plug-in to work with Zombie Plague game mod as well.

At first, I used fw_PlayerSpawn_Post, a very poor way to do the trick. :(:(
Changing the models in the same time sucks,
and I'm quite sure that it would carry out a SVC_BAD problem if I'm right..

So that's why I used the random method to prevent the SVC_BAD problem :D:D

But it seems it is not needed now for using the new solution


All times are GMT -4. The time now is 04:18.

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