vote timebomb

User avatar
r0aringdrag0n
250+ Posts
250+ Posts
Posts: 367
Joined: Sat Jan 29, 2011 4:26 pm

vote timebomb

Post by r0aringdrag0n »

We need a votetimebomb command where if someone is Afk, players can vote timebomb and be killed after the 10 second countdown but make it so that if the player moves within the countdown, the countdown is canceled
"push to test, release to detonate"
MINECRAFT, ENOUGH SAID, PLAY NOW
[GR]Roaringdragon
Ryan
Former Server Admin
Posts: 1163
Joined: Fri Apr 23, 2010 2:56 am
Location: United Kingdom

Re: vote timebomb

Post by Ryan »

Or just do a manual vote lulz
!vote "Explode Roaring" Yes No
Only a problem if no admins are online.
User avatar
r0aringdrag0n
250+ Posts
250+ Posts
Posts: 367
Joined: Sat Jan 29, 2011 4:26 pm

Re: vote timebomb

Post by r0aringdrag0n »

thats why I ask votetimebomb
"push to test, release to detonate"
MINECRAFT, ENOUGH SAID, PLAY NOW
[GR]Roaringdragon
User avatar
shadowslayer
1000+ Posts
1000+ Posts
Posts: 1280
Joined: Fri Sep 03, 2010 8:51 pm

Re: vote timebomb

Post by shadowslayer »

plus noobs cant spam it because it only works on afk ppl.
i vote we add votetimebomb
Spoiler
Show
Saying "Your lucky i'm peaceful" is pretty much like saying "when i grow up i wanna be an arms race!"-HL2shadowslayer, Area 51 Minecraft
Imagethe only reason you shouldnt mess with me
jimmythecanadian
50+ Posts
50+ Posts
Posts: 69
Joined: Wed May 18, 2011 11:23 pm

Re: vote timebomb

Post by jimmythecanadian »

Y NOWT JUS USE VOTEKICK IT WILL ACCOMPLISH TEH SAME AS "VOTETIMEBOMB" ANYWAY TEH BEST SOLUSHUN IZ 2 START TIEMBOMB ON ANYONE HOO IZ AFK 4 OVAR MINIT AN ONLY CANCEL IT ONCE THEY MOOV
User avatar
Blake
500+ Posts
500+ Posts
Posts: 588
Joined: Mon Jul 05, 2010 8:51 pm
Location: Ontario, Canada

Re: vote timebomb

Post by Blake »

jimmythecanadian wrote:Y NOWT JUS USE VOTEKICK IT WILL ACCOMPLISH TEH SAME AS "VOTETIMEBOMB" ANYWAY TEH BEST SOLUSHUN IZ 2 START TIEMBOMB ON ANYONE HOO IZ AFK 4 OVAR MINIT AN ONLY CANCEL IT ONCE THEY MOOV

Good Idea, they could add this, just have it so when people spawn it creates a timer in a handle like AFKTImer[Client] = CreateTimer(.....); then on the even OnPlayerRunCmd() if they move it kills that timer or another way is have a boolean called afk set to true then when someone moves its set to false and then when the round starts it creates a timer to run in around 5 minutes and it loops through all the players that have the afk boolean set to false and slays them

Example you can use...

Code: Select all

#include <sourcemod>
#include <sdktools>

#pragma semicolon 1

#define PLUGIN_VERSION "0.4.3"

new bool:IsSpawned[MAXPLAYERS+1];

new Handle:SpawnProtectTimers[MAXPLAYERS+1];

new g_offsCollisionGroup;

