Operasyon Menüm Hakkında Yardım

Konu

#1
Bana bazı kodlar lazım arkadaşlar

Kişiyi öldür
Kişiyi Hs İle Öldür
Bomba Kur 
Hasar ver

bunların kodları lazım

mesela adam belirtilen kişiyi öldürünce para vericek.
bulamadım yardımcı olurmusunuz
Cevapla
#2
JBMenu, BBMenü, EDO Sistemleri bunlarda aradığın kodlar var tek tek atmaya gerek yok araştırarak öğrenmek en kalıcı çözüm.
İletişim bilgilerim;
Cevapla
#3
tmm knk birde diğer eklenti istekte açtığım konuya bakarmısın chattan adam vurmadığım hadle menüye basınca 171481481 adam vurdugun için csgo parası kazandı diyor Çok güldüm

bak bu operasyon sistemi var ordan bakabilirmiyim sence ?


PHP Kod:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <nvault>
#include <csgomod>

#define PLUGIN "CS:GO Operations"
#define VERSION "1.4"
#define AUTHOR "O'Zone"

new operationDescription[][] = {
    
"Islem Yok %i",
    
"Oldurmek zorundasin: %i",
    
"Kafadan oldurmek zorundasin: %i",
    
"Bomba kurmalisin veya imha etmelisin: %i",
    
"Hasar vermelisin: %i"
};

enum _:operationType TYPE_NONETYPE_KILLTYPE_HEADSHOTTYPE_BOMBTYPE_DAMAGE };
enum _:playerInfo PLAYER_IDPLAYER_TYPEPLAYER_ADDITIONALPLAYER_PROGRESSPLAYER_NAME[32] };
enum _:operationsInfo OPERATION_AMOUNTOPERATION_TYPEOPERATION_REWARD };

new const 
commandQuest[][] = { "say /operasyon""say_team /operasyon" };
new const 
commandProgress[][] = { "say /ilerleme""say_team /ilerleme" };
new const 
commandEnd[][] = { "say /durdur""say_team /durdur","say /operasyondurdur""say_team /operasyondurdur"};

new 
playerData[MAX_PLAYERS 1][playerInfo], Array:operationListminPlayersoperationsloaded;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);

    
bind_pcvar_num(register_cvar("csgo_operations_min_players""4"), minPlayers);

    for(new 
isizeof commandQuesti++) register_clcmd(commandQuest[i], "operation_menu");
    for(new 
isizeof commandProgressi++) register_clcmd(commandProgress[i], "check_operation");
    for(new 
isizeof commandEndi++) register_clcmd(commandEnd[i], "reset_operation");

    
RegisterHam(Ham_TakeDamage"player""player_take_damage_post"1);

    
register_logevent("log_event_operation"3"1=triggered");

    
operations nvault_open("csgo_operations");

    if (
operations == INVALID_HANDLEset_fail_state("Dosya acilamadi csgo_operations.vault");

    
operationList ArrayCreate(operationsInfo);
}

public 
plugin_natives()
{
    
register_native("csgo_get_user_operation""_csgo_get_user_operation"1);
    
register_native("csgo_get_user_operation_text""_csgo_get_user_operation_text"1);
    
register_native("csgo_get_user_operation_progress""_csgo_get_user_operation_progress"1);
    
register_native("csgo_get_user_operation_need""_csgo_get_user_operation_need"1);
}

public 
plugin_cfg()
{
    new 
filePath[64];

    
get_localinfo("amxx_configsdir"filePathcharsmax(filePath));
    
format(filePathcharsmax(filePath), "%s/csgo_operations.ini"filePath);

    if (!
file_exists(filePath)) {
        new 
error[128];

        
formatex(errorcharsmax(error), "[CS:GO] dosya bulunamadi! %s"filePath);

        
set_fail_state(error);
    }

    new 
lineData[128], operationData[4][16], operationInfo[operationsInfo], file fopen(filePath"r");

    
ArrayPushArray(operationListoperationInfo);

    while (!
feof(file)) {
        
fgets(filelineDatacharsmax(lineData));

        if (
lineData[0] == ';' || lineData[0] == '^0') continue;

        
parse(lineDataoperationData[0], charsmax(operationData[]), operationData[1], charsmax(operationData[]), operationData[2], charsmax(operationData[]));

        
operationInfo[OPERATION_AMOUNT] = str_to_num(operationData[0]);
        
operationInfo[OPERATION_TYPE] = str_to_num(operationData[1]);
        
operationInfo[OPERATION_REWARD] = str_to_num(operationData[2]);

        
ArrayPushArray(operationListoperationInfo);
    }

    
fclose(file);
}

