Raised This Month: $ Target: $400
 0% 

Only Vip can respawn twice


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
teckins
Member
Join Date: Aug 2011
Old 12-24-2011 , 15:07   Only Vip can respawn twice
Reply With Quote #1

Hello,

I would like to ask someone that if there is a plugin for deathrun if not can someone make it I know there is a plugin that respawns players well I dont want that I want to respawn players that are only and Only Vip players the vip flag is O this is for a deathrun server I use Death run V.I.P. 3.1 by tbag : https://forums.alliedmods.net/showthread.php?p=1618647 I would like that when a vip dies they respawn again for a second chance only vips not players Only V.I.P.

Thanks
teckins is offline
Pop0N
Member
Join Date: Apr 2011
Old 12-24-2011 , 16:18   Re: Only Vip can respawn twice
Reply With Quote #2

what accses has to the vip?

edit: i saw the accses.. wait a second and i'll edit the message with the mod.

+DOWNLOAD THE MOD!

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>

#define VIP_ACCESS            ADMIN_LEVEL_C

new Float:LastSpawnAttempt[33]
new 
bool:RoundEnded false

public plugin_init()

    
register_plugin("Random Respawn Chance""0.9""Bo0m!")
    
register_clcmd("say""spawnchance")
    
register_cvar("spawnchance_on","1")
    
register_cvar("spawnchance_msg","1")
    
register_cvar("spawnchance_msgtime","75")    
    
register_cvar("spawnchance_odds","10")
    
register_cvar("spawnchance_wait","150")
    
register_cvar("spawnchance_adminbonus","0")
    
register_logevent("event_RoundStarted"2"1=Round_Start")
    
register_logevent("event_RoundEnded"2"1=Round_End")
}

public 
plugin_precache()
{
    
precache_sound("debris/beamstart9.wav")
}

public 
client_putinserver(id)
{
    if(
is_user_bot(id)) 
        return 
PLUGIN_HANDLED

    set_task
(20.0"spawnmessage"id)
    
LastSpawnAttempt[id] = -5000.0
    
return PLUGIN_CONTINUE
}

public 
client_disconnect(id)
{
    if(
is_user_bot(id)) 
        return 
PLUGIN_HANDLED

    LastSpawnAttempt
[id] = -5000.0
    
return PLUGIN_CONTINUE
}

public 
event_RoundStarted()
{
    
RoundEnded false
}

public 
event_RoundEnded()
{
    
RoundEnded true
}

public 
spawnagain(id)
{
    
spawn(id)
    
give_item(id,"weapon_knife")
    return 
PLUGIN_CONTINUE
}

public 
spawnmessage(id)
{
    if (!
get_cvar_num("spawnchance_on") || !get_cvar_num("spawnchance_msg"))
    return 
PLUGIN_HANDLED

    
if(get_cvar_num("spawnchance_msgtime") < 10)
    {
        
server_cmd ("spawnchance_msgtime 10")
        return 
PLUGIN_CONTINUE
    
}

    if(
is_user_connected(id)) client_print(idprint_chat"[Respawn Chance] You have a 1 in %d chance to revive when dead! Say reviveme for your chance!",get_cvar_num("spawnchance_odds"))
    
set_task(get_cvar_float("spawnchance_msgtime"), "spawnmessage"id)
    return 
PLUGIN_HANDLED
}

public 
spawnchance(id)
{
    new 
Speech[192]
    
read_args(Speech,192)
    
remove_quotes(Speech)

    if(
get_cvar_num("spawnchance_odds") < 2)
    {
        
server_cmd ("spawnchance_odds 2")
        return 
PLUGIN_CONTINUE
    
}
    if(
get_cvar_num("spawnchance_odds") > 1000)
    {
        
server_cmd ("spawnchance_odds 1000")
        return 
PLUGIN_CONTINUE
    
}
    if(
get_cvar_num("spawnchance_wait") < 0)
    {
        
server_cmd ("spawnchance_wait 0")
        return 
PLUGIN_CONTINUE
    
}
    if(
get_cvar_num("spawnchance_wait") > 5000)
    {
        
server_cmd ("spawnchance_wait 5000")
        return 
PLUGIN_CONTINUE
    
}

    if(
spawnchance2(id,Speech))    
    return 
PLUGIN_HANDLED
    
return PLUGIN_CONTINUE
}

