Raised This Month: $ Target: $400
 0% 

kills to win


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
flyeni6
Senior Member
Join Date: Jun 2006
Location: CAli
Old 05-13-2007 , 12:25   kills to win
Reply With Quote #1

im running FFA mode in CSDM.
im tring to make it so that when a person gets 50 kills and event will happen like a hud will appear "YOU WIN" or someting else.

how do i do that?
__________________

flyeni6 is offline
Send a message via AIM to flyeni6
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 05-13-2007 , 12:52   Re: kills to win
Reply With Quote #2

somehting like this =>>
Code:
#include <amxmodx>
#include <csx>
#include <fakemeta>
 
#define PLUGIN ""
#define VERSION ""
#define AUTHOR ""
 
new kills[32]
 
public plugin_init() {
 
     register_plugin(PLUGIN, VERSION, AUTHOR)
     register_forward(FM_PlayerPreThink,"fm_playerprethink",0)
}
 
public client_death(killer,victim,weapon,hitplace,tk)
{
    kills[killer] += 1
}
 
public fm_playerprethink(id)
{
     if(kills[id] == 50)
     {
            set_hudmessage(id, 0,255, 0.33, 0.87, 1, 6.0, 6.0, 0.1, 0.1, -1 );
            show_hudmessage(id,"Wow you made 50 kills! 0.o");
     }
}
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
flyeni6
Senior Member
Join Date: Jun 2006
Location: CAli
Old 05-13-2007 , 13:07   Re: kills to win
Reply With Quote #3

thank u alka
lol i cant give u anymore karma.
it wont let me
__________________

flyeni6 is offline
Send a message via AIM to flyeni6
flyeni6
Senior Member
Join Date: Jun 2006
Location: CAli
Old 05-13-2007 , 13:51   Re: kills to win
Reply With Quote #4

no im not trying to use csx.

like when someone gets 50 kills then the gm will restart
and everyones kills will restart

how do you do this?
__________________


Last edited by flyeni6; 05-13-2007 at 14:40.
flyeni6 is offline
Send a message via AIM to flyeni6
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 05-13-2007 , 14:56   Re: kills to win
Reply With Quote #5

try this
Code:
#include <amxmodx>
#include <fun>
 
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"
 
new kills[32]
 
public plugin_init() {
 
     register_plugin(PLUGIN, VERSION, AUTHOR)
     register_event("DeathMsg", "p_death", "a")
}
 
public p_death()
{
        new killer = read_data(1)
 
        if (killerid == 0)
            return 0;
 
        kills[killer] += 1
 
        if(kills[id] == 50)
        {
            server_cmd("sv_restart 1")
            set_user_frags(0,0)
            kills[id] =0;
        }
}
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 05-13-2007 at 15:02.
Alka is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 05-13-2007 , 14:58   Re: kills to win
Reply With Quote #6

Don't check kills in prethink, check kills only when they are updated.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 05-13-2007 , 15:02   Re: kills to win
Reply With Quote #7

Thanks..now should work...
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
flyeni6
Senior Member
Join Date: Jun 2006
Location: CAli
Old 05-13-2007 , 15:30   Re: kills to win
Reply With Quote #8

i tried compiling it and this is what it gave me
Code:
/home/groups/amxmodx/tmp3/textryCigB.sma(20) : error 017: undefined symbol "killerid"
/home/groups/amxmodx/tmp3/textryCigB.sma(25) : error 017: undefined symbol "id"
/home/groups/amxmodx/tmp3/textryCigB.sma(29) : error 017: undefined symbol "id"
/home/groups/amxmodx/tmp3/textryCigB.sma(29) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/textryCigB.sma(31) : warning 209: function "p_death" should return a value

3 Errors.
Could not locate output file /home/groups/amxmodx/public_html/websc3/textryCigB.amx (compile failed).
__________________

flyeni6 is offline
Send a message via AIM to flyeni6
Deviance
Veteran Member
Join Date: Nov 2004
Location: Sweden
Old 05-13-2007 , 15:48   Re: kills to win
Reply With Quote #9

Code:
#include <amxmodx>

#define Plugin "50 kills"
#define Version "1.0"
#define Author "Doombringer"

public plugin_init()
{
	register_plugin(Plugin, Version, Author)
	register_event("DeathMsg", "hook_death", "a")
}

public hook_death()
{
	new killer = read_data(1)
	if(get_user_frags(killer) >= 50)
	{
		new name[32]
		get_user_name(killer, name, 31)
		
		set_hudmessage(0, 255, 0, -1.0, 0.36, 0, 6.0, 12.0)
		show_hudmessage(0, "%s has made 50 kills!^nRestarting...", name)
		
		server_cmd("sv_restart 1")
	}
}
Deviance is offline
flyeni6
Senior Member
Join Date: Jun 2006
Location: CAli
Old 05-13-2007 , 16:23   Re: kills to win
Reply With Quote #10

thx but how do you make it so that once you reach 50 kills
it will restart.

not when u get 51
__________________

flyeni6 is offline
Send a message via AIM to flyeni6
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 10:32.


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