Raised This Month: $ Target: $400
 0% 

need a function!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sebastiannielsen
Junior Member
Join Date: Oct 2004
Old 10-17-2004 , 15:51   need a function!
Reply With Quote #1

I include these files....

#include <amxmodx>;
#include <fun>;
#include <engine>;

I want the following to RUN when a player dies or kill a another player.


Code:
alldeaths = get_user_deaths(victim);
allkills = get_user_frags(victim);
allrate = allkills / alldeaths;
if (allrate >= 10) {
set_user_armor(victim, 100);
set_user_health(victim, 100);
}
if (allrate >= 15) {
set_user_gravity(victim, 0.1875);
}
else
{
set_user_gravity(victim, 1);
}
if (allrate >= 20) {
set_user_noclip(victim, 1);
}
else
{
set_user_noclip(victim, 0);
}
if (allrate >= 25) {
set_user_godmode(victim, 1);
}
else
{
set_user_godmode(victim, 0);
}

I dont want to run my server on TFC , i want to run it on standard HL and then i cant use client_death(killer , target , weapon , TK)
I dont want to run Day of Defeat either.
sebastiannielsen is offline
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 10-17-2004 , 16:03  
Reply With Quote #2

add this to your plugin_ini:

Code:
  register_event("DeathMsg","YourFunctionName","a")

then:

Code:
public YourFunctionName(id){     new killer= read_data(1)     new victim= read_data(2)     new weapon= read_data(3)     if (killer==victim)         return PLUGIN_CONTINUE           new alldeaths = get_user_deaths(victim);         new allkills = get_user_frags(victim);         new allrate = allkills / alldeaths;         if (allrate >= 10) {            set_user_armor(victim, 100);            set_user_health(victim, 100);            }         if (allrate >= 15) {            set_user_gravity(victim, 0.1875);            }         else {            set_user_gravity(victim, 1);            }         if (allrate >= 20) {            set_user_noclip(victim, 1);            }         else {            set_user_noclip(victim, 0);            }         if (allrate >= 25) {            set_user_godmode(victim, 1);            }         else {            set_user_godmode(victim, 0);            } }

that should work
FeuerSturm 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 17:24.


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