PHP- Kodu:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <colorchat>
#define PLUGIN "asasas"
#define VERSIYON "sasaass"
#define AUTHOR "peNgueN"
new gardiyan[ 33 ];
public plugin_init() {
register_plugin(PLUGIN, VERSIYON, AUTHOR);
register_clcmd( "say /hpmenu", "hpmenu" );
register_clcmd("HP", "Gardiyan_Hp");
}
public Gardiyan_Hp(id)
{
new say[ 300 ]
read_args( say, charsmax( say ) )
remove_quotes(say);
if( !is_str_num( say ) || equal( say, "" ) )
return PLUGIN_HANDLED;
HP( id, say );
return PLUGIN_CONTINUE
}
public HP( id, say[] )
{
new miktar = str_to_num( say );
new adminisim[ 64 ];
if(get_playersnum() > 0)
{
get_user_name( id, adminisim, charsmax( adminisim ) );
if(gardiyan[ id ] == 1) {
new oyuncular[ 32 ], onum;
get_players( oyuncular, onum, "ae", "CT" );
for( new i; i < onum; i++ )
{
set_user_health( oyuncular[ i ], get_user_health( oyuncular[ i ] ) + miktar );
}
ColorChat(0, GREEN,"%s ^1Gardiyanlara [^3 %d ^1] Can Verdi.", adminisim, miktar );
}
else if(gardiyan[ id ] == 2) {
new oyuncular[ 32 ], onum;
get_players( oyuncular, onum, "ae", "TERRORIST" );
for( new i; i < onum; i++ )
{
set_user_health( oyuncular[ i ], get_user_health( oyuncular[ i ] ) + miktar );
}
ColorChat(0, GREEN,"%s ^1Mahkumlara [^3 %d ^1] Can Verdi.", adminisim, miktar );
}
}
return PLUGIN_HANDLED;
}
public hpmenu(id)
{
new menu = menu_create("\y[ HP Ayarlari ]", "hpmenu2")
menu_additem(menu, "\yHerkesin \rHP'yi \y[ 100 ] Yap", "1", 0);
menu_additem(menu, "\yGardiyanlarin \rHP'yi \y[ 100 ] Yap", "2", 0);
menu_additem(menu, "\yMahkumlarin \rHP'yi \y[ 100 ] Yap", "3", 0);
menu_additem(menu, "\yGardiyanlarin \rHP'sini \yAyarla", "4", 0);
menu_additem(menu, "\yMahkumlarin \rHP'sini \yAyarla", "5", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
}
public hpmenu2(id,menu,item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new adnm[33]
get_user_name(id, adnm, 32)
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new key = str_to_num(data);
switch(key)
{
case 1:
{
new adnm[33]
get_user_name(id,adnm,32)
static players[32],inum,tempid;
get_players(players,inum,"ae","CT")
for(new i;i<inum;i++) {
tempid = players[i];
set_user_health(tempid, 100)
}
get_players(players,inum,"ae","TERRORIST")
for(new i;i<inum;i++) {
tempid = players[i];
set_user_health(tempid, 100)
}
ColorChat(0, GREEN,"%s ^1Herkesin Canini [^3 100 ^1] Yapti.",adnm);
//anamenu(id)
}
case 2:
{
new adnm[33]
get_user_name(id,adnm,32)
static players[32],inum,tempid;
get_players(players,inum,"ae","CT")
for(new i;i<inum;i++) {
tempid = players[i];
set_user_health(tempid, 100)
}
ColorChat(0, GREEN,"%s ^1Gardiyanlarin Canini [^3 100 ^1] Yapti.",adnm);
//anamenu(id)
}
case 3:
{
new adnm[33]
get_user_name(id,adnm,32)
static players[32],inum,tempid;
get_players(players,inum,"ae","TERRORIST")
for(new i;i<inum;i++) {
tempid = players[i];
set_user_health(tempid, 100)
}
ColorChat(0, GREEN,"%s ^1Mahkumlarin Canini [^3 100 ^1] Yapti.",adnm);
//anamenu(id)
}
case 4:
{
gardiyan[ id ] = 1;
client_cmd( id, "messagemode HP" );
}
case 5:
{
gardiyan[ id ] = 2;
client_cmd( id, "messagemode HP" );
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}