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

Solved [CS:GO] 1/x chance on respawn in enemy spawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Qes
AlliedModders Donor
Join Date: Jul 2014
Old 02-01-2018 , 14:59   [CS:GO] 1/x chance on respawn in enemy spawn
Reply With Quote #1

Hello,
How I can add given player 1/x chance on respawn in enemy spawn?

Last edited by Qes; 02-09-2018 at 16:02.
Qes is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 02-02-2018 , 07:53   Re: [CS:GO] 1/x chance on respawn in enemy spawn
Reply With Quote #2

Quote:
Originally Posted by Qes View Post
Hello,
How I can add given player 1/x chance on respawn in enemy spawn?
Why not make it 1 / x chance to respawn on death? Or you want the player to know if he'll respawn?
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
BraveFox
AlliedModders Donor
Join Date: May 2015
Location: Israel
Old 02-02-2018 , 12:05   Re: [CS:GO] 1/x chance on respawn in enemy spawn
Reply With Quote #3

PHP Code:
#include <sourcemod>

public void OnPluginStart()
{
    
HookEvent("player_spawn"PlayerSpawn);
}
public 
Action PlayerSpawn(Event eventchar[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    
int iRandom GetRandomInt(1100//Edit the 100.
    
if(iRandom >= 75) { //25% to win(from 100)
        //Won
    
}
    else {
        
//Lost
    
}

__________________
Contact Me:
Steam: NoyB
Discord: Noy#9999
Taking Private Requests
BraveFox is offline
Qes
AlliedModders Donor
Join Date: Jul 2014
Old 02-02-2018 , 14:11   Re: [CS:GO] 1/x chance on respawn in enemy spawn
Reply With Quote #4

It's about respawn in the new round, not died.

I know how to make a chance, but I don't know how to add respawn in ENEMY spawn.
CT has 1/x chance on respawn in enemy spawn - He respawn on TT spawn in new round
TT has 1/x chance on respawn in enemy spawn - He respawn on CT spawn in new round
Qes is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 02-03-2018 , 06:25   Re: [CS:GO] 1/x chance on respawn in enemy spawn
Reply With Quote #5

Change the players team before he's respawned, then spawn him and change it back. Might have to change his player model to the previous one though.
__________________
I highly recommend joining the SourceMod Discord Server for real time support.
backwards is offline
Qes
AlliedModders Donor
Join Date: Jul 2014
Old 02-03-2018 , 09:38   Re: [CS:GO] 1/x chance on respawn in enemy spawn
Reply With Quote #6

Thank you very much
Qes is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 02-04-2018 , 03:54   Re: [CS:GO] 1/x chance on respawn in enemy spawn
Reply With Quote #7

Quote:
Originally Posted by Qes View Post
Thank you very much
Last thing, if the command ChangeClientTeam kills the player, try SetEntProp(client, Prop_Send, "m_iTeamNum", 2); 2 means CT if I'm not wrong...
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 02-04-2018 , 05:24   Re: [CS:GO] 1/x chance on respawn in enemy spawn
Reply With Quote #8

Quote:
Originally Posted by eyal282 View Post
Last thing, if the command ChangeClientTeam kills the player, try SetEntProp(client, Prop_Send, "m_iTeamNum", 2); 2 means CT if I'm not wrong...
in cstrike.inc
Code:
#define CS_TEAM_T 			2	/**< Terrorists. */
#define CS_TEAM_CT			3	/**< Counter-Terrorists. */
You can use this for be sure
Code:
SetEntProp(client, Prop_Send, "m_iTeamNum", CS_TEAM_CT);
__________________
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
eyal282
Veteran Member
Join Date: Aug 2011
Old 02-05-2018 , 07:56   Re: [CS:GO] 1/x chance on respawn in enemy spawn
Reply With Quote #9

Quote:
Originally Posted by Franc1sco View Post
in cstrike.inc
Code:
#define CS_TEAM_T 			2	/**< Terrorists. */
#define CS_TEAM_CT			3	/**< Counter-Terrorists. */
You can use this for be sure
Code:
SetEntProp(client, Prop_Send, "m_iTeamNum", CS_TEAM_CT);
2 in CT in Amx Mod X then, which is irrelevant here.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 02-05-2018 , 15:48   Re: [CS:GO] 1/x chance on respawn in enemy spawn
Reply With Quote #10

Players will be in the wrong spawn if you change the team netprop.

Call respawn to force them to respawn in the correct teams spawn.
__________________
Neuro Toxin 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 13:34.


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