Raised This Month: $ Target: $400
 0% 

Simple plugin: round start/respawn


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
in0x0rable7
Junior Member
Join Date: Dec 2008
Old 06-27-2009 , 08:28   Simple plugin: round start/respawn
Reply With Quote #1

There is not enough respawn points in some deathrun maps. So I wanted to make a plugin that respawns player if he gets killed at the very beginning of a new round. The method I'm trying to use is very simple but it should work since in DR there's semi-clip.
The code I made:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

public plugin_init()
{
    
register_plugin("Resurrection""0.1""inox");    
}

public 
round_start(id)
{
    
set_task(0.2"killer"id)    
    
set_task(1.0"respawn"id)
}

public 
killer(id)
{
    if(
is_user_alive(id))
    {
        
user_kill(id)
    }
    return 
PLUGIN_HANDLED
}

public 
respawn(id)
{
    new 
name[32]
    
get_user_name(id,name,31)
    if(
is_user_alive(id))
    {
        return 
PLUGIN_HANDLED
    
}
    
ExecuteHamB(Ham_CS_RoundRespawnid)
    
client_print(idprint_chat"%s, you've been respawned due spawn issue."name)
    
client_print(idprint_chat"You're good to go !")
    return 
PLUGIN_HANDLED

'killer' function is only for testing purposes. The plugin completed with no errors or warning but it's not working anyway. I think, as I hardly understand pawn and actually this is my first plugin (so far I've only made some small changes to plugins), I've chosen incorrect 'round_start' function (I mean there's another function to do this job) or there's something wrong with 'set_tast'.
in0x0rable7 is offline
 



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 15:36.


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