Raised This Month: $32 Target: $400
 8% 

[CS:GO] Users with flag gets respawns


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
condolent
AlliedModders Donor
Join Date: Jan 2016
Location: gc_sLocation;
Old 05-24-2017 , 11:03   [CS:GO] Users with flag gets respawns
Reply With Quote #1

Hi, this is a plugin request for CS:GO!

I would like a plugin where players with a flag (let's say a for this example) can respawn like 2-3 times per map via a command.

Anyone up for it? Feel like this should be kind of easy to make tbh! Great for jailbreak servers with VIP systems, where VIPs get 3 respawns per map then!

Last edited by condolent; 05-25-2017 at 06:29.
condolent is offline
B2SX
Member
Join Date: Dec 2015
Location: Israel
Old 05-24-2017 , 20:15   Re: [CS:GO] Users with flag gets respawns
Reply With Quote #2

Code:
#include <sourcemod>
#include <cstrike>

#define Number 3
int RespawnNumber[32];

public Plugin myinfo = 
{
	name = "RESPAWN FOR VIPS",
	author = "BaroNN",
	description = "",
	version = "1.0",
	url = ""
};

public void OnPluginStart()
{
	RegAdminCmd("sm_whatever", sm_respawn, ADMFLAG_CUSTOM5);
	HookEvent("round_start", Event_Start);
}

public Action sm_respawn(int client, int args)
{
	if (!IsPlayerAlive(client) && RespawnNumber[client] <= Number)
	{
		CS_RespawnPlayer(client);
		RespawnNumber[client] += 1;
	}	
}

public Action Event_Start(Handle sEvent, const char[] Name, bool DontBroadcast)
{
	int client = GetClientOfUserId(GetEventInt(sEvent, "userid"));
	RespawnNumber[client] = 0;
}
not tested, enjoy
__________________
◆ Developer - C++,C#,Python,VB.NET,Java,SQF,AS 3.0,AS 2.0,SP,Pawn,LUA
Steam Link

Last edited by B2SX; 05-24-2017 at 20:17.
B2SX is offline
condolent
AlliedModders Donor
Join Date: Jan 2016
Location: gc_sLocation;
Old 05-25-2017 , 05:45   Re: [CS:GO] Users with flag gets respawns
Reply With Quote #3

Very interesting! Will test it out, thanks!
It did indeed work! Though it gave 4 respawns so I changed the variable to 2, so it gives 3 respawns now.

Another question, if I wanted to PrintToChatAll that the user respawned, how would I get the user that actually executed the command? Is this a solution?:
Code:
PrintToChatAll("[{green}TrinityPlay{default}]", client, " used a Respawn!");
EDIT: My code was not a solution! Lul

Last edited by condolent; 05-25-2017 at 06:18.
condolent is offline
condolent
AlliedModders Donor
Join Date: Jan 2016
Location: gc_sLocation;
Old 05-25-2017 , 07:13   Re: [CS:GO] Users with flag gets respawns
Reply With Quote #4

Are you OK with me uploading this plugin to the forum after I've made some minor changes? I will credit you, ofc
condolent is offline
B2SX
Member
Join Date: Dec 2015
Location: Israel
Old 05-25-2017 , 15:41   Re: [CS:GO] Users with flag gets respawns
Reply With Quote #5

Quote:
Originally Posted by condolent View Post
Are you OK with me uploading this plugin to the forum after I've made some minor changes? I will credit you, ofc
sure.
__________________
◆ Developer - C++,C#,Python,VB.NET,Java,SQF,AS 3.0,AS 2.0,SP,Pawn,LUA
Steam Link
B2SX is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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