public 
plugin_end()
    
nvault_close(operations);

public 
client_disconnected(id)
    
rem_bit(idloaded);

public 
client_putinserver(id)
{
    
reset_operation(id11);

    if (
is_user_bot(id) || is_user_hltv(id)) return PLUGIN_HANDLED;

    
get_user_name(idplayerData[id][PLAYER_NAME], charsmax(playerData[][PLAYER_NAME]));

    
load_operation(id);

    return 
PLUGIN_HANDLED;
}

public 
operation_menu(id)
{
    if (!
csgo_check_account(id)) return PLUGIN_HANDLED;

    new 
menu menu_create("\wOperasyon Menusu\w:""operation_menu_handle"), callback menu_makecallback("operation_menu_callback");

    
menu_additem(menu"Islemleri Secin"__callback);
    
menu_additem(menu"Islemleri Durdur"__callback);
    
menu_additem(menu"Operasyon Ilerlemesi"__callback);

    
menu_addtext(menu"^n\wOperasyon sonunda odul olarak TL verilecektir.\w."0);
    
menu_addtext(menu"\wAyni islemi bircok kez yapabilirsin."0);

    
menu_setprop(menuMPROP_EXITNAME"Cikis");

    
menu_display(idmenu);

    return 
PLUGIN_HANDLED;
}

public 
operation_menu_handle(idmenuitem)
{
    if (!
is_user_connected(id)) return PLUGIN_HANDLED;

    if (
item == MENU_EXIT) {
        
menu_destroy(menu);

        return 
PLUGIN_HANDLED;
    }

    switch(
item) {
        case 
0select_operation(id);
        case 
1reset_operation(id00);
        case 
2check_operation(id);
    }

    return 
PLUGIN_HANDLED;
}

public 
operation_menu_callback(idmenuitem)
{
    switch(
item) {
        case 
0: if (playerData[id][PLAYER_TYPE]) return ITEM_DISABLED;
        case 
12: if (!playerData[id][PLAYER_TYPE]) return ITEM_DISABLED;
    }

    return 
ITEM_ENABLED;
}

public 
select_operation(id)
{
    if (!
is_user_connected(id)) return PLUGIN_HANDLED;

    if (
playerData[id][PLAYER_TYPE]) {
        
client_print_color(idid"^x04[CS:GO]^x01 Once gecerli olan operasyonu bitir veya durdur!^x01.");

        return 
PLUGIN_HANDLED;
    }

    new 
menuData[128], operationId[3], operationInfo[operationsInfo], menu menu_create("\yGorev Secin\w:""select_operation_handle");

    for (new 
0ArraySize(operationList); i++) {
        
ArrayGetArray(operationListioperationInfo);

        switch(
operationInfo[OPERATION_TYPE]) {
            case 
TYPE_KILLformatex(menuDatacharsmax(menuData), "%i Kisiyi oldur \y(Odul: %i TL)"operationInfo[OPERATION_AMOUNT], operationInfo[OPERATION_REWARD]);
            case 
TYPE_HEADSHOTformatex(menuDatacharsmax(menuData), "%i Kisiyi HS ile oldur \y(Odul: %i TL)",  operationInfo[OPERATION_AMOUNT], operationInfo[OPERATION_REWARD]);
            case 
TYPE_BOMBformatex(menuDatacharsmax(menuData), "%i Bomba kur/imha et \y(Odul: %i TL)",  operationInfo[OPERATION_AMOUNT], operationInfo[OPERATION_REWARD]);
            case 
TYPE_DAMAGEformatex(menuDatacharsmax(menuData), "%i Hasar ver \y(Odul: %i TL)",  operationInfo[OPERATION_AMOUNT], operationInfo[OPERATION_REWARD]);
            case 
TYPE_NONE: continue;
        }

        
num_to_str(ioperationIdcharsmax(operationId));

        
menu_additem(menumenuDataoperationId);
    }

    
menu_setprop(menuMPROP_EXITNAME"Cikis");

    
menu_display(idmenu);

    return 
PLUGIN_HANDLED;
}

