Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #include <cstrike>
- #include <engine>
- #include <fun>
- #include <colorchat>
- #define PLUGIN "Diko Csoro Awp Mode"
- #define VERSION "1.0.0.0.0.0.0.0.0"
- #define AUTHOR "fasz"
- new filename[128];
- #define xCS_TEAM_CT 2
- #define xCS_TEAM_T 1
- #define MAX 28
- enum PlayerCases{
- Common,
- Limited,
- Legendary,
- Regular
- //Giant,
- //Super_Giant,
- //Super_Body,
- //Super_Part
- }
- new const Skins[MAX][]={
- {"AWP | Abstract"}, //1
- {"AWP | American"}, //2
- {"AWP | Arany"}, //3
- {"AWP | Asiimov"}, //4
- {"AWP | Bloody"}, //5
- {"AWP | Choijiyoonpaint"}, //6
- {"AWP | Dragon"}, //7
- {"AWP | Eagle"}, //8
- {"AWP | Elitebuild"}, //9
- {"AWP | Europa"}, //10
- {"AWP | Feverdream"}, //11
- {"AWP | Galaxy"}, //12
- {"AWP | Grafit"}, //13
- {"AWP | Hawking"}, //14
- {"AWP | Hexo"}, //15
- {"AWP | Magmaa"}, //16
- {"AWP | Malaysia"}, //17
- {"AWP | Medusa"}, //18
- {"AWP | Metal"}, //19
- {"AWP | Phoboss"}, //20
- {"AWP | Pulzus"}, //21
- {"AWP | Raptor"}, //22
- {"AWP | Smoke"}, //23
- {"AWP | Snow"}, //24
- {"AWP | Star"}, //25
- {"AWP | Tiger"}, //26
- {"AWP | Tuz"}, //27
- {"AWP | Wormgod"} //28
- }
- new Osszesskin[MAX][33]
- new message[192]
- new nev[32]
- static color[10]
- new PlayersInventory[33][PlayerCases]
- new Kills[33 char][33 char]
- new KillStreak[33 char]
- new Kill_Skin[33],Exp[33],Level[33 char]
- new Temp[192]
- new const RANKS_NAME[][]={
- "Rusty",
- "Wooden",
- "Bronze",
- "Silver",
- "Gold",
- "Emerald",
- "Diamond",
- "Nether",
- "-"
- }
- new const RANKS_XP[]={
- 0,
- 500,
- 1200,
- 1500,
- 2999,
- 4000,
- 6000,
- 17000,
- 9999999999
- }
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- get_localinfo("amxx_configsdir", filename, charsmax(filename))
- format(filename, charsmax(filename), "%s/awp_mentes.ini", filename)
- //set_task(20.0,"hirdetes")
- register_impulse(100, "main_menu")
- register_clcmd("say", "sayhook")
- register_clcmd("say_team", "tshook")
- register_clcmd("say /drop","drop")
- register_clcmd("say /nyitas","nyitas")
- register_clcmd("say /rankom","rankod")
- register_event("DeathMsg", "OnPlayerKilled", "a")
- register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
- register_event("HLTV", "on_new_round", "a", "1=0", "2=0")
- }
- public client_PreThink(id){
- if(is_user_alive(id)){
- if(Exp[id]>=17000){
- set_hudmessage(0, 255, 85, -1.0, 0.86, 0, 6.0, 1.0)
- show_hudmessage(id, "TP: %d | 17000 (MAX)",Exp[id])
- }
- else{
- set_hudmessage(0, 255, 85, -1.0, 0.86, 0, 6.0, 1.0)
- show_hudmessage(id, "TP: %d | %d",Exp[id],RANKS_XP[Level[id]+1])
- }
- }
- }
- public sayhook(id)
- {
- read_args (message, 191)
- remove_quotes (message)
- if (message[0] == '@' || message[0] == '/' || message[0] == '!' || equal (message, ""))
- {
- return PLUGIN_CONTINUE
- }
- get_user_name(id, nev, 31)
- if(is_user_alive(id)) {
- get_user_team(id, color, 9)
- formatex(Temp, 191, "^x04«^x01%s^x04» ^x03%s^x01: %s", RANKS_NAME[Level[id]], nev, message)
- }
- else {
- get_user_team(id, color, 9)
- formatex(Temp, 191, "^x01*HALOTT* ^x04«^x01%s^x04» ^x03%s^x01: %s",RANKS_NAME[Level[id]], nev, message)
- }
- sendmessage(color)
- return PLUGIN_HANDLED
- }
- public tshook(id)
- {
- read_args (message, 191)
- remove_quotes (message)
- if (message[0] == '@' || message[0] == '/' || message[0] == '!' || equal (message, ""))
- {
- return PLUGIN_CONTINUE
- }
- get_user_name(id, nev, 31)
- new playerTeam = get_user_team(id)
- new playerTeamName[19]
- switch (playerTeam)
- {
- case 1: {
- copy (playerTeamName, 11, "*T*")
- }
- case 2: {
- copy (playerTeamName, 18, "*CT*")
- }
- default:
- copy (playerTeamName, 9, "*SPEC*")
- }
- if(is_user_alive(id))
- {
- get_user_team(id, color, 9)
- formatex(Temp, 191, "^x03(%s) ^x04«^x01%s^x04» ^x03%s^x01: %s",playerTeamName,RANKS_NAME[Level[id]], nev, message)
- }
- else
- {
- get_user_team(id, color, 9)
- formatex(Temp, 191, "^x04*HALOTT*^x03(%s) ^x04«^x01%s^x04» ^x04[%s] ^x03%s^x01: %s",playerTeamName,RANKS_NAME[Level[id]], nev, message)
- }
- sendtmessage(color, playerTeam)
- return PLUGIN_HANDLED
- }
- public sendmessage(color[])
- {
- new teamName[10]
- for(new player = 1; player < get_maxplayers(); player++)
- {
- get_user_team (player, teamName, 9)
- teamf (player, color)
- elkuldes(player, Temp)
- teamf(player, teamName)
- }
- }
- public sendtmessage(color[], playerTeam)
- {
- new teamName[10]
- for (new player = 1; player < get_maxplayers(); player++)
- {
- if(get_user_team(player) == playerTeam)
- {
- get_user_team (player, teamName, 9)
- elkuldes(player, Temp)
- teamf (player, teamName)
- teamf (player, color)
- }
- }
- }
- public teamf(player, team[])
- {
- message_begin(MSG_ONE, get_user_msgid("TeamInfo"), _, player)
- write_byte(player)
- write_string(team)
- message_end()
- }
- public elkuldes(player, Temp[])
- {
- message_begin( MSG_ONE, get_user_msgid( "SayText" ), _, player)
- write_byte( player )
- write_string( Temp )
- message_end()
- }
- public on_new_round(id){
- new y32[32], x
- get_players(y32,x,"c")
- for(new a = 0; a < x; a++)
- set_task(1.0,"Check",y32[a])
- }
- public on_damage(id){
- static damage; damage = read_data(2)
- new att=get_user_attacker(id)
- Exp[att]+=damage
- Exp[id]-=damage/2
- }
- public rankod(id){
- client_print(id,print_chat,"^Rankod: ^3%s ^1| TP: ^3%i",RANKS_NAME[Level[id]],Exp[id])
- }
- public Check(id){
- //client_print(id,print_chat,"XP: ^3%d %i",Exp[id],Exp[id])
- if(Exp[id]<=0)
- Exp[id]=0
- if(Exp[id] >= RANKS_XP[Level[id]+1]){
- Level[id]+=1
- //client_print(id,print_chat,"Fejlődtél! Új rankod: ^3%s",RANKS_NAME[Level[id]])
- ColorChat(id,GREEN,"Fejlődtél!^1 Új rankod:^3 %s",RANKS_NAME[Level[id]])
- }
- else if(Exp[id] <= RANKS_XP[Level[id]-1]){
- Level[id]-=1
- ColorChat(id,GREEN,"VISSZAESTÉL!^1 Új rankod:^3 %s",RANKS_NAME[Level[id]])
- }
- }
- public OnPlayerKilled(){
- new att=read_data(1),vic=read_data(2)
- Kills[att][vic]++
- Kills[vic][att]=0
- KillStreak[vic]=0
- KillStreak[att]+=1
- new at_name[32],vic_name[32]
- get_user_name(att,at_name,31)
- get_user_name(vic,vic_name,31)
- Check_Streak(att)
- if(Kills[att][vic]==3){
- PlayersInventory[att][Common]++
- //client_print(0,print_chat,"^4 %s^1 alázza^4 %s^1-t, ajándéka: ^3Super Box!",at_name,vic_name)
- //print_color(0,"!g %s!y alázza !g%s!y-t, ajándéka: ^3Super Box!",at_name,vic_name)
- ColorChat(0,GREEN,"^3 %s ^1 alázza^3 %s ^1-t, ajándéka: ^3Common Box!",at_name,vic_name)
- }
- }
- public Check_Streak(id){
- new nev[32];get_user_name(id,nev,31)
- if(KillStreak[id]==6){
- KillStreak[id]=0
- set_hudmessage(255, 0, 0, 0.41, 0.08, 0, 6.0, 12.0)
- show_hudmessage(0, "%s 6-os szintű KillStreak!!",nev)
- give_item(id,"weapon_usp")
- cs_set_user_bpammo(id,CSW_USP,120)
- }
- else if(KillStreak[id]==4){
- set_hudmessage(255, 0, 0, 0.41, 0.08, 0, 6.0, 12.0)
- show_hudmessage(0, "%s 4-es szintű KillStreak!!",nev)
- set_user_health(id,get_user_health(id)+100)
- }
- else if(KillStreak[id]==2){
- set_hudmessage(255, 0, 0, 0.41, 0.08, 0, 6.0, 12.0)
- show_hudmessage(0, "%s 2-es szintű KillStreak!!",nev)
- give_item(id,"weapon_hegrenade")
- }
- }
- public main_menu(id){
- new menu=menu_create("\d-[\rEndLeSS\d]- \w| \yAWP Szerver System^n\www.endlesscs.hu","main_handler")
- menu_additem(menu,"\rLádák nyitása")
- menu_additem(menu,"\yBolt")
- menu_additem(menu,"\rSkinek")
- menu_additem(menu,"\dProfilom")
- menu_display(id,menu,0)
- return PLUGIN_HANDLED
- }
- public main_handler(id,menu,item){
- if(item==MENU_EXIT){
- menu_destroy(menu)
- return PLUGIN_HANDLED
- }
- switch(item){
- case 0:
- nyitas(id)
- case 1:
- client_print(id,print_chat,"Hamarosan")
- case 2:
- client_print(id,print_chat,"Hamarosan")
- case 3:
- profilom(id)
- }
- return PLUGIN_CONTINUE
- }
- public profilom(id){
- new lofasz[120]
- formatex(lofasz,119,"Rankod: %s (%i/%i)^nExp: %d (%d következő szint)^nÖléseid: %d",RANKS_NAME[Level[id]],Exp[id],RANKS_XP[Level[id]+1],Kill_Skin[id])
- new menu=menu_create(lofasz,"prof_hand")
- menu_additem(menu,"Teszt")
- menu_display(id,menu,0)
- }
- public prof_hand(id,menu,item){
- if(item==MENU_EXIT){
- menu_destroy(menu)
- return PLUGIN_HANDLED
- }
- if(item == 0){
- menu_destroy(menu)
- }
- return PLUGIN_CONTINUE
- }
- public nyitas(id){
- new ding[23]
- new menu=menu_create("\rendlesscs.hu \w| \rLáda rendszer \RDarab^n","case_hand")
- /*Regular*/
- if(PlayersInventory[id][Common]>=1){
- formatex(ding,22,"Common Box\R\r%d",PlayersInventory[id][Common])
- menu_additem(menu,ding)
- //formatex(ding,14,"")
- }
- else
- menu_additem(menu,"\dCommon Box\R\r0")
- /*Super*/
- if(PlayersInventory[id][Limited]>=1){
- formatex(ding,22,"Limited\R\r%d",PlayersInventory[id][Limited])
- menu_additem(menu,ding)
- //formatex(ding,14,"")
- }
- else
- menu_additem(menu,"\dLimited Box\R\r0")
- /*Legendary*/
- if(PlayersInventory[id][Limited]>=1){
- formatex(ding,22,"Legendary Box\R\r%d",PlayersInventory[id][Legendary])
- menu_additem(menu,ding)
- //formatex(ding,14,"")
- }
- else
- menu_additem(menu,"\dLegendary Box\R\r0")
- /*Xmas*/
- if(PlayersInventory[id][Regular]>=1){
- formatex(ding,22,"Regular Box\R\r%d",PlayersInventory[id][Regular])
- menu_additem(menu,ding)
- //formatex(ding,14,"")
- }
- else
- menu_additem(menu,"\dRegular Box\R\r0")
- menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
- menu_display(id,menu,0)
- return PLUGIN_HANDLED
- }
- public case_hand(id,menu,item){
- if(item == MENU_EXIT){
- menu_destroy(menu)
- return PLUGIN_HANDLED
- }
- switch(item){
- case 0:
- PlayersInventory[id][Common]>0?Common_Open(id):Error(id)
- case 1:
- PlayersInventory[id][Limited]>0?Limited_Open(id):Error(id)
- case 2:
- PlayersInventory[id][Legendary]>0?Legendary_Open(id):Error(id)
- case 3:
- PlayersInventory[id][Regular]>0?Xmas_Open(id):Error(id)
- }
- return PLUGIN_CONTINUE
- }
- public Common_Open(id){
- PlayersInventory[id][Common]--
- new rand=random_num(60,200)
- new nev[32];get_user_name(id,nev,31)
- ColorChat(0,GREEN,"%s^x01 nyitott egy Common Boxot: ^3%d TP ^1| ^3%d$",nev,rand,rand)
- Exp[id]+=rand
- }
- public Limited_Open(id){
- PlayersInventory[id][Limited]--
- client_print(id,print_chat,"Kinyitottad a ^3Super ládát^1!")
- }
- public Legendary_Open(id){
- PlayersInventory[id][Legendary]--
- client_print(id,print_chat,"Kinyitottad az ^3Legendary ládát^1!")
- }
- public Xmas_Open(id){
- PlayersInventory[id][Regular]--
- new rand=random_num(1,20)
- switch(rand){
- }
- }
- public drop(id){
- for(new i;i<8;i++)
- PlayersInventory[id][i]++
- client_print(id,print_chat,"Dikafijudegazdaghe ^4 TESZT")
- return PLUGIN_HANDLED
- }
- public Error(id){
- client_print(id,print_chat,"Nem rendelkezel ^3elegendő mennyiséggel^1!")
- nyitas(id)
- }
- stock callf(id, fgv_name[],plug_name[])
- {
- if( callfunc_begin(fgv_name,plug_name) == 1 )
- {
- callfunc_push_int(id)
- //callfunc_push_str(name)
- callfunc_end()
- }
- }
- public client_disconnect(id) {
- if(!is_user_bot(id) && !is_user_hltv(id)) {
- save(id);
- }
- }
- public client_authorized(id) {
- if(!is_user_bot(id) && !is_user_hltv(id)) {
- load(id);
- }
- }
- public load(id) {
- new szData[128];
- new steamid[32]; get_user_authid(id, steamid, charsmax(steamid));
- if(contain(steamid, "_ID_LAN") != -1) get_user_ip(id, steamid, charsmax(steamid), 1);
- if(get_data(steamid, szData, charsmax(szData))) {
- new valami[32], valami2[32],valami3[32],valami4[32],valami5[32],valami6[32]
- parse(szData, valami, charsmax(valami), valami2, charsmax(valami2), valami3,
- charsmax(valami3),
- valami4, charsmax(valami4), valami5, charsmax(valami5), valami6, charsmax(valami6))
- Exp[id] = str_to_num(valami)
- Level[id] = str_to_num(valami2)
- PlayersInventory[id][Common] = str_to_num(valami3)
- PlayersInventory[id][Limited] = str_to_num(valami4)
- PlayersInventory[id][Legendary] = str_to_num(valami5)
- PlayersInventory[id][Regular] = str_to_num(valami6)
- }
- }
- public save(id) {
- new szData[128];
- new steamid[32]; get_user_authid(id, steamid, charsmax(steamid));
- if(contain(steamid, "_ID_LAN") != -1) get_user_ip(id, steamid, charsmax(steamid), 1);
- formatex(szData, charsmax(szData), "%i %i %i %i %i %i",Exp[id],Level[id],
- PlayersInventory[id][Common],
- PlayersInventory[id][Limited],PlayersInventory[id][Legendary],PlayersInventory[id][Regular]);
- set_data(steamid, szData)
- }
- stock get_data(const key[], data[], len) {
- new vault = fopen(filename, "rt");
- new _data[512], _key[64];
- while( !feof(vault) ) {
- fgets(vault, _data, charsmax(_data));
- parse(_data, _key, charsmax(_key), data, len);
- if( equal(_key, key) ) {
- fclose(vault);
- return 1;
- }
- }
- fclose(vault);
- copy(data, len, "");
- return 0;
- }
- stock set_data(const key[], const data[]) {
- static const temp_vault_name[] = "set_data.txt";
- new file = fopen(temp_vault_name, "wt");
- new vault = fopen(filename, "rt");
- new _data[512], _key[64], _other[32];
- new bool:replaced = false;
- while( !feof(vault) ) {
- fgets(vault, _data, charsmax(_data));
- parse(_data, _key, charsmax(_key), _other, charsmax(_other));
- if( equal(_key, key) && !replaced ) {
- fprintf(file, "^"%s^" ^"%s^"^n", key, data);
- replaced = true;
- }
- else {
- fputs(file, _data);
- }
- }
- if( !replaced ) {
- fprintf(file, "^"%s^" ^"%s^"^n", key, data);
- }
- fclose(file);
- fclose(vault);
- delete_file(filename);
- while( !rename_file(temp_vault_name, filename, 1) ) { }
- //delete_file(temp_vault_name);
- }
- stock print_color(const id, const input[], any:...)
- {
- new count = 1, players[32]
- static msg[191]
- vformat(msg, 190, input, 3)
- replace_all(msg, 190, "!g", "^4")
- replace_all(msg, 190, "!y", "^1")
- replace_all(msg, 190, "!t", "^3")
- replace_all(msg, 190, "á", "á")
- replace_all(msg, 190, "é", "é")
- replace_all(msg, 190, "í", "í")
- replace_all(msg, 190, "ó", "ó")
- replace_all(msg, 190, "ö", "ö")
- replace_all(msg, 190, "ő", "ő")
- replace_all(msg, 190, "ú", "ú")
- replace_all(msg, 190, "ü", "ü")
- replace_all(msg, 190, "ű", "ű")
- replace_all(msg, 190, "Á", "Á")
- replace_all(msg, 190, "É", "É")
- replace_all(msg, 190, "Í", "Í")
- replace_all(msg, 190, "Ó", "Ó")
- replace_all(msg, 190, "Ö", "Ö")
- replace_all(msg, 190, "Ő", "Ő")
- replace_all(msg, 190, "Ú", "Ú")
- replace_all(msg, 190, "Ü", "Ü")
- replace_all(msg, 190, "Ű", "Ű")
- if (id) players[0] = id; else get_players(players, count, "ch")
- {
- for (new i = 0; i < count; i++)
- {
- if (is_user_connected(players[i]))
- {
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
- write_byte(players[i])
- write_string(msg)
- message_end()
- }
- }
- }
- return PLUGIN_HANDLED
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement