PHP- Kodu:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fakemeta_util>
#include <jail>
#include <fun>
#include <hamsandwich>
#define PLUGIN "JB Meslek"
#define VERSION "1.0"
#define AUTHOR "akcaliberkk & JDM"
new meslek[33];
new bool:timeout[33];
new healtime[33];
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("meslekmenu","ShowMenu")
register_logevent("eRS",2,"1=Round_Start")
register_event("DeathMsg","eDeath","a")
register_forward( FM_EmitSound, "fw_EmitSound" );
RegisterHam(Ham_Spawn,"player","HamPlayerSpawnPost",1)
}
public client_connect(id) {
client_cmd(id,"bind b meslekmenu")
}
public client_disconnect(id) {
if(meslek[id] == 3) remove_task(id+513)
if(meslek[id] == 4) remove_task(id+514)
}
public eRS() {
new players[32],inum;
get_players(players,inum)
for(new i;i<inum;i++) {
timeout[players[i]] = false;
healtime[players[i]] = 2;
}
}
public HamPlayerSpawnPost(id) {
if(meslek[id] == 5) {
give_item(id,"weapon_hegrenade")
give_item(id,"weapon_smokegrenade")
give_item(id,"weapon_flashbang")
}
else if( meslek[ id ] == 6 )
{
set_user_health( id, 250 );
}
}
public ShowMenu(id) {
new menu = menu_create("\rMENU","menu_handler")
menu_additem(menu,"Doktor - \dHer El 2 Kisiye HP Verebilir.","1")
menu_additem(menu,"Avci - \dHer CT Oldurdugunde 20 JB Kazanir","2")
menu_additem(menu,"TL Hirsizi - \dHer 30 Dakikada 30 JB Kazanir","3")
menu_additem(menu,"Online Meslegi - \dHer 30 Dakikada 30 JB Kazanir","4")
menu_additem(menu,"Bombaci - \dHer El Butun Bomba Seti","5")
menu_additem(menu,"Terminator - \dHer El 250 HP ile Baslar","6")
menu_setprop(menu,MPROP_EXIT,MEXIT_ALL)
menu_display(id,menu,0)
return PLUGIN_HANDLED
}
public menu_handler(id,menu,item) {
if(item == MENU_EXIT) {
menu_destroy(menu)
return PLUGIN_HANDLED
}
new name[64],data[6];
new access,callback;
menu_item_getinfo(menu,item,access,data,5,name,63,callback)
switch(str_to_num(data)) {
case 1:{
if(timeout[id]) {
client_print(id,print_chat,"[JB MESLEK] En az bir el dolmadan meslek degistiremezsiniz.")
return PLUGIN_HANDLED
}
if(meslek[id] == 1) {
client_print(id,print_chat,"[JB MESLEK] Mesleginiz Zaten Doktor !")
return PLUGIN_HANDLED
}
if(meslek[id] == 3) remove_task(id+513)
if(meslek[id] == 4) remove_task(id+514)
timeout[id] = true;
meslek[id] = 1;
client_print(id,print_chat,"[JB MESLEK] Mesleginizi Doktor Olarak Sectiniz !")
client_print(id,print_chat,"[JB MESLEK] Can vermek istediginiz kisiye dogru bakarak E tusuna basin.")
}
case 2:{
if(timeout[id]) {
client_print(id,print_chat,"[JB MESLEK] En az bir el dolmadan meslek degistiremezsiniz.")
return PLUGIN_HANDLED
}
if(meslek[id] == 2) {
client_print(id,print_chat,"[JB MESLEK] Mesleginiz Zaten Avci !")
return PLUGIN_HANDLED
}
if(meslek[id] == 3) remove_task(id+513)
if(meslek[id] == 4) remove_task(id+514)
timeout[id] = true;
meslek[id] = 2;
client_print(id,print_chat,"[JB MESLEK] Mesleginizi Avci Olarak Sectiniz !")
}
case 3:{
if(timeout[id]) {
client_print(id,print_chat,"[JB MESLEK] En az bir el dolmadan meslek degistiremezsiniz.")
return PLUGIN_HANDLED
}
if(meslek[id] == 3) {
client_print(id,print_chat,"[JB MESLEK] Mesleginiz Zaten TL Hirsizi !")
return PLUGIN_HANDLED
}
if(meslek[id] == 4) remove_task(id+513)
timeout[id] = true;
meslek[id] = 3;
client_print(id,print_chat,"[JB MESLEK] Mesleginizi TL Hirsizi Olarak Sectiniz !")
set_task(1800.0,"GiveJB2",id+514,_,_,"b")
}
case 4:{
if(timeout[id]) {
client_print(id,print_chat,"[JB MESLEK] En az bir el dolmadan meslek degistiremezsiniz.")
return PLUGIN_HANDLED
}
if(meslek[id] == 4) {
client_print(id,print_chat,"[JB MESLEK] Mesleginiz Zaten Online Meslegi !")
return PLUGIN_HANDLED
}
if(meslek[id] == 3) remove_task(id+514)
timeout[id] = true;
meslek[id] = 4;
client_print(id,print_chat,"[JB MESLEK] Mesleginizi Online Meslegi Olarak Sectiniz !")
set_task(1800.0,"GiveJB",id+513,_,_,"b")
}
case 5: {
if(timeout[id]) {
client_print(id,print_chat,"[JB MESLEK] En az bir el dolmadan meslek degistiremezsiniz.")
return PLUGIN_HANDLED
}
if(meslek[id] == 5) {
client_print(id,print_chat,"[JB MESLEK] Mesleginiz Zaten Bombaci !")
return PLUGIN_HANDLED
}
if(meslek[id] == 3) remove_task(id+513)
if(meslek[id] == 4) remove_task(id+514)
timeout[id] = true;
meslek[id] = 5;
client_print(id,print_chat,"[JB MESLEK] Mesleginizi Bombaci Olarak Sectiniz !")
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_smokegrenade")
}
case 6: {
if(timeout[id]) {
client_print(id,print_chat,"[JB MESLEK] En az bir el dolmadan meslek degistiremezsiniz.")
return PLUGIN_HANDLED
}
if(meslek[id] == 6) {
client_print(id,print_chat,"[JB MESLEK] Mesleginiz Zaten Terminator !")
return PLUGIN_HANDLED
}
if(meslek[id] == 3) remove_task(id+513)
if(meslek[id] == 4) remove_task(id+514)
timeout[id] = true;
meslek[id] = 6;
client_print(id, print_chat,"[JB MESLEK] Mesleginizi Terminator Olarak Sectiniz !")
set_user_health(id, 250)
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}
public GiveJB(taskid) {
new id = taskid - 513;
jb_set_user_packs(id,jb_get_user_packs(id) + 30)
client_print(id,print_chat,"[JB MESLEK] 30 dakikadir oyunda oldugunuz icin. 30 JB kazandiniz !")
}
public GiveJB2(taskid) {
new id = taskid - 514;
jb_set_user_packs(id,jb_get_user_packs(id) + 30)
client_print(id,print_chat,"[JB MESLEK] 30 dakikadir oyunda oldugunuz icin. 30 JB kazandiniz !")
}
public eDeath() {
new killer = read_data(1);
new victim = read_data(2);
if(get_user_team(killer) == 1 && get_user_team(victim) == 2 && meslek[killer] == 2) {
jb_set_user_packs(killer,jb_get_user_packs(killer) + 20)
client_print(killer,print_chat,"[JB MESLEK] Bir CT oldurdugunuz icin 20 JB kazandiniz !")
}
}
public fw_EmitSound( id, iChannel, szSound[], Float:flVol, Float:flAtt, iFlags, iPitch ) {
if( equal( szSound, "common/wpn_denyselect.wav" ) && meslek[id] == 1){
new Uid,body,Float:dist;
dist = get_user_aiming(id,Uid,body)
if(Uid) {
if(dist > 70.0) {
client_print(id,print_chat,"[JB MESLEK] Hedef Cok Uzakta !")
client_print(id,print_center,"HEALTHKIT = %d/2",healtime[id])
}
else {
if(!healtime[id]) {
client_print(id,print_chat,"[JB MESLEK] Hakkiniz Doldu Sonraki Eli Bekleyin. !")
client_print(id,print_center,"HEALTHKIT = 0/2")
}
else {
--healtime[id];
client_print(id,print_center,"HEALTHKIT = %d/2",healtime[id])
set_user_health(Uid,get_user_health(Uid) + 20)
client_print(id,print_chat,"[JB MESLEK] Hedefe 20 HP Verildi !")
}
}
}
}
}
*Hata 1 - Plugınde 3. ve 4. meslekler aynı