AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   strip weapons not working (https://forums.alliedmods.net/showthread.php?t=55611)

flyeni6 05-26-2007 00:10

strip weapons not working
 
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 }

Drak 05-26-2007 00:14

Re: strip weapons not working
 
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.

flyeni6 05-26-2007 00:22

Re: strip weapons not working
 
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

Drak 05-26-2007 00:28

Re: strip weapons not working
 
Just change 'id' to like... 'killer'. Since it seems that's what you want.

flyeni6 05-26-2007 01:12

Re: strip weapons not working
 
no im trying to make this an event that will affect everyone

Drak 05-26-2007 01:21

Re: strip weapons not working
 
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).

flyeni6 05-26-2007 11:07

Re: strip weapons not working
 
no it doesn't work either

regalis 05-26-2007 12:14

Re: strip weapons not working
 
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]];
    }


flyeni6 05-26-2007 13:01

Re: strip weapons not working
 
Quote:

Originally Posted by regalis (Post 482113)
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

regalis 05-26-2007 13:13

Re: strip weapons not working
 
Quote:

Originally Posted by flyeni6 (Post 482126)
doesn't compile

then you should post the compiler error!
.."doesn't compile" don't helps me to understand what you did wrong! :(


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

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