public 
select_operation_handle(idmenuitem)
{
    if (!
is_user_connected(id)) return PLUGIN_HANDLED;

    if (
item == MENU_EXIT) {
        
menu_destroy(menu);

        return 
PLUGIN_HANDLED;
    }

    new 
operationId[3], itemAccessitemCallback;

    
menu_item_getinfo(menuitemitemAccessoperationIdcharsmax(operationId), __itemCallback);

    
reset_operation(id11);

    
playerData[id][PLAYER_ID] = str_to_num(operationId);
    
playerData[id][PLAYER_TYPE] = get_operation_info(playerData[id][PLAYER_ID], OPERATION_TYPE);

    
save_operation(id);

    
client_print_color(idid"^x04[CS:GO]^x01 Operasyona basladin. Iyi sanslar.");

    
menu_destroy(menu);

    return 
PLUGIN_HANDLED;
}

public 
client_death(killervictimweaponIdhitPlaceteamKill)
{
    if (!
is_user_connected(killer) || !is_user_connected(victim) || !is_user_alive(killer) || get_user_team(victim) == get_user_team(killer)) return PLUGIN_CONTINUE;

    switch (
playerData[killer][PLAYER_TYPE]) {
        case 
TYPE_KILLadd_progress(killer);
        case 
TYPE_HEADSHOT: if (hitPlace == HIT_HEADadd_progress(killer);
    }

    return 
HAM_IGNORED;
}

public 
player_take_damage_post(victiminflictorattackerFloat:damagedamageBits)
{
    if (!
is_user_connected(attacker) || !is_user_connected(victim) || get_user_team(victim) == get_user_team(attacker)) return HAM_IGNORED;

    if (
playerData[attacker][PLAYER_TYPE] == TYPE_DAMAGEadd_progress(attackerfloatround(damage));

    return 
HAM_IGNORED;
}

public 
log_event_operation()
{
    new 
userLog[80], userAction[64], userName[32];

    
read_logargv(0userLogcharsmax(userLog));
    
read_logargv(2userActioncharsmax(userAction));
    
parse_loguser(userLoguserNamecharsmax(userName));

    new 
id get_user_index(userName);

    if (!
is_user_connected(id) || playerData[id][PLAYER_TYPE] == TYPE_NONE) return PLUGIN_HANDLED;

    if ((
equal(userAction"Planted_The_Bomb") || equal(userAction"Defused_The_Bomb")) && playerData[id][PLAYER_TYPE] == TYPE_BOMBadd_progress(id);

    return 
PLUGIN_HANDLED;
}

public 
give_reward(id)
{
    if (!
is_user_connected(id)) return PLUGIN_HANDLED;

    new 
reward get_operation_info(playerData[id][PLAYER_ID], OPERATION_REWARD);

    
csgo_add_money(idfloat(reward));

    
reset_operation(id01);

    
client_print_color(idid"^x04[CS:GO]^x01 Tebrikler! operasyon tamamlandi. Su odulu kazandin^x03 %i TL^x01."reward);

    return 
PLUGIN_HANDLED;
}

public 
check_operation(id)
{
    if (!
playerData[id][PLAYER_TYPE]) client_print_color(idid"^x04[CS:GO]^x01 Hicbir islem yapmiyorsun.");
    else {
        new 
message[128];

        
formatex(messagecharsmax(message), operationDescription[playerData[id][PLAYER_TYPE]], (get_progress_need(id) - get_progress(id)));

        
client_print_color(idid"^x04[CS:GO]^x01 Operasyon ilerlemesi:^x03 %s^x01."message);
    }

    return 
PLUGIN_HANDLED;
}

public 
save_operation(id)
{
    if (!
get_bit(idloaded)) return PLUGIN_HANDLED;

    new 
vaultKey[64], vaultData[64];

    
formatex(vaultKeycharsmax(vaultKey), "%s"playerData[id][PLAYER_NAME]);
    
formatex(vaultDatacharsmax(vaultData), "%i %i %i %i"playerData[id][PLAYER_ID], playerData[id][PLAYER_TYPE], playerData[id][PLAYER_ADDITIONAL], playerData[id][PLAYER_PROGRESS]);

    
nvault_set(operationsvaultKeyvaultData);

    return 
PLUGIN_HANDLED;
}

public 
load_operation(id)
{
    new 
vaultKey[64], vaultData[64], operationData[4][16], operationParam[4];

    
formatex(vaultKeycharsmax(vaultKey), "%s"playerData[id][PLAYER_NAME]);

    if (
nvault_get(operationsvaultKeyvaultDatacharsmax(vaultData))) {
        
parse(vaultDataoperationData[0], charsmax(operationData[]), operationData[1], charsmax(operationData[]), operationData[2], charsmax(operationData[]), operationData[3], charsmax(operationData[]));

        for (new 
0sizeof operationParami++) operationParam[i] = str_to_num(operationData[i]);

        if (
operationParam[0] > -1) {
            
playerData[id][PLAYER_ID] = operationParam[0];
            
playerData[id][PLAYER_TYPE] = operationParam[1];
            
playerData[id][PLAYER_ADDITIONAL] = operationParam[2];
            
playerData[id][PLAYER_PROGRESS] = operationParam[3];
        }
    }

    
set_bit(idloaded);

    return 
PLUGIN_HANDLED;
}
get_user_deaths(id)
public 
reset_operation(iddatasilent)
{
    
playerData[id][PLAYER_TYPE] = TYPE_NONE;
    
playerData[id][PLAYER_ID] = -1;
    
playerData[id][PLAYER_PROGRESS] = 0;

    if (!
datasave_operation(id);

    if (!
silentclient_print_color(idid"^x04[CS:GO]^x01 Basladiginiz operasyon durduruldu!");

    return 
PLUGIN_HANDLED;
}

stock get_operation_info(operationinfo)
{
    new 
operationInfo[operationsInfo];

    
ArrayGetArray(operationListoperationoperationInfo);

    return 
operationInfo[info];
}

stock add_progress(idamount 1)
{
    if (!
is_user_connected(id) || get_playersnum() < minPlayers) return PLUGIN_HANDLED;

    
playerData[id][PLAYER_PROGRESS] += amount;

    if (
get_progress(id) >= get_progress_need(id)) give_reward(id);
    else 
save_operation(id);

    return 
PLUGIN_HANDLED;
}

stock get_progress(id)
    return 
playerData[id][PLAYER_ID] > -playerData[id][PLAYER_PROGRESS] : -1;

stock get_progress_need(id)
    return 
playerData[id][PLAYER_TYPE] ? get_operation_info(playerData[id][PLAYER_ID], OPERATION_AMOUNT) : -1;

public 
_csgo_get_user_operation(id)
    return 
playerData[id][PLAYER_ID];

public 
_csgo_get_user_operation_text(iddataReturn[], dataLength)
{
    
param_convert(2);

    if (
playerData[id][PLAYER_ID] > -1formatex(dataReturndataLength"%i/%i (%0.1f%s)"get_progress(id), get_progress_need(id), float(get_progress(id)) / float(get_progress_need(id)) * 100.0"%");
    else 
formatex(dataReturndataLength"/operasyon");
}

public 
_csgo_get_user_operation_progress(id)
    return 
get_progress(id);

public 
_csgo_get_user_operation_need(id)
    return 
get_progress_need(id); 

yok knk bulamadım ya
Son Düzenleme: 22-09-2020, 01:19, Düzenleyen: Muhammet Bulut.
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Benzer Konular

Kayıt Ol
Discord Adresimize Katılın