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

No kill from back, 1x1


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Atchodas
Junior Member
Join Date: Jul 2010
Old 07-07-2010 , 12:37   No kill from back, 1x1
Reply With Quote #1

hi, i have knife server and need plugins:

1. No kill from back (if victim not see killer)
2. 1x1 (players attack one by one)


This code "back kill" not working for my client_print always say from front.

Code:
#include <amxmodx>
#include <fakemeta_util>

public plugin_init()
{
    register_plugin("test", "0.1", "v3x");
    register_event("DeathMsg", "EventDeathMsg", "a", "1!0", "2!0");
}

public EventDeathMsg()
{
    new id = read_data(2);
    new killer = read_data(1);

    if(!is_user_connected(id) || !is_user_alive(killer))
        return PLUGIN_CONTINUE;

    new origin[3];
    get_user_origin(id, origin, 1);

    new Float:fOrigin[3];
    IVecFVec(origin, fOrigin);

    new bool:in_back = fm_is_in_viewcone(killer, fOrigin);

    client_print(id, print_chat, "* Killer was in %s of you", in_back ? "front" : "back");

    return PLUGIN_CONTINUE;
}
Any ideas, samples? Thanks.
Atchodas is offline
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 07-07-2010 , 14:14   Re: No kill from back, 1x1
Reply With Quote #2

PHP Code:
client_print(idprint_chat"* Killer was in %s of you"in_back "front" "back"); 


PHP Code:
client_print(idprint_chat"* Killer was in %s of you"in_back "back" "front"); 
This may look confusing and unreal, but trust me it works now

Last edited by Lure.d; 07-07-2010 at 14:22.
Lure.d is offline
Send a message via Skype™ to Lure.d
Atchodas
Junior Member
Join Date: Jul 2010
Old 07-07-2010 , 15:00   Re: No kill from back, 1x1
Reply With Quote #3

Quote:
Originally Posted by Lure.d View Post
PHP Code:
client_print(idprint_chat"* Killer was in %s of you"in_back "front" "back"); 


PHP Code:
client_print(idprint_chat"* Killer was in %s of you"in_back "back" "front"); 
This may look confusing and unreal, but trust me it works now

if you write nonsenses, don`t write at all....
Atchodas is offline
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 07-07-2010 , 15:20   Re: No kill from back, 1x1
Reply With Quote #4

noob.

Quote:
Originally Posted by v3x View Post
Sort of.

I know I should of named the variable in_back differently to correspond with the function it was returning.
PHP Code:
if(in_back == true)
{
  
// in front
}
else
{
  
// in back

It won't work for grenades, though. I'd have to think of a way to do that.
Lure.d is offline
Send a message via Skype™ to Lure.d
Atchodas
Junior Member
Join Date: Jul 2010
Old 07-07-2010 , 16:31   Re: No kill from back, 1x1
Reply With Quote #5

Quote:
Originally Posted by Lure.d View Post
noob.

Code:
new bool:in_back = fm_is_in_viewcone(killer, fOrigin);
 
 if(in_back == true)
{
  // in front
  client_print(id, print_chat, "* Killer was in front of you");
}
else
{
  // in back
  client_print(id, print_chat, "* Killer was in back of you");
}
as i said it doesn`t work. All code wrong not client_print line.

if i kill from back it writes from front, if kill from front - writes from front
Atchodas is offline
unnyquee
Senior Member
Join Date: Jun 2009
Location: Constanta, Romania
Old 07-08-2010 , 05:18   Re: No kill from back, 1x1
Reply With Quote #6

OMFG!

PHP Code:
new bool:in_back fm_is_in_viewcone(killerfOrigin);
 
 if(!
in_back)
{
  
// in front
  
client_print(idprint_chat"* Killer was in front of you");
}
else
{
  
// in back
  
client_print(idprint_chat"* Killer was in back of you");

__________________
unnyquee is offline
Atchodas
Junior Member
Join Date: Jul 2010
Old 07-08-2010 , 08:27   Re: No kill from back, 1x1
Reply With Quote #7

Quote:
Originally Posted by unnyquee View Post
OMFG!

PHP Code:
new bool:in_back fm_is_in_viewcone(killerfOrigin);
 
 if(!
in_back)
{
  
// in front
  
client_print(idprint_chat"* Killer was in front of you");
}
else
{
  
// in back
  
client_print(idprint_chat"* Killer was in back of you");

all time say from back...

i think this code wrong:
Code:
    new origin[3];
    get_user_origin(id, origin, 1);

    new Float:fOrigin[3];
    IVecFVec(origin, fOrigin);

    new bool:in_back = fm_is_in_viewcone(killer, fOrigin);
Atchodas is offline
unnyquee
Senior Member
Join Date: Jun 2009
Location: Constanta, Romania
Old 07-08-2010 , 11:31   Re: No kill from back, 1x1
Reply With Quote #8

Quote:
Originally Posted by Atchodas View Post
i think this code wrong:
Code:
    new origin[3];
    get_user_origin(id, origin, 1);

    new Float:fOrigin[3];
    IVecFVec(origin, fOrigin);

    new bool:in_back = fm_is_in_viewcone(killer, fOrigin);


PHP Code:
    new origin[3];
    
get_user_origin(idorigin0);

    new 
Float:fOrigin[3];
    
IVecFVec(originfOrigin);

    new 
bool:in_back fm_is_in_viewcone(killerfOrigin); 
__________________
unnyquee is offline
Atchodas
Junior Member
Join Date: Jul 2010
Old 07-09-2010 , 13:33   Re: No kill from back, 1x1
Reply With Quote #9

hm not working... maybe v3x not complate this plugin... victim and killer origins working, but "fm_is_in_viewcone" not detect correctly.
Atchodas 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 11:14.


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