Witam posiadam pluginy "System many" i za każdego killa dostajemy 1 pkt. many lecz czy dało by zrobić, gdy zabijemy kogoś mamy 50% szansy na zdobycie pkt. many ? Jeżeli tak to proszę o pomoc.
Kod pluginy:
#include <amxmodx> #include <amxmisc> #include <nvault> #define PLUGIN "System Monet" #define AUTHOR "kisiel96" #define VERSION "1.0.8" new nazwa_gracza[32][64]; new identyfikator[32][64]; new zloto[32]; new cvar_gold_kill, cvar_gold_kill_hs; new cvar_gold_ff; new cvar_typ_zapisu; new gold_kill, gold_kill_hs; new gold_ff; new typ_zapisu; new vault; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_event("DeathMsg", "DeathMsg", "a"); cvar_gold_ff = register_cvar("cod_gold_friendlyfire", "0"); cvar_gold_kill = register_cvar("cod_gold_kill", "1"); cvar_gold_kill_hs = register_cvar("cod_gold_kill_hs", "3"); cvar_typ_zapisu = get_cvar_pointer("cod_savetype"); vault=nvault_open("zloto"); if(vault == INVALID_HANDLE) set_fail_state("Nie mozna otworzyc pliku"); } public plugin_natives() { register_native("cod_get_user_gold", "PobierzZloto", 1); register_native("cod_set_user_gold", "UstawZloto", 1); } public client_authorized(id) { UsunZloto(id); get_user_name(id, nazwa_gracza[id], 63); typ_zapisu = get_pcvar_num(cvar_typ_zapisu); switch(typ_zapisu) { case 1: copy(identyfikator[id], 63, nazwa_gracza[id]); case 2: get_user_authid(id, identyfikator[id], 63); case 3: get_user_ip(id, identyfikator[id], 63); } Wczytaj(id); } public client_connect(id) Wczytaj(id); public client_disconnect(id) { Zapisz(id); UsunZloto(id) } public plugin_end() nvault_close(vault); public UsunZloto(id) zloto[id] = 0; public DeathMsg() { new kid = read_data(1); new vid = read_data(2); new hs = read_data(3); if(kid == vid) return; gold_ff = get_pcvar_num(cvar_gold_ff) if(gold_ff == 0 && get_user_team(kid) == get_user_team(vid)) return; gold_kill = get_pcvar_num(cvar_gold_kill); gold_kill_hs = get_pcvar_num(cvar_gold_kill_hs); if(hs == 1) zloto[kid] += gold_kill_hs; else zloto[kid] += gold_kill; } public UstawZloto(id, wartosc) { zloto[id] = wartosc } public PobierzZloto(id) return zloto[id]; public Zapisz(id) { new vaultkey[64], vaultdata[256]; format(vaultkey, 63, "%s-zloto", identyfikator[id]); format(vaultdata, 255, "%d#", zloto[id]); nvault_set(vault, vaultkey, vaultdata); return PLUGIN_CONTINUE } public Wczytaj(id) { new vaultkey[64], vaultdata[256]; format(vaultkey, 63, "%s-zloto", identyfikator[id]); format(vaultdata, 255, "%d#", zloto[id]); nvault_get(vault, vaultkey, vaultdata,255); replace_all(vaultdata, 255, "#", " "); new zlototemp[33]; parse(vaultdata, zlototemp, 32); zloto[id] = str_to_num(zlototemp); return PLUGIN_CONTINUE }