AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Zspawn plugin (https://forums.alliedmods.net/showthread.php?t=131041)

LOLZEYE 06-30-2010 12:38

Zspawn plugin
 
Hello,could someone make from this plugin
Code:

#include <amxmodx>
#include <hamsandwich>
#include <zombieplague>

#define PLUGIN "[ZP] Extra Item : Respawn"
#define VERSION "1.0"
#define AUTHOR "Fry!"

#define RESPAWN_COST 8

new g_item_name[] = { "Respawn" }
new g_itemid_respawn

new bool:g_canRespawn[33]

public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR)
       
        register_event("DeathMsg", "Death", "a")
       
        g_itemid_respawn = zp_register_extra_item(g_item_name,RESPAWN_COST, ZP_TEAM_HUMAN)
}

public client_connect(id)
{
        g_canRespawn[id] = false
}

public client_disconnect(id)
{
        g_canRespawn[id] = false
}

public Death()
{
        g_canRespawn[read_data(2)] = true;
}

public zp_extra_item_selected(player, itemid)
{
        if (itemid == g_itemid_respawn)
        {
                if ( g_canRespawn[player] && !is_user_alive(player) && !is_user_bot(player) && !zp_get_user_zombie(player))
                {
                        g_canRespawn[player] = false;

                        set_task(2.0, "respawn", player)
                }
        }
}

public respawn(player)
        ExecuteHamB(Ham_CS_RoundRespawn, player);


An plugin for biohazard? Respawn will be free,just if you type /zspawn it will work or if you could make respawn it automaticly(after player died)...(just for zombies,humans no)

(I've tried to spawn the zombies whit CSDM 2.0 but it respawns the zombies half humans half zombies or entire humans even if they are zombies)

5c0r-|3i0 06-30-2010 20:33

Re: Zspawn plugin
 
Remove the itemid .....add a new clientcmd that will call the function zp_extra_item_selected , then check if user is a zombie ( is_user_zombie(index) - biohazard's native..)
Then you're done !
2) About automically respawn...Search in Biohazard thread !
3) What version of biohazard are u using ?

LOLZEYE 07-01-2010 15:08

Re: Zspawn plugin
 
i am using biohazard 3b..and i do not know about how to remake an plugin:|


All times are GMT -4. The time now is 14:54.

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