[size=150]Counter Strike Zombie Deathmatch[/size]Salut!O sa va arat cat de simplu puteti crea extra-iteme la zombie pentru modul Zombie Deathmatch.
Includem <amxmodx> , <zombie_deathmatch> si celelalte module necesare:
- Cod:
-
#include <amxmodx>
#include <zombie_deathmatch>
Inregistram o variabila globala:
- Cod:
-
new g_new_zombie_item
Inregistram extra-itemul in meniu:
- Cod:
-
public plugin_init()
{
g_new_zombie_item = zd_register_zombie_item( "New Zombie Item", 3000)
/* 3000 reprezinta pretul */
}
Stabilim atributele extra-itemelor:
- Cod:
-
public zd_zombie_item_selected(iPlayer, iItemIndex)
{
if(g_new_zombie_item == iItemIndex)
{
client_print(iPlayer, print_chat, "[Zombie Deathmatch] You purchased a new zombie item!")
}
}
In final va arata asa:
[sursa=]#include <amxmodx>
#include <zombie_deathmatch>
new g_new_zombie_item
public plugin_init()
{
g_new_zombie_item = zd_register_zombie_item( "New Zombie Item", 3000)
}
public zd_zombie_item_selected(iPlayer, iItemIndex)
{
if(g_new_zombie_item == iItemIndex)
{
client_print(iPlayer, print_chat, "[Zombie Deathmatch] You purchased a new zombie item!")
}
}[/sursa]