AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Block Cts from respawning (https://forums.alliedmods.net/showthread.php?t=139788)

SaM.ThE.MaN 10-05-2010 08:17

Block Cts from respawning
 
HI,

This is a method i am using to respawn players ,

PHP Code:

#include <amxmodx>
#include <engine>
#include <fakemeta_util>
#include <hamsandwich>

#define PLUGIN "testn"
#define VERSION "1.0"
#define AUTHOR "sam"

new PcvarProtectionTime
new g_itimeleft[33]
new 
PcvarRespawnTime
const RESPAWNTIME 2
const PROTECTIONTIME 0

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHamHam_Killed"player""fw_PlayerKilled" )
    
PcvarRespawnTime register_cvar"respawntime""" )
    
set_pcvar_numPcvarRespawnTimeRESPAWNTIME )
    
// Add your code here...
}

public 
fw_PlayerKilled(victimattackershouldgib)
{
    
set_taskget_pcvar_float(PcvarRespawnTime), "PlayerRespawn"victim )
}

public 
PlayerRespawnid )
{
    if( 
is_user_alive(id) )
        return

    
entity_set_int(idEV_INT_deadflagDEAD_RESPAWNABLE)
    
entity_set_int(idEV_INT_iuser10)
    
call_think(id)
    
DispatchSpawn(id)
    
    
fm_set_user_healthid100 )
    
    
g_itimeleft[id] = get_pcvar_numPcvarProtectionTime )
    
    
set_task3.0"PlayerProtection"id )


I want only Terrorists to respawn ... but i cant seem to be able to do that .. , either both ct and T respawn , or neither respawn ... little help , and explain to my how you get it fixed

nnajko 10-05-2010 08:27

Re: Block Cts from respawning
 
just return if player isnt a terrorist?
PHP Code:

#include <amxmodx> 
#include <engine> 
#include <fakemeta_util> 
#include <hamsandwich> 
#define PLUGIN "testn" 
#define VERSION "1.0" 
#define AUTHOR "sam" 
new PcvarProtectionTime 
new g_itimeleft[33
new 
PcvarRespawnTime 
const RESPAWNTIME 
const PROTECTIONTIME 
public plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR
    
RegisterHamHam_Killed"player""fw_PlayerKilled" 
    
PcvarRespawnTime register_cvar"respawntime""" 
    
set_pcvar_numPcvarRespawnTimeRESPAWNTIME 
    
// Add your code here... 

public 
fw_PlayerKilled(victimattackershouldgib

    
set_taskget_pcvar_float(PcvarRespawnTime), "PlayerRespawn"victim 

public 
PlayerRespawnid 

    if( 
is_user_alive(id) || get_user_team(id) != 
        return 
 
 
    
entity_set_int(idEV_INT_deadflagDEAD_RESPAWNABLE
    
entity_set_int(idEV_INT_iuser10
    
call_think(id
    
DispatchSpawn(id
 
    
fm_set_user_healthid100 
 
    
g_itimeleft[id] = get_pcvar_numPcvarProtectionTime 
 
    
set_task3.0"PlayerProtection"id 



SaM.ThE.MaN 10-05-2010 08:34

Re: Block Cts from respawning
 
are you answering my question , or are you guessing the answer ... or are you asking me a question about my question?

nnajko 10-05-2010 08:41

Re: Block Cts from respawning
 
Quote:

Originally Posted by SaM.ThE.MaN (Post 1316100)
are you answering my question , or are you guessing the answer ... or are you asking me a question about my question?

Ehm, I answered your question. return if the player isnt a terrorist. Which I fixed in the code

SaM.ThE.MaN 10-05-2010 09:40

Re: Block Cts from respawning
 
oh i c .... thats how its done


All times are GMT -4. The time now is 10:24.

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