Raised This Month: $ Target: $400
 0% 

strip weapons not working


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
flyeni6
Senior Member
Join Date: Jun 2006
Location: CAli
Old 05-26-2007 , 00:10   strip weapons not working
Reply With Quote #1

just as the tiltle says, i can't get strip_user_weapons to work.

anyone wanna help me?

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #define VERSION  "1.0"   new slayermodecvar,hm_slayer_kills   public plugin_init() {  register_plugin("HaloMod ",VERSION,"fLyEnIg")  register_event("DeathMsg", "on_game_win", "a")    slayermodecvar = register_cvar("gamehmslayer", "1")  hm_slayer_kills = register_cvar("hm_slayer_kills","1") } public on_game_win(id) {  if(get_pcvar_num(slayermodecvar))  {   new i   new killer = read_data(1)   new victim = read_data(2)   new killername[33]   new victimname[33]   new slayerkills = get_pcvar_num(hm_slayer_kills)   if(get_user_frags(killer) == slayerkills -1)   {    get_user_name(killer, killername, 32)    get_user_name(victim, victimname, 32)    //glow green on win    set_user_rendering(killer, kRenderFxGlowShell, 32, 202, 32, kRenderNormal, 15)    set_hudmessage(0, 255, 0, -1.0, -1.0, 0, 6.0, 12.0)    show_hudmessage(0, "%s is the WINNER!", killername)        for (i=1; i<=5; i++)    {     client_print(0, print_chat, "[HALO MOD] %s is the WINNER!",killername)    }        client_print(victim, print_chat, "[HALO MOD] You were %s last victim",killername)    set_task(9.0,"restart_match",id)    strip_user_weapons(id)   }   if(get_user_frags(killer) == slayerkills -3)   {    get_user_name(killer, killername, 32)    set_hudmessage(0, 255, 0, 0.55, 0.79, 0, 6.0, 12.0,-1.0)    show_hudmessage(0, "%s needs 2 more kills to WIN!", killername)    client_print(0, print_chat, "[HALO MOD] %s needs 2 more kills to WIN!",killername)   }     if(get_user_frags(killer) == slayerkills -2)   {    get_user_name(killer, killername, 32)    set_hudmessage(0, 255, 0, 0.55, 0.79, 0, 6.0, 12.0,-1.0)    show_hudmessage(0, "%s needs 1 more kill to WIN!", killername)    client_print(0, print_chat, "[HALO MOD] %s needs 1 more kills to WIN!",killername)   }  }  return PLUGIN_CONTINUE } public restart_match(id) {  set_task(0.1,"no_glow")  server_cmd("sv_restart 2") } public no_glow(id) {  if(is_user_alive(id) || is_user_connected(id))  {   set_user_rendering(id)  }  return PLUGIN_CONTINUE }
__________________

flyeni6 is offline
Send a message via AIM to flyeni6
Drak
Veteran Member
Join Date: Jul 2005
Old 05-26-2007 , 00:14   Re: strip weapons not working
Reply With Quote #2

Wouldn't "ID" return nothing? Since you're getting the victim and the killer with "read_data()". Plus, registering a event.
So, since you're using "strip_user_weapons(id)" this wouldn't work.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
flyeni6
Senior Member
Join Date: Jun 2006
Location: CAli
Old 05-26-2007 , 00:22   Re: strip weapons not working
Reply With Quote #3

well lol no wonder it wouldn't work.

i tired using a set_task but i still can't find anyway to fix this problem
__________________

flyeni6 is offline
Send a message via AIM to flyeni6
Drak
Veteran Member
Join Date: Jul 2005
Old 05-26-2007 , 00:28   Re: strip weapons not working
Reply With Quote #4

Just change 'id' to like... 'killer'. Since it seems that's what you want.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
flyeni6
Senior Member
Join Date: Jun 2006
Location: CAli
Old 05-26-2007 , 01:12   Re: strip weapons not working
Reply With Quote #5

no im trying to make this an event that will affect everyone
__________________

flyeni6 is offline
Send a message via AIM to flyeni6
Drak
Veteran Member
Join Date: Jul 2005
Old 05-26-2007 , 01:21   Re: strip weapons not working
Reply With Quote #6

It's already effecting everyone, since you gave the flag "a" on "register_event".
Or, are you meaning on the "strip_user_weapons" ?
If that's true, use "0" to strip everyone's weapons. (I think it's better to use get_players instead of zero on strip_user_weapons, not to sure).
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
flyeni6
Senior Member
Join Date: Jun 2006
Location: CAli
Old 05-26-2007 , 11:07   Re: strip weapons not working
Reply With Quote #7

no it doesn't work either
__________________

flyeni6 is offline
Send a message via AIM to flyeni6
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 05-26-2007 , 12:14   Re: strip weapons not working
Reply With Quote #8

Is it realy that hard to make a loop to get all players?
Code:
    new playercount, Players[32]
    get_players(Players, playercount,"a")
    for (new i=0; i < playercount; ++i)
    {
        strip_user_weapons[Players[i]];
    }
__________________
regalis is offline
flyeni6
Senior Member
Join Date: Jun 2006
Location: CAli
Old 05-26-2007 , 13:01   Re: strip weapons not working
Reply With Quote #9

Quote:
Originally Posted by regalis View Post
Is it realy that hard to make a loop to get all players?
Code:
    new playercount, Players[32]
    get_players(Players, playercount,"a")
    for (new i=0; i < playercount; ++i)
    {
        strip_user_weapons[Players[i]];
    }
doesn't compile
__________________

flyeni6 is offline
Send a message via AIM to flyeni6
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 05-26-2007 , 13:13   Re: strip weapons not working
Reply With Quote #10

Quote:
Originally Posted by flyeni6 View Post
doesn't compile
then you should post the compiler error!
.."doesn't compile" don't helps me to understand what you did wrong!
__________________

Last edited by regalis; 05-26-2007 at 13:19.
regalis is offline
Reply


Thread Tools
Display Modes

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:43.


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