AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Rank does not work with my plugin (https://forums.alliedmods.net/showthread.php?t=147107)

Pinatz 01-05-2011 12:07

Rank does not work with my plugin
 
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)
                        }
                    }
                }
            }
        }
    }



MyDooMJr 01-05-2011 12:33

Re: Rank does not work with my plugin
 
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 :$

fysiks 01-05-2011 20:22

Re: Rank does not work with my plugin
 
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 (Post 1386645)
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?

Pinatz 01-06-2011 14:22

Re: Rank does not work with my plugin
 
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 :>

Elusive138 01-06-2011 14:41

Re: Rank does not work with my plugin
 
http://forums.alliedmods.net/showthread.php?p=960618

Pinatz 01-07-2011 08:20

Re: Rank does not work with my plugin
 
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.


All times are GMT -4. The time now is 02:10.

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