SpawnProtect(client,v) {
	if(v == 1 && IsClientConnected(client) && IsClientInGame(client)) {
		SetEntProp(client, Prop_Data, "m_takedamage", 0, 1);
		SetEntData(client, g_offsCollisionGroup, 2, 4, true);
		SetEntityRenderColor(client, 255, 255 ,255 ,128);
		SetEntityRenderMode(client, RENDER_TRANSCOLOR);
	}
	else if(v == 0 && IsClientConnected(client) && IsClientInGame(client)) {
		SetEntProp(client, Prop_Data, "m_takedamage", 2, 1);
		SetEntData(client, g_offsCollisionGroup, 5, 4, true);
		SetEntityRenderColor(client, 255, 255 ,255 ,255);
		SetEntityRenderMode(client, RENDER_NORMAL);
		
	}
}

public Plugin:myinfo = 
{
	name = "RP Spawn SpawnProtect",
	author = "Smacked",
	description = "RP Players have NoBlock & God untill move",
	version = PLUGIN_VERSION,
	url = "N/A"
}

public OnPluginStart() {
	CreateConVar("rp_spawnprotect_version", PLUGIN_VERSION, "Plugin RP Spawn Protect current version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
	HookEvent( "player_spawn", PlayerSpawn_Event, EventHookMode_Post);
	HookEvent( "player_death", PlayerDeath_Event, EventHookMode_Post);
	g_offsCollisionGroup = FindSendPropOffs("CBaseEntity", "m_CollisionGroup");
}

public OnClientPutInServer(Client) {
	IsSpawned[Client] = false;
}

public OnClientDisconnect(Client) {
	if(SpawnProtectTimers[Client] != INVALID_HANDLE) {
		KillTimer(SpawnProtectTimers[Client]);
		SpawnProtectTimers[Client] = INVALID_HANDLE;
	}
}

public Action:PlayerSpawn_Event( Handle:event, const String:name[], bool:dontBroadcast ) {
	new iUserId = GetEventInt(event, "userid");
	new iClient = GetClientOfUserId(iUserId);
	if (iClient != 0) {
		IsSpawned[iClient] = true;
		SpawnProtect(iClient, 1);
	}
	if(SpawnProtectTimers[iClient] != INVALID_HANDLE) {
		KillTimer(SpawnProtectTimers[iClient]);
		SpawnProtectTimers[iClient] = INVALID_HANDLE;
	}
	return Plugin_Continue;
}

public Action:PlayerDeath_Event( Handle:event, const String:name[], bool:dontBroadcast ) {
	new iUserId = GetEventInt(event, "userid");
	new iClient = GetClientOfUserId(iUserId);
	if (iClient != 0) {
		IsSpawned[iClient] = false;
		SpawnProtect(iClient, 0);
	}
	if(SpawnProtectTimers[iClient] != INVALID_HANDLE) {
		KillTimer(SpawnProtectTimers[iClient]);
		SpawnProtectTimers[iClient] = INVALID_HANDLE;
	}
}

public Action:ResetSpawnProtect(Handle:timer, any:client) {
	if (client != 0 && IsPlayerAlive(client) && IsClientInGame(client)) {
		SpawnProtect(client, 0);
	}
	if(SpawnProtectTimers[client] != INVALID_HANDLE) {
		KillTimer(SpawnProtectTimers[client]);
		SpawnProtectTimers[client] = INVALID_HANDLE;
	}
	return Plugin_Stop;
}

public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon) {
	if ( IsSpawned[client] && (
	((buttons & IN_FORWARD)) ||
	((buttons & IN_BACK)) ||
	((buttons & IN_MOVERIGHT)) ||
	((buttons & IN_MOVELEFT)) ||
	((buttons & IN_ATTACK)) ||
	((buttons & IN_ATTACK2)) ||
	((buttons & IN_DUCK)) ||
	((buttons & IN_JUMP)) ||
	((buttons & IN_SPEED))
	)
	) {
		IsSpawned[client] = false;
		SpawnProtectTimers[client] = CreateTimer(2.0, ResetSpawnProtect, client, 0);
	}
	return Plugin_Continue;
}
Unkown wrote: Life’s too short to worry about the little things.
Albert Einstein wrote: You do not really understand something unless you can explain it to your grandmother.