AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   uq_armorspeed (https://forums.alliedmods.net/showthread.php?t=142083)

borjomi 11-01-2010 07:32

uq_armorspeed
 
1 Attachment(s)
Speed in armor by BorJomi
v1.3


Description:
  • This simple plugin shows player speed instead of armor
Player cmd:
  • say /uqspeed- enabled/disabled showing speed
Requirements:
  • Hamsandwich module
changelog
Code:

v1.2 - some small fixes
v1.3 - cs_set_user_armor replaced by pev_armorvalue


ConnorMcLeod 11-01-2010 09:15

Re: uq_armorspeed
 
Just set armorvalue in UpdateClientData pre forward, games will send message for you ;)

xPaw 11-01-2010 09:28

Re: uq_armorspeed
 
- g_userconnect is useless here, and its never set to false btw
- velocity[2]-=velocity[2]; just set it to 0.0
- if(flags&FL_ONGROUND && flags&FL_INWATER) -> if( flags & ( FL_ONGROUND | FL_INWATER ) ) (you can define it as const)

borjomi 11-01-2010 10:07

Re: uq_armorspeed
 
about g_userconnect i forget put it into client_disconnect) about other problem i try to check and do better)


//update plug

ConnorMcLeod 11-01-2010 10:42

Re: uq_armorspeed
 
I also had forgotten that this plugin had been submitted before yours and do the same with exactly same code : -Plugin-

But that's not a reason to not improve your code ;)

borjomi 11-01-2010 10:49

Re: uq_armorspeed
 
Quote:

Originally Posted by ConnorMcLeod (Post 1339203)
I also had forgotten that this plugin had been submitted before yours and do the same with exactly same code : -Plugin-

But that's not a reason to not improve your code ;)

funny.. but i write my mini plugins few month ago and my mini plugins (uq_armorspeed, uq_moneyspeed) are very similar))) http://unique-kz.com/download.php?list=4, so if his plugin is normal approve it.. and my plug you can move into unapprove section.

ConnorMcLeod 11-01-2010 10:54

Re: uq_armorspeed
 
Ok.

I've just checked cstrike modules sources again and ArmorValue message is not send by the native.
ArmorType message is still sent for nothing, so you still need to replace cstrike native with armorvalue (you don't even need to round it).

borjomi 11-01-2010 11:24

Re: uq_armorspeed
 
updated

ConnorMcLeod 11-01-2010 11:48

Re: uq_armorspeed
 
Would be better to declare FL_CHECK as a const, but it doesn't make any significant difference.
Also, flags and speed vars are not needed since they are used only 1 time.
End, consider that some plugins (especially on kz servers) put players into spectator team, so Ham_Killed won't be set and your alive variable will hold wrong value, i think it's better to keep is_user_alive native.

Approved.


All times are GMT -4. The time now is 06:27.

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