AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Respawn limit (https://forums.alliedmods.net/showthread.php?t=244446)

bandit 07-18-2014 10:17

Respawn limit
 
Hello,

If possible I would like a script for CSGO that does the following:

Respawn Terrorists 6 times, and
Respawn Counter Terrorists 3 times
with a 5 second respawn timer for both sides

Each player can respawn 6 times (Arkarr response)

thanks in advance

bandit

Arkarr 07-18-2014 10:23

Re: Respawn limit
 
Terrorists 6 times -> each players 6 times or only 6 respawn availables for the team ?

bandit 07-18-2014 12:34

Re: Respawn limit
 
Quote:

Originally Posted by Arkarr (Post 2169883)
Terrorists 6 times -> each players 6 times or only 6 respawn availables for the team ?

Hi Arkarr,

Thanks for responding

I would like each player to respawn 6 times

Arkarr 07-18-2014 13:28

Re: Respawn limit
 
Here, take this :
PHP Code:

#include <sourcemod>
#include <cstrike>

#define MAX_RESPAWN_CT 3
#define MAX_RESPAWN_T 6
#define TEAM_CT 3
#define TEAM_T 2

new DeathCount[MAXPLAYERS+1];

public 
Plugin:myinfo =  
{  
    
name "More Respawn",  
    
author "Arkarr",  
    
description "Respawn players depend their team.",  
    
version "1.0",  
    
url "http://www.sourcemod.net/"  
}; 

public 
OnPluginStart()  

    
HookEvent("player_death"Event_PlayerDeath);
}

public 
OnClientConnected(client)
{
    
DeathCount[client] = 0;
}

public 
Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
victim GetClientOfUserId(GetEventInt(event"userid"));
    new 
team GetClientTeam(victim);
    if((
team == TEAM_CT && DeathCount[victim] < MAX_RESPAWN_CT) || (team == TEAM_T && DeathCount[victim] < MAX_RESPAWN_T))
    {
        
CreateTimer(5.0TMR_RespawnPlayervictim);
        
PrintHintText(victim"Respawning in 5 seconds ! Be ready !");
    }
}

new 
Handle:TMR_RespawnPlayer(Handle:tmrany:client)
{
    
CS_RespawnPlayer(client);
    
DeathCount[client]++;


Not tested but should work :) !

bandit 07-18-2014 15:11

Re: Respawn limit
 
Quote:

Originally Posted by Arkarr (Post 2169883)
Terrorists 6 times -> each players 6 times or only 6 respawn availables for the team ?

I am getting this error when compiling"

/home/groups/sourcemod/upload_tmp/phpSZNo98.sp(36) : error 017: undefined symbol "TMR_RespawnPlayer"
/home/groups/sourcemod/upload_tmp/phpSZNo98.sp(41) : error 001: expected token: ";", but found "("

2 Errors.

ghost09 07-18-2014 15:33

Re: Respawn limit
 
Quote:

Originally Posted by bandit (Post 2170059)
I am getting this error when compiling"

/home/groups/sourcemod/upload_tmp/phpSZNo98.sp(36) : error 017: undefined symbol "TMR_RespawnPlayer"
/home/groups/sourcemod/upload_tmp/phpSZNo98.sp(41) : error 001: expected token: ";", but found "("

2 Errors.

PHP Code:

#include <cstrike>

#define MAX_RESPAWN_CT 3
#define MAX_RESPAWN_T 6
#define TEAM_CT 3
#define TEAM_T 2

new DeathCount[MAXPLAYERS+1];

public 
Plugin:myinfo =  
{  
    
name "More Respawn",  
    
author "Arkarr",  
    
description "Respawn players depend their team.",  
    
version "1.0",  
    
url "http://www.sourcemod.net/"  
}; 

public 
OnPluginStart()  

    
HookEvent("player_death"Event_PlayerDeath);
}

public 
OnClientConnected(client)
{
    
DeathCount[client] = 0;
}

public 
Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
victim GetClientOfUserId(GetEventInt(event"userid"));
    new 
team GetClientTeam(victim);
    if((
team == TEAM_CT && DeathCount[victim] < MAX_RESPAWN_CT) || (team == TEAM_T && DeathCount[victim] < MAX_RESPAWN_T))
    {
        
CreateTimer(5.0TMR_RespawnPlayervictim);
        
PrintHintText(victim"Respawning in 5 seconds ! Be ready !");
    }
}

public 
Action:TMR_RespawnPlayer(Handle:tmrany:client)
{
    if(!
IsClientInGame(client))
        return 
Plugin_Handled;
        
    
CS_RespawnPlayer(client);
    
DeathCount[client]++;
    return 
Plugin_Continue;


:3

bandit 07-18-2014 16:05

Re: Respawn limit
 
When I died I did not respawn, but I did see
"Respawning in 5 seconds ! Be ready !"

I even tried it with a bot on my team, and still could not respawn

Arkarr 07-18-2014 16:31

Re: Respawn limit
 
remove
PHP Code:

if(!IsClientInGame(client)) 
        return 
Plugin_Handled

Not sure by the way.

bandit 07-18-2014 17:56

Re: Respawn limit
 
Still didn't work

bandit 07-18-2014 19:54

Re: Respawn limit
 
Quote:

Originally Posted by Arkarr (Post 2170112)
remove
PHP Code:

if(!IsClientInGame(client)) 
        return 
Plugin_Handled

Not sure by the way.

I currently am using this script which works great,
but it spawns 3 player for both sides (where as I need 6 on T)
Maybe you can use this as a reference

https://forums.alliedmods.net/showth...&highlight=vip


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

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