Raised This Month: $ Target: $400
 0% 

Rank does not work with my plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Pinatz
Member
Join Date: Dec 2008
Old 01-05-2011 , 12:07   Rank does not work with my plugin
Reply With Quote #1

Hey all :)
I have this code which is called when a player touchs another.
PHP Code:
                set_msg_block(deathMsg,BLOCK_ONCE
                
set_msg_block(scoreMsg,BLOCK_ONCE)
                
user_silentkill(pTouched)
                
make_deathmsg(pToucher,pTouched,0,"knife")
                
cs_set_user_deaths(pTouched,cs_get_user_deaths (pTouched)+1)  
                
set_user_frags(pToucher,get_user_frags(pToucher) + 1
But the rank plugin of amxx does not count this. :(

And another question I have. Is there a faster way to check 2 players distance to each other than the following method?

PHP Code:
public distance_check() {
    if(
get_pcvar_num(g_distancecheck) && !wait) {
        for(new 
i=1;i<33;i++) {
            if(
is_user_alive(i)) {
                for(new 
x=1;x<33;x++) {
                    if(
is_user_alive(x) && is_visible(x,i) && != && team[i-1] != team[x-1]) {
                        new 
iOrigin[3], xOrigin[3]
                        
get_user_origin(i,iOrigin)
                        
get_user_origin(x,xOrigin)
                        if(
get_distance(iOrigin,xOrigin) <= get_pcvar_num(g_distance)) {
                            if(
team[i-1] == && team[x-1] == 0)
                                
touch(i,x)
                            else
                                
touch(x,i)
                        }
                    }
                }
            }
        }
    }

__________________
Pinatz is offline
MyDooMJr
Member
Join Date: Jun 2009
Location: Portugal
Old 01-05-2011 , 12:33   Re: Rank does not work with my plugin
Reply With Quote #2

Well im learning how to code amxx,
and im not sure , but i think u have to save that in vault something for there u have to :$
MyDooMJr is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-05-2011 , 20:22   Re: Rank does not work with my plugin
Reply With Quote #3

1. Probably because the rank plugin will not see the fake death message that you create. You would need to cause one player to kill the other (ExecuteHam[B] + Ham_Killed or Ham_TakeDamage; not quite sure which).

2. Yes. Use get_players and use the cached entity indices.

Quote:
Originally Posted by MyDooMJr View Post
Well im learning how to code amxx,
and im not sure , but i think u have to save that in vault something for there u have to :$
What does Vault have to do with this?
__________________
fysiks is offline
Pinatz
Member
Join Date: Dec 2008
Old 01-06-2011 , 14:22   Re: Rank does not work with my plugin
Reply With Quote #4

How can I use Ham_TakeDamage properly? Can I set who gives the dmg? This would be needed to fakekill somebody right? Thank you for your help fysiks
And MyDooM thanks for the try but I think you do not understand the problem :>
__________________
Pinatz is offline
Elusive138
Senior Member
Join Date: Dec 2010
Old 01-06-2011 , 14:41   Re: Rank does not work with my plugin
Reply With Quote #5

http://forums.alliedmods.net/showthread.php?p=960618
Elusive138 is offline
Pinatz
Member
Join Date: Dec 2008
Old 01-07-2011 , 08:20   Re: Rank does not work with my plugin
Reply With Quote #6

Okay it works so far.
I use ExecuteHam(Ham_TakeDamage, pTouched, pToucher, pToucher, 100.0, 1<<2);
but it will only show the knife if I have the knife in my hands. Can I force the icon which is showed in the deathmessage?
And if I touch somebody the "shot" should go 1 up so that the accuracy is always 100% as you only need to touch the enemy to get him.
__________________
Pinatz 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 02:10.


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