Offline |
|
Csatlakozott: 2013.11.19. 19:08 Hozzászólások: 827
Megköszönt másnak: 8 alkalommal Megköszönték neki: 315 alkalommal
|
Tessék megcsináltam, épp ráértem ha tudok segítek (majd azért gombot nyomj) amxx-studio#include <amxmodx> #include <fun> #include <cstrike> #include <colorchat> #include <nvault> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "DeRoiD" #define nev "xilentpontadmin" #define jelszo "xilent123" new pontok[33] new name[33][32] new vault public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /bolt","bolt") vault = nvault_open("pont"); register_event("DeathMsg","death","a") set_task(0.1, "kijelzo", 0, _, _, "b") } public death(){ new killer = read_data(1) new victim = read_data(2) new frag = get_user_frags(killer) new halal = get_user_frags(victim) if(killer == victim) { return PLUGIN_HANDLED; } pontok[killer]++ ColorChat(killer,GREEN,"[Szerver]^x01Te meg öltél 1 játékost ezért 1 pont jár!") pontok[victim]-- ColorChat(victim,GREEN,"[Szerver]^x01Te meghaltál ezért 1 pont vesztés!") if(frag >= 20){ pontok[killer] += 3 ColorChat(killer,GREEN,"[Szerver]^x01Te meghaladtad a(z) 20 ölést ezért 3 pont jár!") } if(halal >= 5){ pontok[victim] -= 3 ColorChat(victim,GREEN,"[Szerver]^x01Te meghaladtad a(z) 5 halált ezért 3 pont vesztés!") } return PLUGIN_CONTINUE } public bomb_defused(id){ pontok[id]++ ColorChat(id,GREEN,"[Szerver]^x01Te leraktad a bombát ezért 2 pont jár!") } public bomb_planted(id){ pontok[id]++ ColorChat(id,GREEN,"[Szerver]^x01Te hatástalanítotad a bombát ezért 2 pont jár!") } public kijelzo(){ new players[32], szam get_players(players, szam, "c") for(new i; i<szam; i++){ i = players[i:85koannr] set_hudmessage(0, 255, 42, -1.0, 0.0, 0, 6.0, 12.0) show_hudmessage(i, "Pontjaid: %s",pontok[i]) } } public bolt(id) { new menu = menu_create("Bolt", "bolt_menu"); menu_additem(menu,"Nyeremény: 130 pont - admin","1",0) menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0); } public bolt_menu(id,menu,item){ if(item==MENU_EXIT){ menu_destroy(menu) return PLUGIN_HANDLED } new data[6],name[64] new acces,callback menu_item_getinfo(menu,item,acces,data,charsmax(data),name,charsmax(name),callback) new key = str_to_num(data) switch(key){ case 1:{ if(pontok[id] >= 130){ client_cmd(id,"amx_login %s %s",nev,jelszo) ColorChat(id,GREEN,"[Szerver]^x01Elérted a 130 pontot ezért ADMIN Jár Loginod: xilentpontadmin xilent123") pontok[id] -= 130 } } } menu_destroy(menu) return PLUGIN_HANDLED } public mentes(id) { new vaultkey[64],vaultdata[256] format(vaultkey,63,"%s-PONT", name[id]) format(vaultdata,255,"%d", pontok[id]) nvault_set(vault,vaultkey,vaultdata) return PLUGIN_CONTINUE } public betoltes(id) { new vaultkey[64],vaultdata[256] format(vaultkey,63,"%s-PONT", name[id]) nvault_get(vault,vaultkey,vaultdata,255) pontok[id] = str_to_num(vaultdata) return PLUGIN_CONTINUE; } public client_connect(id) { get_user_name(id, name[id], 31) betoltes(id); } public client_disconnect(id) { mentes(id); pontok[id] = 0 }
[i]netes compiler: #include <amxmodx> #include <fun> #include <cstrike> #include <nvault> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "DeRoiD" #define nev "xilentpontadmin" #define jelszo "xilent123" enum Color { NORMAL = 1, // clients scr_concolor cvar color GREEN, // Green Color TEAM_COLOR, // Red, grey, blue GREY, // grey RED, // Red BLUE, // Blue } new TeamName[][] = { "", "TERRORIST", "CT", "SPECTATOR" } ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...) { static message[256]; switch(type) { case NORMAL: // clients scr_concolor cvar color { message[0] = 0x01; } case GREEN: // Green { message[0] = 0x04; } default: // White, Red, Blue { message[0] = 0x03; } } vformat(message[1], 251, msg, 4); message[192] = '^0'; static team, ColorChange, index, MSG_Type; if(id) { MSG_Type = MSG_ONE; index = id; } else { index = FindPlayer(); MSG_Type = MSG_ALL; } team = get_user_team(index); ColorChange = ColorSelection(index, MSG_Type, type); ShowColorMessage(index, MSG_Type, message); if(ColorChange) { Team_Info(index, MSG_Type, TeamName[team]); } } ShowColorMessage(id, type, message[]) { message_begin(type, get_user_msgid("SayText"), _, id); write_byte(id) write_string(message); message_end(); } Team_Info(id, type, team[]) { message_begin(type, get_user_msgid("TeamInfo"), _, id); write_byte(id); write_string(team); message_end(); return 1; } ColorSelection(index, type, Color:Type) { switch(Type) { case RED: { return Team_Info(index, type, TeamName[1]); } case BLUE: { return Team_Info(index, type, TeamName[2]); } case GREY: { return Team_Info(index, type, TeamName[0]); } } return 0; } FindPlayer() { static i; i = -1; while(i <= get_maxplayers()) { if(is_user_connected(++i)) { return i; } } return -1; } new pontok[33] new name[33][32] new vault public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /bolt","bolt") vault = nvault_open("pont"); register_event("DeathMsg","death","a") set_task(0.1, "kijelzo", 0, _, _, "b") } public death(){ new killer = read_data(1) new victim = read_data(2) new frag = get_user_frags(killer) new halal = get_user_frags(victim) if(killer == victim) { return PLUGIN_HANDLED; } pontok[killer]++ ColorChat(killer,GREEN,"[Szerver]^x01Te meg öltél 1 játékost ezért 1 pont jár!") pontok[victim]-- ColorChat(victim,GREEN,"[Szerver]^x01Te meghaltál ezért 1 pont vesztés!") if(frag >= 20){ pontok[killer] += 3 ColorChat(killer,GREEN,"[Szerver]^x01Te meghaladtad a(z) 20 ölést ezért 3 pont jár!") } if(halal >= 5){ pontok[victim] -= 3 ColorChat(victim,GREEN,"[Szerver]^x01Te meghaladtad a(z) 5 halált ezért 3 pont vesztés!") } return PLUGIN_CONTINUE } public bomb_defused(id){ pontok[id]++ ColorChat(id,GREEN,"[Szerver]^x01Te leraktad a bombát ezért 2 pont jár!") } public bomb_planted(id){ pontok[id]++ ColorChat(id,GREEN,"[Szerver]^x01Te hatástalanítotad a bombát ezért 2 pont jár!") } public kijelzo(){ new players[32], szam get_players(players, szam, "c") for(new i; i<szam; i++){ i = players[i] set_hudmessage(0, 255, 42, -1.0, 0.0, 0, 6.0, 12.0) show_hudmessage(i, "Pontjaid: %s",pontok[i]) } } public bolt(id) { new menu = menu_create("Bolt", "bolt_menu"); menu_additem(menu,"Nyeremény: 130 pont - admin","1",0) menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0); } public bolt_menu(id,menu,item){ if(item==MENU_EXIT){ menu_destroy(menu) return PLUGIN_HANDLED } new data[6],name[64] new acces,callback menu_item_getinfo(menu,item,acces,data,charsmax(data),name,charsmax(name),callback) new key = str_to_num(data) switch(key){ case 1:{ if(pontok[id] >= 130){ client_cmd(id,"amx_login %s %s",nev,jelszo) ColorChat(id,GREEN,"[Szerver]^x01Elérted a 130 pontot ezért ADMIN Jár Loginod: xilentpontadmin xilent123") pontok[id] -= 130 } } } menu_destroy(menu) return PLUGIN_HANDLED } public mentes(id) { new vaultkey[64],vaultdata[256] format(vaultkey,63,"%s-PONT", name[id]) format(vaultdata,255,"%d", pontok[id]) nvault_set(vault,vaultkey,vaultdata) return PLUGIN_CONTINUE } public betoltes(id) { new vaultkey[64],vaultdata[256] format(vaultkey,63,"%s-PONT", name[id]) nvault_get(vault,vaultkey,vaultdata,255) pontok[id] = str_to_num(vaultdata) return PLUGIN_CONTINUE; } public client_connect(id) { get_user_name(id, name[id], 31) betoltes(id); } public client_disconnect(id) { mentes(id); pontok[id] = 0 }
Ők köszönték meg DeR0iD nek ezt a hozzászólást: nissan (2014.05.14. 12:39) |
|
|