|
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
|
06-07-2017
, 03:51
Re: Help with plugin
|
#15
|
Quote:
Originally Posted by dzinks2009
Like I said before,
PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
new bool:Kill = false;
public OnPluginStart()
{
CreateConVar("sm_cannounce_version", VERSION, "Anti-Reconnecting", FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
HookEvent("round_start", Event_RoundStart);
HookEvent("round_end", Event_RoundEnd);
HookEvent("player_spawn", Event_PlayerSpawn);
}
public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
new Float:Time = float(30);
new client = GetClientOfUserId(GetEventInt(event, "userid"));
Kill = false;
TimerRawr = CreateTimer(Time, Killing, client);
}
public Action:Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
{
Kill = false;
}
public Action:Killing(Handle:timer, any:client)
{
Kill = true;
}
public Action:Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (!client)
{
return;
}
if(IsClientInGame(client) && IsPlayerAlive(client)){
if(Kill){
ForcePlayerSuicide(client);
PrintToChat(client, "[Late Spawn] You have been slayed for spawning late!");
}
}
}
I want this to work.
The broken part is Event_PlayerSpawn because when someone joins server, they get slayed when they didnt even get to pick the team.
|
i'm not sure how that is possible
you have to be in a team to be alive
|
|
|
|