AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   chat /spec command crashing server help (https://forums.alliedmods.net/showthread.php?t=237194)

bcs16cluj 03-19-2014 19:22

chat /spec command crashing server help
 
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "Spec All"
#define VERSION "1.0.0"
#define AUTHOR "sss"


public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

register_clcmd("say /spec", "cmd_spec")
}

public cmd_spec(id)
{
new players[32], pnum, tempid
get_players(players, pnum)

for( new i; i<pnum; i++ )
{
tempid = players[i]
user_kill(tempid)
cs_set_user_team(tempid, CS_TEAM_SPECTATOR)
}


sometimes when i use /spec command my server crashes why?can somebody help me ?pls thank you

YamiKaitou 03-19-2014 19:34

Re: chat /spec command crashing server help
 
Why are you sending everyone to Spec with that command? That is probably the reason there

bcs16cluj 03-19-2014 19:54

Re: chat /spec command crashing server help
 
i use this on my war server to put players to spec!

Baws 03-19-2014 21:27

Re: chat /spec command crashing server help
 
Can't you just use amx_transfer?

bcs16cluj 03-20-2014 03:44

Re: chat /spec command crashing server help
 
no
the thing is that we are playing gather mix 5versus5 and first 2 of us choose the teammates and the others must be spec for this !

cand somebody fix this plugin or give me something else for spec

thank you

Xunfop 03-20-2014 14:21

Re: chat /spec command crashing server help
 
Try
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "Spec All"
#define VERSION "1.0.0"
#define AUTHOR "sss"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);

    
register_clcmd("say /spec""cmd_spec"ADMIN_BAN);
}

public 
cmd_spec(id) {
    new 
players[32], pnumtempid;
    
get_players(playerspnum"h");

    for (new 
ipnumi++) {
        
tempid players[i];
        if (
is_user_alive(tempid))
            
user_kill(tempid1);
        if (
cs_get_user_team(tempid) != CS_TEAM_SPECTATOR)
            
cs_set_user_team(tempidCS_TEAM_SPECTATOR);
    }




All times are GMT -4. The time now is 05:59.

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