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

Solved [CS:GO Req] Disable Spectator


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
digin
Member
Join Date: Nov 2019
Old 11-14-2019 , 21:18   [CS:GO Req] Disable Spectator
Reply With Quote #1

Hello, im looking plugin for disable spectator if player already in CT/T Team because when Overtime player can reset their money to $10k if join spectator then join team again

Thanks

Last edited by digin; 11-17-2019 at 00:20.
digin is offline
DiogoOnAir
Senior Member
Join Date: Jul 2018
Location: Portugal
Old 11-15-2019 , 03:53   Re: [CS:GO Req] Disable Spectator
Reply With Quote #2

Add me in discord or steam
__________________
I accept Private(Paid) plugins requests
If you like my job donate me Here
Feel free to add me on Steam
Feel free to add me on Discord DiogoOnAir | Config & Developer#7961
Check my website
If you want to buy any server, you can buy it from here!
Datacenters around the world!
DiogoOnAir is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 11-15-2019 , 07:48   Re: [CS:GO Req] Disable Spectator
Reply With Quote #3

You can use a plugin like this for restric teams https://forums.alliedmods.net/showthread.php?p=1877187
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
Malaxus
Member
Join Date: May 2019
Old 11-16-2019 , 19:26   Re: [CS:GO Req] Disable Spectator
Reply With Quote #4

I believe this may do the trick.
Quote:
#include <sourcemod>
#include <cstrike>
#include <sdktools>

public OnPluginStart()
{
RegAdminCmd("sm_spectate", command_switchSpec, ADMFLAG_CUSTOM6, "Switch to specatate");
RegAdminCmd("sm_spec", command_switchSpec, ADMFLAG_CUSTOM6, "Switch to specatate");
AddCommandListener(altJoin, "jointeam");
}

public Action:command_switchSpec(client, args)
{
switch(GetClientTeam(client))
{
case CS_TEAM_CT, CS_TEAM_T:
{
ChangeClientTeam(client, CS_TEAM_SPECTATOR);
return Plugin_Handled;
}

case CS_TEAM_SPECTATOR:
{
ChangeClientTeam(client, CS_TEAM_T);
return Plugin_Handled;
}
}

return Plugin_Handled;
}

public Action:altJoin(Client, const String:command[], argc)
{
if(!IsClientInGame(Client) || argc < 1)
{
return Plugin_Handled;
}

decl String:arg[8];
GetCmdArg(1, arg, sizeof(arg));
new teamJoin = StringToInt(arg);
new teamLeave = GetClientTeam(Client);

if(teamLeave == teamJoin || IsFakeClient(Client))
{
return Plugin_Continue;
}
else
{
// ignore switches between T/CT team
if((teamLeave == CS_TEAM_CT && teamJoin == CS_TEAM_T)
|| (teamLeave == CS_TEAM_T && teamJoin == CS_TEAM_CT))
{
return Plugin_Handled;
}
}
return Plugin_Handled;
}

Last edited by Malaxus; 11-16-2019 at 19:29.
Malaxus is offline
digin
Member
Join Date: Nov 2019
Old 11-17-2019 , 00:19   Re: [CS:GO Req] Disable Spectator
Reply With Quote #5

Quote:
Originally Posted by Malaxus View Post
I believe this may do the trick.
Thank you! i modified your plugin and working like what i want
digin is offline
mlov420
Senior Member
Join Date: May 2013
Old 11-17-2019 , 06:27   Re: [CS:GO Req] Disable Spectator
Reply With Quote #6

Quote:
Originally Posted by DiogoOnAir View Post
Add me in discord or steam
Hey man, maybe contribute to the community like the rest of us?

I've never seen you help anyone since you've showed up here but you're always dropping your discord link trying to sell someone something. Maybe try earning your paid work instead of doing nothing but soliciting it.
mlov420 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 09:52.


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