mam prośbę o napisanie pluginu mini dm
a mianowicie chodzi o to aby
-respiło gracza 3 sekundy po śmierci oraz żeby dostawał awp i nóż
-nie respiło gracza który wejdzie na specta
napisałem takie coś ale jak gracz zacznie grac i chce wejść na spec to respi go i gra jak obserwator
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "PGC-CS.EU - AWP DM"
#define VERSION "1.01"
#define AUTHOR "rydy17"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg","smierc","a")
register_event( "TeamInfo", "dolacz", "a")
}
public dolacz()
{
new gracz = read_data(1)
new druzyna[32]
read_data(2,druzyna,31)
if(!equal(druzyna,"SPECTATOR"))
{
if(get_cvar_num("amx_debug") == 1)
{
if(!is_user_connected(gracz))
{
return PLUGIN_HANDLED
}
else
{
spawn_func(gracz)
}
}
else
{
return PLUGIN_HANDLED
}
}
return PLUGIN_CONTINUE
}
public spawn_func(id)
{
new tab[1]
tab[0]=id
if(!is_user_alive(tab[0]))
{
set_task(3.0,"gracz_spawn",72,tab,1)
set_task(4.0,"gracz_giveitems",72,tab,1)
}
else
{
set_task(1.0,"gracz_giveitems",72,tab,1)
}
}
public gracz_spawn(tab[1])
{
spawn(tab[0])
}
public gracz_giveitems(tab[1])
{
strip_user_weapons(tab[0]);
give_item(tab[0], "weapon_awp");
give_item(tab[0], "ammo_338magnum");
give_item(tab[0], "ammo_338magnum");
give_item(tab[0], "ammo_338magnum");
give_item(tab[0], "weapon_knife");
return PLUGIN_CONTINUE
}
public smierc()
{
new victim_id = read_data(2)
spawn_func( victim_id )
return PLUGIN_CONTINUE
}