View Single Post
Kumlaserver
Junior Member
Join Date: Jul 2011
Old 05-08-2012 , 11:10   Re: First plugin simple need help :)
Reply With Quote #5

Quote:
Originally Posted by Grognak View Post
PHP Code:
public Action:kill(Handle:timer)
{
    for( new 
iClient 1iClient <= MaxClientsiClient++ )
        if( 
IsClientInGameiClient ) )
        {
            
ForcePlayerSuicideiClient );
        }

Be sure to read up on proper indentation... it'll save you a lot of headaches in the future. As well, "// do it" is just a comment, if you wanted to force the player's suicide you have to use the function that he linked to.

Okey, i have another issue now where i want it to make the suicide at each round now it only make them suicide on plugin start.

i tried doin OnRoundStart instead of OnPluginStart but that didnt work.. :/
Code:
#include <sourcemod>
#include <sdktools>
 
public Plugin:myinfo =
{
	name = "Slay All",
	author = "Hannes",
	description = "Kills all players after xx minutes",
	version = "1.0.0.0",
	url = "http://www.kumlaonline.se/"
};

public OnPluginStart()
{
	CreateTimer(5.0, kill)
}
 
public Action:kill(Handle:timer)
{
    for( new iClient = 1; iClient <= MaxClients; iClient++ )
        if( IsClientInGame( iClient ) )
        {
            ForcePlayerSuicide(iClient);
        }
}
Kumlaserver is offline