public 
spawnchance2(id,Speech[])
{
    if (
get_cvar_num("spawnchance_adminbonus") == && (get_user_flags(id) & ADMIN_IMMUNITY) )
    {
        
LastSpawnAttempt[id] = -5000.0
    
}
    if ( (
equali(Speech"respawnme")) || (equali(Speech"reviveme")) || (equali(Speech"revive me")) || (equali(Speech"/revive")) || (equali(Speech"/reviveme")) || (equali(Speech"respawn me")) && (get_user_flags(id) & VIP_ACCESS) )
    {
        if (
get_cvar_num("spawnchance_on") == 0)
        {
            
client_print(idprint_chat"Respawning is currently disabled.")
            return 
PLUGIN_HANDLED
        
}
        if (
cs_get_user_team(id) == CS_TEAM_SPECTATOR)
        {
            
client_print(idprint_chat"Spectators can't respawn silly!.")
            return 
PLUGIN_HANDLED
        
}
        if (
RoundEnded == true)
        {
            
client_print(idprint_chat"The round ended, you don't want to waste your chance!.")
            return 
PLUGIN_HANDLED
        
}
        if (
is_user_alive(id) == 1)
        {
            
client_print(id,print_chat"You have to be dead before you can attempt to respawn!")
            return 
PLUGIN_HANDLED
        
}
        else if (
get_gametime() < LastSpawnAttempt[id] + get_cvar_float("spawnchance_wait"))
        {
            
client_print(id,print_chat"Sorry you can't try to respawn now. Try again in %d seconds.",floatround(LastSpawnAttempt[id] + get_cvar_num("spawnchance_wait") - get_gametime() + 1))
            return 
PLUGIN_HANDLED
        
}

        new 
ChanceAmount random(get_cvar_num("spawnchance_odds"))
        new 
User[32]
        
get_user_name(id,User,32)
    
        if (
get_cvar_num("spawnchance_adminbonus") == && (get_user_flags(id) & ADMIN_IMMUNITY) )
        {
            
client_cmd(id,"spk debris/beamstart9")
            
client_print(id,print_chat"You win! Prepare to be respawned!")
            
spawn(id)
            
set_task(0.5,"spawnagain",id)
            
set_hudmessage(200,0,0, -1.00.3006.06.00.50.151)
                
show_hudmessage(0,"%s won and has been respawned!",User)
        }
        else
        {
            if (
== ChanceAmount)
            {
                
client_cmd(id,"spk debris/beamstart9")
                
client_print(id,print_chat"You win! Prepare to be respawned!")
                
spawn(id)
                
set_task(0.5,"spawnagain",id)
                
set_hudmessage(200,0,0, -1.00.3006.06.00.50.151)
                    
show_hudmessage(0,"%s won and has been respawned!",User)
            }
            else if (
ChanceAmount 1)
            {
                
client_print(id,print_chat"Sorry, you didn't respawn this time!")
            }

            
LastSpawnAttempt[id] = get_gametime()
            return 
PLUGIN_CONTINUE
        
}
        return 
PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE


Last edited by Pop0N; 12-24-2011 at 16:30.
Pop0N is offline
teckins
Member
Join Date: Aug 2011
Old 12-24-2011 , 16:28   Re: Only Vip can respawn twice
Reply With Quote #3

sure thanks
teckins is offline
teckins
Member
Join Date: Aug 2011
Old 12-24-2011 , 16:32   Re: Only Vip can respawn twice
Reply With Quote #4

vip access is O it says admin level C ? will it still respawn or what for vips? and its random respawn I want only only vip not random please fix thanks

Last edited by teckins; 12-24-2011 at 16:37.
teckins is offline
Pop0N
Member
Join Date: Apr 2011
Old 12-29-2011 , 15:09   Re: Only Vip can respawn twice
Reply With Quote #5

you just want if vip with flag O say /reviveme in chat he got revive?
Pop0N is offline
Reply


Thread Tools
Display Modes

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 20:49.


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