pozdrawiam
/* Zabraniam sobie zmieniania autora stopki! * Plugin na kożyść użytkownika <img src='http://img.amxx.pl/public/style_emoticons/<#EMO_DIR#>/smile.gif' class='bbc_emoticon' alt=':)' /> */ #include <amxmodx> #include <amxmisc> #include <cstrike> #include <engine> #include <colorchat> #include <fun> #define Klawisze (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9) new const vip_center[] = "^x01[^x04VIP Sklep^x01]"; new const P[] = "[VIP] Sklep"; new const A[] = "Forma" new const V[] = "1.0"; new koszt,koszt2,koszt3,koszt4; new iSpeed, GetMaxPlayers; new bool:SpeedVipActive[33] = false; public plugin_init() { register_plugin(P,A,V); register_clcmd("say /sklep","OpenShop"); register_clcmd("say /vip","OpenVips"); register_event("HLTV", "NewRound", "a", "1=0", "2=0"); register_menucmd(register_menuid("OpenShop"), Klawisze, "ShowShopMenu"); koszt = register_cvar("vip_koszt_STO_HP","1"); koszt2 = register_cvar("vip_koszt_GRAVITY","1"); koszt3 = register_cvar("vip_koszt_SPEED","1"); koszt4 = register_cvar("vip_koszt_FOOTSTEPS","1"); iSpeed = register_cvar("vip_SPEED","300"); GetMaxPlayers = get_maxplayers(); } public NewRound() { for(new i=0; i<GetMaxPlayers; i++) { set_user_gravity(i, 1.0); set_user_footsteps(i, 0); SpeedVipActive[i] = false; } } public client_PreThink(id) { switch(SpeedVipActive[id]) { case true: set_user_maxspeed(id, get_pcvar_float(iSpeed)); case false: set_user_maxspeed(id, 250.0); } } public OpenShop(id) { if(get_user_flags(id) & ADMIN_LEVEL_H) { new nick[32], TextMenu[1024]; get_user_name(id, nick, 31); format(TextMenu, 1023, "\yWitaj \r%s^n\rSklep VIPa^n^n\w1. \y+100 HP? \r[Koszt: %i $]^n\w2. \yWieksza Szybkosc \r[Koszt: %i $]^n\w3. \yCiche Chodzenie \r[Koszt: %i $]^n\w4. \yZmniejszona Grawitacja \r[Koszt: %i $]^n^n\w0. Wyjscie",nick, get_pcvar_num(koszt), get_pcvar_num(koszt2), get_pcvar_num(koszt3), get_pcvar_num(koszt4)); show_menu(id, Klawisze, TextMenu, -1, "OpenShop"); } else ColorChat(id, GREEN, "%s Sklep jest dostepny tylko dla VIPow",vip_center); } public ShowShopMenu(id, key) { switch(key) { case 0: { if(!Sklep(id, get_pcvar_num(koszt))) return PLUGIN_HANDLED; set_user_health(id, get_user_health(id) + 100); } case 1: { if(!Sklep(id, get_pcvar_num(koszt2))) return PLUGIN_HANDLED; SpeedVipActive[id] = true; } case 2: { if(!Sklep(id, get_pcvar_num(koszt3))) return PLUGIN_HANDLED; set_user_footsteps(id, 1); } case 3: { if(!Sklep(id, get_pcvar_num(koszt4))) return PLUGIN_HANDLED; set_user_gravity(id, 0.5); } case 9: { ColorChat(id, GREEN, "%s Pomyslnie zamknieto menu sklepu!",vip_center); } } return PLUGIN_HANDLED; } public OpenVips(id) { static Text[1024],name[32],len,i,counter; len = 0; counter = 0; len += formatex(Text[len],sizeof Text - 1 - len,"\rVIPs Online:^n^n"); for(i = 1; i <= GetMaxPlayers ;i++) { if(!is_user_connected(i)) continue; if((cs_get_user_team(i) == CS_TEAM_SPECTATOR) && (cs_get_user_team(i) == CS_TEAM_UNASSIGNED)) continue; counter++; get_user_name(i,name,sizeof name - 1); if(get_user_flags(i) & ADMIN_LEVEL_H) { if(is_user_alive(i)) { len += formatex(Text[len],sizeof Text - 1 - len,"\w%d. \y%s \d# Steam:\r[%s] \d# Zyje:\r[TAK]^n",counter,name,is_user_steam(i)?"TAK":"NIE"); } else { len += formatex(Text[len],sizeof Text - 1 - len,"\w%d. \y%s \d# Steam:\r[%s] \d# Zyje:\r[NIE]^n",counter,name,is_user_steam(i)?"TAK":"NIE"); } } } show_menu(id, Klawisze, Text, -1, "MenuVips"); } stock bool:is_user_steam(id) { new authid[32]; get_user_authid(id, authid, 31); return containi(authid, ":") != -1 ? true:false; } public bool:Sklep(id, amount) { if(cs_get_user_money(id) >= amount) { cs_set_user_money(id,cs_get_user_money(id)-amount); return true; } else { client_print(id, print_center,"Nie masz tyle klasy!"); return false; } return false; }
Użytkownik forma edytował ten post 20.04.2011 18:14