Witamy w Nieoficjalnym polskim support'cie AMX Mod X
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Guest Message by DevFuse
FetaGreen
Rejestracja: 15.11.2010Aktualnie: Nieaktywny
Poza forum Ostatnio: 06.08.2023 21:28
Statystyki
- Grupa: Użytkownik
- Całość postów: 178
- Odwiedzin: 8 995
- Tytuł: Profesjonalista
- Wiek: 28 lat
- Urodziny: Sierpień 13, 1996
-
Imię
Łukasz
-
Płeć
Mężczyzna
-
Lokalizacja
Nysa
Kontakt
40
Pomocny
Narzędzia użytkownika
Znajomi
FetaGreen nie posiada znajomych
Ostatnio byli
#432876 Shop by waqu
Napisane przez FetaGreen w 16.07.2012 15:53
#377468 [HNS EasyBlock] Nowe funkcje na prośbę
Napisane przez FetaGreen w 08.03.2012 22:38
[PROŚBA] Zrobił byś poradnik jak dodać rendering do BCM taki jak w BM starym?
Chodzi mi o taki:
(Menu)
1. Type: Normal/Add etc.
2. Type FX: GLOW, FAST xxx etc.
3. Kolor
4. Kolor
5. Kolor
6. ilość
8. Pobierz rendering (pobiera rendering z danego blocka)
9. Ustaw rendering (po uzyciu nadaje rendering na dany block)
I jeszcze jedno jak dodać menu do bcm na jakimś przykładzie (nawet na renderingu)
Jeśli byś mógł bo wiem że wiele ludzi ma z tym problem, chyba że tego za free nie zrobisz
Chodzi mi o taki:
(Menu)
1. Type: Normal/Add etc.
2. Type FX: GLOW, FAST xxx etc.
3. Kolor
4. Kolor
5. Kolor
6. ilość
8. Pobierz rendering (pobiera rendering z danego blocka)
9. Ustaw rendering (po uzyciu nadaje rendering na dany block)
I jeszcze jedno jak dodać menu do bcm na jakimś przykładzie (nawet na renderingu)
Jeśli byś mógł bo wiem że wiele ludzi ma z tym problem, chyba że tego za free nie zrobisz
#361649 Miotacz Ognia
Napisane przez FetaGreen w 10.02.2012 13:22
#361178 Problem z copliliowanem pliku .sma
Napisane przez FetaGreen w 09.02.2012 17:07
#361031 [ROZWIĄZANE] Brak komend Rcona
Napisane przez FetaGreen w 09.02.2012 12:50
#361008 Quiz - DiabloMod !
Napisane przez FetaGreen w 09.02.2012 11:48
#360506 [ROZWIĄZANE] Nie mogę skompilowac pluginu....
Napisane przez FetaGreen w 08.02.2012 13:38
Znajdź:
oraz zamień na:
ShowChoiceMenu(id, choice, const title[96]) { new menu[128]; g_choice_option[id] = choice; format(menu, charsmax(menu), g_choice_menu, title); show_menu(id, g_keys_choice_menu, menu, -1, " ChoiceMenu"); }
oraz zamień na:
ShowChoiceMenu(id, choice, const title[96]) { new menu[128]; g_choice_option[id] = choice; format(menu, charsmax(menu), g_choice_menu, title); show_menu(id, g_keys_choice_menu, menu, -1, "ChoiceMenu"); }
#360488 Szukam pluginu który odradza gracza. Na CODa.
Napisane przez FetaGreen w 08.02.2012 13:13
Sprawdź:
#include <amxmodx> #include <amxmisc> #include <fakemeta> #include <hamsandwich> new Float:g_spawn_vec[60][3]; new Float:g_spawn_angle[60][3]; new Float:g_spawn_v_angle[60][3]; new bool:g_first_spawn[33]; new g_total_spawn = 0; public plugin_init() { register_plugin("Respawn", "0.1", "FetaGreen"); register_event("DeathMsg", "event_Death", "a"); csdm_respawn(); } public event_death_msg(){ new ofiara = read_data(2); if(!is_user_alive(ofiara)){ set_task(3.0, "cmdRespawn", ofiara); } } public cmdRespawn(ofiara){ ExecuteHamB(Ham_CS_RoundRespawn, ofiara); } csdm_respawn(){ new map[32], config[32], mapfile[64]; get_mapname(map, 31); get_configsdir(config, 31); format(mapfile, 63, "%s\csdm\%s.spawns.cfg", config, map); g_total_spawn = 0; if (file_exists(mapfile)) { new new_data[124], len; new line = 0; new pos[12][8]; while(g_total_spawn < 60 && (line = read_file(mapfile , line , new_data , 123 , len) ) != 0 ) { if (strlen(new_data)<2 || new_data[0] == '[') continue; parse(new_data, pos[1], 7, pos[2], 7, pos[3], 7, pos[4], 7, pos[5], 7, pos[6], 7, pos[7], 7, pos[8], 7, pos[9], 7, pos[10], 7); g_spawn_vec[g_total_spawn][0] = str_to_float(pos[1]); g_spawn_vec[g_total_spawn][1] = str_to_float(pos[2]); g_spawn_vec[g_total_spawn][2] = str_to_float(pos[3]); g_spawn_angle[g_total_spawn][0] = str_to_float(pos[4]); g_spawn_angle[g_total_spawn][1] = str_to_float(pos[5]); g_spawn_angle[g_total_spawn][2] = str_to_float(pos[6]); g_spawn_v_angle[g_total_spawn][0] = str_to_float(pos[8]); g_spawn_v_angle[g_total_spawn][1] = str_to_float(pos[9]); g_spawn_v_angle[g_total_spawn][2] = str_to_float(pos[10]); g_total_spawn++; } if (g_total_spawn >= 2) RegisterHam(Ham_Spawn, "player", "csdm_player_spawn", 1); } return 1; } public csdm_player_spawn(id){ if (!is_user_alive(id) || get_user_team(id) == 2) return; if (g_first_spawn[id]){ g_first_spawn[id] = false; return; } new list[60]; new num = 0; new final = -1; new total=0; new players[32], n, x = 0; new Float:loc[32][3], locnum; get_players(players, num); for (new i=0; i<num; i++){ if (is_user_alive(players[i]) && players[i] != id){ pev(players[i], pev_origin, loc[locnum]); locnum++; } } num = 0; while (num <= g_total_spawn){ if (num == g_total_spawn) break; n = random_num(0, g_total_spawn-1); if (!list[n]){ list[n] = 1; num++; } else { total++; if (total > 100) break; continue; } if (locnum < 1){ final = n; break; } final = n; for (x = 0; x < locnum; x++){ new Float:distance = get_distance_f(g_spawn_vec[n], loc[x]); if (distance < 250.0){ final = -1; break; } } if (final != -1) break; } if (final != -1){ new Float:mins[3], Float:maxs[3]; pev(id, pev_mins, mins); pev(id, pev_maxs, maxs); engfunc(EngFunc_SetSize, id, mins, maxs); engfunc(EngFunc_SetOrigin, id, g_spawn_vec[final]); set_pev(id, pev_fixangle, 1); set_pev(id, pev_angles, g_spawn_angle[final]); set_pev(id, pev_v_angle, g_spawn_v_angle[final]); set_pev(id, pev_fixangle, 1); } }
#360468 poszukuje pluginu ktory ustawia interp i sprawdza co runde
Napisane przez FetaGreen w 08.02.2012 12:18
Łapaj:
http://amxx.pl/topic/779-ex-interp/
http://amxx.pl/topic...-ex-interp-005/
http://amxx.pl/topic...erp-changer-14/
http://amxx.pl/topic...interp-manager/
http://amxx.pl/topic...2-menu-interpu/
http://amxx.pl/topic...rate-oraz-rate/
Strażnik ex_interp - AMXX.pl: Support AMX Mod X
http://amxx.pl/topic...-wybor-interpu/
http://amxx.pl/topic...ie-interpu-001/
http://amxx.pl/topic...rzadca-interpu/
+ ten plugin też posiada tą opcje:
http://amxx.pl/topic...server-manager/
http://amxx.pl/topic/779-ex-interp/
http://amxx.pl/topic...-ex-interp-005/
http://amxx.pl/topic...erp-changer-14/
http://amxx.pl/topic...interp-manager/
http://amxx.pl/topic...2-menu-interpu/
http://amxx.pl/topic...rate-oraz-rate/
Strażnik ex_interp - AMXX.pl: Support AMX Mod X
http://amxx.pl/topic...-wybor-interpu/
http://amxx.pl/topic...ie-interpu-001/
http://amxx.pl/topic...rzadca-interpu/
+ ten plugin też posiada tą opcje:
http://amxx.pl/topic...server-manager/
#360216 errory w logach - spawn protection
Napisane przez FetaGreen w 07.02.2012 20:30
public protect(id) { new Float:SPTime = get_cvar_float("sv_sptime") new SPSecs = get_cvar_num("sv_sptime") new FTime = get_cvar_num("mp_freezetime") new SPShell = get_cvar_num("sv_spshellthick") set_user_godmode(id, 1) if(get_user_team(id) == 1) { set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, SPShell) } if(get_user_team(id) == 2) { set_user_rendering(id, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, SPShell) } if(get_cvar_num("sv_spmessage") == 1) { set_hudmessage(255, 1, 1, -1.0, -1.0, 0, 6.0, SPTime+FTime, 0.1, 0.2, 4) show_hudmessage(id, "Ochrona na poczatku rundy trwa %d sekund(y)", SPSecs) } set_task(SPTime+FTime, "sp_off", id) return PLUGIN_HANDLED }
zamień na:
public protect(id){ if(!is_user_connected(id) && !is_user_alive(id)) return PLUGIN_HANDLED; new Float:SPTime = get_cvar_float("sv_sptime") new SPSecs = get_cvar_num("sv_sptime") new FTime = get_cvar_num("mp_freezetime") new SPShell = get_cvar_num("sv_spshellthick") set_user_godmode(id, 1) if(get_user_team(id) == 1) { set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, SPShell) } if(get_user_team(id) == 2) { set_user_rendering(id, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, SPShell) } if(get_cvar_num("sv_spmessage") == 1) { set_hudmessage(255, 1, 1, -1.0, -1.0, 0, 6.0, SPTime+FTime, 0.1, 0.2, 4) show_hudmessage(id, "Ochrona na poczatku rundy trwa %d sekund(y)", SPSecs) } set_task(SPTime+FTime, "sp_off", id) return PLUGIN_HANDLED }
Powinno dzialać
#359996 Error logi: get_pcvar_num
Napisane przez FetaGreen w 07.02.2012 14:46
#359963 [ROZWIĄZANE] Muzyka dla danej drużyny
Napisane przez FetaGreen w 07.02.2012 13:47
Sprawdź:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #include <colorchat> new bool:block[33]; public plugin_precache(){ precache_sound("test/test1.mp3"); precache_sound("test/test2.mp3"); } public plugin_init() { register_plugin("Pierwszy plug", "0.1", "MA1L0"); register_clcmd("say /menu", "menu"); register_logevent("runda",2,"1=Round_Start"); register_event("HLTV", "NewRound", "a", "1=0", "2=0"); } public client_connect(id) block[id] = false; public menu(id){ new menu = menu_create("\rMenu gry","sterowanie"); menu_additem(menu,"\ntest1","1",0); menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id,menu,0); } public sterowanie(id, menu, item){ if(item == MENU_EXIT){ menu_destroy(menu); return PLUGIN_HANDLED; } new data[6], iName[64]; new acces, callback; menu_item_getinfo(menu, item, acces, data,5, iName, 63, callback); new key = str_to_num(data); switch(key){ case 1:{ if(block[id]) ColorChat(id, GREEN,"[Info]^x01 ?!"); else{ give_item(id, "weapon_ak47"); set_user_health(id, 255); set_user_armor(id, 200); client_cmd(0, "spk sound/items/ammopickup1.wav"); ColorChat(id, GREEN,"[Info]^x01 ?!"); block[id] = true; } } } return PLUGIN_CONTINUE; } public runda(id){ new iPlayers[32], iNum; get_players(iPlayers, iNum); for(new g = 0; g < iNum ; g++){ new id = iPlayers[g]; if(get_user_team(id) == 2) client_cmd(id, "mp3 play sound/test/test1.mp3") else if(get_user_team(id) == 1) client_cmd(id, "mp3 play sound/test/test2.mp3") } } public NewRound(id) block[id] = false
#359932 [ROZWIĄZANE] Przerobienie Ruletki
Napisane przez FetaGreen w 07.02.2012 12:43
Sma:
amxx - http://amxx.pl/kompi...me=ruletka3.sma
Spoiler
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <fakemeta>
#include <engine>
#define fm_find_ent_by_class(%1,%2) engfunc(EngFunc_FindEntityByString, %1, "classname", %2)
#define MAX_PLAYERS 32
#define MAX_INDEX MAX_PLAYERS+1
#define COOLDOWN 30.0
#define HLDTIME 5.0
#define HUD_RED 0
#define HUD_GREEN 255
#define HUD_BLUE 0
new SayText,TeamInfo,ScoreInfo;
new bool:cantTake[MAX_INDEX];
new bool:isRambo[MAX_INDEX];
new bool:wasRambo[MAX_INDEX];
new bool:isoldman[MAX_INDEX];
new bool:isIdiot[MAX_INDEX];
new bool:wasVIP[MAX_INDEX];
new bool:wasBritney[MAX_INDEX];
new bool:wasMonkey[MAX_INDEX];
new bool:wasDrunk[MAX_INDEX];
new bool:moved[MAX_INDEX];
new bool:have_unlimited[MAX_INDEX];
new bool:haveMac10[MAX_INDEX];
new bool:cpun[MAX_INDEX];
new uses[MAX_INDEX];
new user_weapons[MAX_INDEX][33];
new gmsgBarTime;
#define SOUNDS_C 15
new sounds[SOUNDS_C][50]=
{
"Ruletka/Kosiarz/niemambroni.wav", //0
"Ruletka/Rambo/pozabijam.wav", //1
"Ruletka/Rambo/niepokonany.wav", //2
"Ruletka/Stary_czlowiek/staryczlowiek.wav", //3
"Ruletka/VIP/VIP.wav", //4
"Ruletka/VIP/koniec_VIPa.wav", //5
"Ruletka/Britney/dieta_bananowa.wav", //6
"Ruletka/Britney/spy_girls.wav", //7
"Ruletka/Malpa/Malpa.wav", //8
"Ruletka/Malpa/ekspetymenty.wav", //9
"Ruletka/Pijak/burp.wav", //10
"Ruletka/Pijak/pijak.wav", //11
"Ruletka/Wiesniak/wiesniak.wav", //12
"Ruletka/Cpun/nanana.wav", //13
"Ruletka/Cpun/czarny.wav" //14
}
enum Color
{
YELLOW = 1, // Yellow
GREEN, // Green Color
TEAM_COLOR, // Red, grey, blue
GREY, // grey
RED, // Red
BLUE, // Blue
}
new TeamName[][] =
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
}
new moves[4][] = {"+moveleft","+moveright","+back","+forward"};
new g_sModelIndexSmoke, white;
new sprMflash,sprFlare6,sprLightning;
new sprBflare, sprRflare,sprGflare,sprTflare;
new sprOflare,sprPflare, sprYflare;
new sprSmoke,mdlWbottle,mdlWcan;
new r_speed,r_britney_time,r_pijak_time;
new round=false;
public plugin_init(){
register_plugin( "Ruletka", "3.0", "R3X" ); // dzięki
register_dictionary("ruletka.txt");
register_logevent("round_end", 2, "1=Round_End");
register_logevent("round_start", 2, "1=Round_Start");
register_clcmd("say /ruletka","silverek");
register_event("CurWeapon","event_cur_weapon","be", "1=1");
register_event("Damage","event_damage","b");
register_event("DeathMsg","event_death","a");
SayText = get_user_msgid("SayText");
TeamInfo = get_user_msgid("TeamInfo");
gmsgBarTime = get_user_msgid("BarTime");
r_speed = register_cvar("ruletka_oldman_speed","72.0");
r_britney_time= register_cvar("ruletka_britney_time","25");
r_pijak_time = register_cvar("ruletka_pijak_time","25");
register_event( "TextMsg", "round_end", "a", "2&#Game_will_restart_in" );
ScoreInfo=get_user_msgid("ScoreInfo");
register_clcmd("showWeapons","showWeapons");
}
public showWeapons(id)
{
for(new i=0;i<33;i++)
{
new wid=user_weapons[id][i],weaponname[15];
get_weaponname(wid,weaponname,14);
console_print(id,"%s",weaponname);
}
}
public client_putinserver(id)
{
cantTake[id]=false;
isRambo[id]=false;
isIdiot[id]=false;
uses[id]=0;
wasVIP[id]=false;
wasBritney[id]=false;
wasMonkey[id]=false;
wasDrunk[id]=false;
have_unlimited[id]=false;
haveMac10[id]=false;
cpun[id]=false;
}
public round_start()
{
set_task(0.3,"makeOldMan");
round=true;
new Players[32], playerCount, player;
get_players(Players, playerCount);
for (new i=0; i<playerCount; i++) {
player = Players[i];
if(isoldman[player])
{
if(!task_exists(player))
set_task(10.0,"removeOldMan",player);
}
set_pev(player,pev_gravity, 1.0);
setFOV(player,90);
removeNoClip(player);
}
}
public makeOldMan()
{
new Players[32], playerCount;
get_players(Players, playerCount);
for (new i=0; i<playerCount; i++) {
new id=Players[i];
if(isoldman[id])
set_user_maxspeed(id, get_pcvar_float(r_speed));
}
}
public round_end()
{
round=false;
new Players[32], playerCount, player;
get_players(Players, playerCount);
for (new i=0; i<playerCount; i++) {
player = Players[i];
if(isoldman[player])
removeOldMan(player);
if(task_exists(player))
remove_task(player);
cantTake[player]=false;
new name[40];
get_user_name(player,name,39);
Vexd_ClearModel(player);
isRambo[player]=false;
isoldman[player]=false;
set_user_godmode (player);
wasRambo[player]=false;
isIdiot[player]=false;
if(uses[player]==2)
uses[player]=0;
if(uses[player]==1)
uses[player]=2;
clear_weapons(player);
wasVIP[player]=false;
wasBritney[player]=false;
if(wasMonkey[player])
set_pev(player,pev_gravity, 1.0);
wasMonkey[player]=false;
setFOV(player,90);
wasDrunk[player]=false;
have_unlimited[player]=false;
haveMac10[player]=false;
cpun[player]=false;
}
}
clear_weapons(id)
{
for(new i=0; i<33; i++)
{
user_weapons[id][i] = 0;
}
}
public event_cur_weapon(id)
{
new weapon = read_data(2);
new clip = read_data(3);
if(haveMac10[id] && clip==0)
haveMac10[id]=false;
if(!is_user_alive(id))
return PLUGIN_HANDLED;
if(isoldman[id])
{
set_user_maxspeed(id, get_pcvar_float(r_speed));
}
if(cantTake[id] && isRambo[id])
engclient_cmd(id,"weapon_m249");
else if(cantTake[id] && haveMac10[id])
{
engclient_cmd(id,"weapon_mac10");
}
else if(cantTake[id])
engclient_cmd(id,"weapon_knife");
if(have_unlimited[id])
{
give_fullammo(id , weapon , clip);
}
return PLUGIN_CONTINUE;
}
public silverek(id){
new buf[80];
if (!is_user_alive ( id ))
{
formatex(buf,79,"%L",LANG_PLAYER,"PL_DEAD");
ColorChat(id, GREEN, buf)
return PLUGIN_HANDLED;
}
if(uses[id]!=0 || !round)
{
formatex(buf,79,"%L",LANG_PLAYER,"PL_WAIT");
ColorChat(id, GREEN, buf);
return PLUGIN_HANDLED;
}
nagroda(id);
return PLUGIN_HANDLED;
}
HUDsay(message[])
{
set_hudmessage(HUD_RED, HUD_GREEN, HUD_BLUE, -1.0, 0.24, 0, 6.0, HLDTIME);
show_hudmessage(0, message)
}
nagroda(id){
new name[40];
get_user_name(id,name,39);
new buf[80],buf2[80],buf3[80];
switch(random_num(1,16))
{
case 1:{//Kosiarz
strip_user_weapons (id);
give_item(id, "weapon_knife");
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM1");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM1_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM1_HUD",name);
cantTake[id]=true;
play(0, sounds[0]);
}
case 2 :{//Idiota
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM2");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM2_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM2_HUD",name);
Vexd_PlayerModel(id);
isIdiot[id]=true;
}
case 3 :{//Rambo
set_user_godmode ( id, 1);
strip_user_weapons (id);
give_item(id, "weapon_knife");
give_item(id, "weapon_m249");
give_item(id, "ammo_556natobox");
give_item(id, "ammo_556natobox");
give_item(id, "ammo_556natobox");
give_item(id, "ammo_556natobox");
give_item(id, "ammo_556natobox");
give_item(id, "ammo_556natobox");
give_item(id, "ammo_556natobox");
message_begin(MSG_ONE,gmsgBarTime,{0,0,0},id);
write_short(20);
message_end();
//aura
set_pev(id,pev_rendercolor,200.0,0.0,0.0);
set_pev(id,pev_rendermode,kRenderNormal);
set_pev(id,pev_renderfx,kRenderFxGlowShell);
set_pev(id,pev_renderamt,25.0);
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM3");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM3_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM3_HUD",name);
set_task(20.0,"removeRambo",id);
isRambo[id]=true;
cantTake[id]=true;
play(0,sounds[1]);
}
case 4:{//stary czlowiek
new boom=random_num(0,9);
if(boom < 3){
new vec[3];
get_user_origin ( id, vec);
slay_explode(vec);
user_kill(id);
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM4_HUD",name);
}
else
{
isoldman[id]=true;
if(round)
set_user_maxspeed(id, get_pcvar_float(r_speed));
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM4_HUD2",name);
}
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM4");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM4_DESC");
if(isoldman[id] && round)
set_task(10.0,"removeOldMan",id);
play(0,sounds[3]);
}
case 5:{//Vip
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM6");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM6_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM6_HUD",name);
play(0,sounds[5]);
wasVIP[id]=true;
give_item(id, "weapon_m4a1");
give_item(id, "weapon_awp");
give_item(id, "weapon_m3");
give_ammo(id);
}
case 6:{//malpa
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM7");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM7_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM7_HUD",name);
set_pev(id,pev_gravity,0.6);
play(0, sounds[10]);
wasMonkey[id]=true;
}
case 7:{//Britney
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM8");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM8_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM8_HUD",name);
set_task(0.5, "britney",id,"",0,"b");
new args[1];
args[0]=id;
set_task(get_pcvar_float(r_britney_time),"removeBritney",0,args,1);
wasBritney[id]=true;
play(0, sounds[8]);
}
case 8:{//Pijak
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM9");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM9_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM9_HUD",name);
set_task(0.5,"smokin_1",id,"",0,"b");
new args[1];
args[0]=id;
set_task(get_pcvar_float(r_pijak_time),"removePijak",0,args,1);
wasDrunk[id]=true;
}
case 9:{//full ammo
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM10");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM10_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM10_HUD",name);
have_unlimited[id]=true;
}
case 10:{//Dodatkowe HP
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM11");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM11_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM11_HUD",name);
new health=pev(id,pev_health);
set_pev(id,pev_health,float(min(health+random_num(10,50),255)));
}
case 11:{//Dodatkowa kasa
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM12");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM12_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM12_HUD",name);
new prize=random_num(2000,5000);
cs_set_user_money(id, cs_get_user_money(id)+prize);
}
case 12:{//slay
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM13");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM13_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM13_HUD",name);
new vec[3];
get_user_origin ( id, vec);
slay_explode(vec);
user_kill(id);
}
case 13:{//slap
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM14");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM14_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM14_HUD",name);
new args[2];
args[0]=id;
args[1]=0;
set_task(0.2, "slapPlayer",_,args,2);
}
case 14:{//noclip
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM15");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM15_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM15_HUD",name);
set_user_noclip(id, 1);
set_task(15.0,"removeNoClip",id);
message_begin(MSG_ONE,gmsgBarTime,{0,0,0},id);
write_short(15);
message_end();
}
case 15:{//Wieśniak
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM16");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM16_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM16_HUD",name);
strip_user_weapons(id);
give_item(id, "weapon_mac10");
give_item(id, "weapon_knife");
haveMac10[id]=true;
cantTake[id]=true;
play(0, sounds[14]);
}
case 16:{//Ćpun
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM17");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM17_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM17_HUD",name);
setFOV(id, 150);
play(0, sounds[13]);
cpun[id]=true;
}
}
ColorChat(id, GREEN, buf);
ColorChat(id, GREEN, buf2);
HUDsay(buf3);
uses[id]=1;
return true;
}
public slapPlayer(args[2]){
user_slap(args[0],random_num(0,5));
if(args[1]<9){
args[1]++;
set_task(0.2, "slapPlayer",_,args,2);
}
}
public removeRambo(id)
{
isRambo[id]=false;
wasRambo[id]=true;
cantTake[id]=false;
set_user_godmode (id);
set_pev(id,pev_renderfx,kRenderFxNone);
}
public removeOldMan(id)
{
isoldman[id]=false;
set_user_maxspeed(id,250.0);
}
public removeBritney(id[])
{
remove_task(id[0]);
wasBritney[id[0]]=false;
play(0, sounds[9]);
}
public removePijak(id[])
{
remove_task(id[0]);
wasDrunk[id[0]]=false;
play(0, sounds[13]);
setFOV(id[0],90);
client_cmd(id[0],"-moveleft;-moveright;-forward;-back");
}
public removeNoClip(id)
{
set_user_noclip(id);
}
public ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
static message[256];
switch(type)
{
case YELLOW: // Yellow
{
message[0] = 0x01;
}
case GREEN: // Green
{
message[0] = 0x04;
}
default: // White, Red, Blue
{
message[0] = 0x03;
}
}
vformat(message[1], 251, msg, 4);
// Make sure message is not longer than 192 character. Will crash the server.
message[192] = '^0';
new team, ColorChange, index, MSG_Type;
if(!id)
{
index = FindPlayer();
MSG_Type = MSG_ALL;
} else {
MSG_Type = MSG_ONE;
index = id;
}
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, SayText, _, id);
write_byte(id)
write_string(message);
message_end();
}
Team_Info(id, type, team[])
{
message_begin(type, 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()
{
new i = -1;
while(i <= MAX_PLAYERS)
{
if(is_user_connected(++i))
{
return i;
}
}
return -1;
}
play(id, sound[])
{
new end=strlen(sound)-4;
if(containi(sound,".mp3") == end && end>0)
client_cmd(id,"mp3 play sound/%s",sound);
else if(containi(sound,".wav") == end && end>0)
client_cmd(id, "spk sound/%s",sound);
else
client_cmd(id, "speak %s",sound);
}
public plugin_precache()
{
for(new i=0;i<SOUNDS_C;i++)
precache_sound(sounds[i]);
precache_model("models/player/trekker/trekker.mdl")
g_sModelIndexSmoke = precache_model("sprites/steam1.spr");
white = precache_model("sprites/white.spr");
sprMflash = precache_model("sprites/muzzleflash.spr");
sprFlare6 = precache_model("sprites/Flare6.spr");
sprLightning = precache_model("sprites/lgtning.spr");
sprBflare = precache_model("sprites/fireworks/bflare.spr");
sprRflare = precache_model("sprites/fireworks/rflare.spr");
sprGflare = precache_model("sprites/fireworks/gflare.spr");
sprTflare = precache_model("sprites/fireworks/tflare.spr");
sprOflare = precache_model("sprites/fireworks/oflare.spr");
sprPflare = precache_model("sprites/fireworks/pflare.spr");
sprYflare = precache_model("sprites/fireworks/yflare.spr");
sprSmoke = precache_model("sprites/steam1.spr");
if(file_exists("models/winebottle.mdl")==1)
{
mdlWbottle = precache_model("models/winebottle.mdl");
}
else
{
mdlWbottle = precache_model("models/can.mdl");
}
mdlWcan = precache_model("models/can.mdl");
}
public event_damage(victim_id)
{
new attacker_id = get_user_attacker(victim_id);
if(!is_user_alive(attacker_id))
return;
if(isRambo[attacker_id])
log_kill(attacker_id,victim_id,"m249")
}
public event_death()
{
new vid=read_data(2);
if(wasRambo[vid] || isRambo[vid])
play(0,sounds[2]);
if(wasVIP[vid])
play(0,sounds[7]);
if(wasMonkey[vid])
play(0,sounds[11]);
if(cpun[vid])
play(0,sounds[14]);
if(isIdiot[vid])
Vexd_ClearModel(vid);
}
//add money
public addMoney(id, money)
{
if(is_user_alive(id))
{
new newMoney = cs_get_user_money(id)+money;
if(newMoney > 16000)
newMoney = 16000;
cs_set_user_money(id, newMoney);
}
}
//reduce money
public reduceMoney(id, money)
{
if(is_user_alive(id))
{
new newMoney = cs_get_user_money(id)-money;
if(newMoney < 0)
newMoney = 0;
cs_set_user_money(id, newMoney);
}
}
//only for msg ScoreInfo - team
public get_teamId(CsTeams:team)
{
if(team==CS_TEAM_UNASSIGNED)
return 0;
else if(team==CS_TEAM_T)
return 1;
else if(team==CS_TEAM_CT)
return 2;
else if(team==CS_TEAM_SPECTATOR)
return 3;
return 0;
}
stock log_kill(killer, victim, weapon[], headshot=0){
if(!is_user_alive(victim))
return PLUGIN_CONTINUE;
new TK=get_user_team(killer) == get_user_team(victim);
message_begin( MSG_ALL, get_user_msgid("DeathMsg"), {0,0,0}, 0 );
write_byte( killer );
write_byte( victim );
write_byte( headshot );
write_string( weapon );
message_end();
new kfrags = pev( killer , pev_frags);
if(!TK)
{
addMoney(killer,300);
set_pev(killer,pev_frags,float(++kfrags));
}
else
{
reduceMoney(killer,3300);
set_pev(killer,pev_frags,float(--kfrags));
}
new kdeaths=cs_get_user_deaths (killer);
new CsTeams:kteam=cs_get_user_team(killer)
message_begin( MSG_ALL, ScoreInfo, {0,0,0}, 0 );
write_byte( killer );
write_short( kfrags );
write_short( kdeaths);
write_short( 0 );
write_short( get_teamId(kteam) );
message_end();
new vfrags = pev( victim , pev_frags);
set_pev(victim,pev_frags,float(++vfrags));
new vdeaths=cs_get_user_deaths (victim);
new CsTeams:vteam=cs_get_user_team(victim);
message_begin( MSG_ALL,ScoreInfo, {0,0,0}, 0 );
write_byte( victim );
write_short( vfrags );
write_short( vdeaths);
write_short( 0 );
write_short( get_teamId(vteam) );
message_end();
user_silentkill( victim );
return PLUGIN_CONTINUE;
}
public Vexd_PlayerModel(player){
if (!player) return PLUGIN_HANDLED
cs_set_user_model(player, "trekker")
return PLUGIN_HANDLED_MAIN ;
}
public Vexd_ClearModel(player) {
if (!player) return PLUGIN_HANDLED
cs_reset_user_model(player)
return PLUGIN_HANDLED_MAIN;
}
//by DoubleTap
slay_explode(vec1[3]) {
// blast circles
message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
write_byte( 21 )
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2] + 16)
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2] + 1936)
write_short( white )
write_byte( 0 ) // startframe
write_byte( 0 ) // framerate
write_byte( 2 ) // life
write_byte( 16 ) // width
write_byte( 0 ) // noise
write_byte( 188 ) // r
write_byte( 220 ) // g
write_byte( 255 ) // b
write_byte( 255 ) //brightness
write_byte( 0 ) // speed
message_end()
//Explosion2
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte( 12 )
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_byte( 188 ) // byte (scale in 0.1's)
write_byte( 10 ) // byte (framerate)
message_end()
//Smoke
message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
write_byte( 5 )
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_short( g_sModelIndexSmoke )
write_byte( 2 )
write_byte( 10 )
message_end()
}
give_ammo(id)
{
for(new i=0;i<6;i++)
{
give_item(id, "ammo_357sig");
give_item(id, "ammo_762nato");
give_item(id, "ammo_buckshot");
give_item(id, "ammo_45acp");
give_item(id, "ammo_556nato");
give_item(id, "ammo_9mm");
give_item(id, "ammo_338magnum");
give_item(id, "ammo_556natobox");
give_item(id, "ammo_50ae");
give_item(id, "ammo_57mm");
}
}
public britney(id)
{
if( (is_user_alive(id)))
{
client_cmd(id,"impulse 100");
new r,g,b;
r = random_num(0,255);
g = random_num(0,255);
b = random_num(0,255);
new korigin[3];
get_user_origin(id,korigin);
new wpn = read_data(2);
if (random(30) == 1)
{
//TE_SPRITE - additive sprite, plays 1 cycle
message_begin( MSG_BROADCAST,SVC_TEMPENTITY);
write_byte( 17 );
write_coord(korigin[0]); // coord, coord, coord (position)
write_coord(korigin[1]);
write_coord(korigin[2]);
write_short( sprMflash ); // short (sprite index)
write_byte ( 20 ); // byte (scale in 0.1's)
write_byte ( 200 ); // byte (brightness)
message_end();
}
else if (random(50) == 8)
{
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(20); // TE_BEAMDISK
write_coord(korigin[0]); // coord coord coord (center position)
write_coord(korigin[1]);
write_coord(korigin[2]);
write_coord(korigin[0]); // coord coord coord (axis and radius)
write_coord(korigin[1]);
write_coord(korigin[2]+random_num(250,750));
switch(random_num(0,1))
{
case 0: write_short(sprFlare6); // short (sprite index)
case 1: write_short(sprLightning); // short (sprite index)
}
write_byte(0); // byte (starting frame)
write_byte(0); // byte (frame rate in 0.1's)
write_byte(45); // byte (life in 0.1's)
write_byte(150); // byte (line width in 0.1's)
write_byte(0); // byte (noise amplitude in 0.01's)
write_byte®; // byte,byte,byte (color)
write_byte(g);
write_byte( ;
write_byte(155); // byte (brightness)
write_byte(0); // byte (scroll speed in 0.1's)
message_end();
}
else if (random(30) == 15)
{
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(15); // TE_SPRITETRAIL
write_coord(korigin[0]); // coord, coord, coord (start)
write_coord(korigin[1]);
write_coord(korigin[2]-20);
write_coord(korigin[0]); // coord, coord, coord (end)
write_coord(korigin[1]);
write_coord(korigin[2]+20);
if ((r > 128) && (g < 127) && (b < 127))
write_short(sprRflare);
else if ((r < 127) && (g > 128) && (b < 127))
write_short(sprGflare);
else if ((r < 127) && (g < 127) && (b > 128))
write_short(sprBflare);
else if ((r < 127) && (g > 128) && (b > 128))
write_short(sprTflare);
else if ((r > 128) && (g < 127) && (b < 200) && (b > 100))
write_short(sprPflare);
else if ((r > 128) && (g > 128) && (b < 127))
write_short(sprYflare);
else if ((r > 128) && (g > 100) && (g < 200) && (b < 127))
write_short(sprOflare);
else
write_short(sprBflare);
write_byte(get_cvar_num("fireworks_flare_count")); // byte (count)
write_byte(10); // byte (life in 0.1's)
write_byte(10); // byte (scale in 0.1's)
write_byte(random_num(40,100)); // byte (velocity along vector in 10's)
write_byte(40); // byte (randomness of velocity in 10's)
message_end();
}
else if (random(30) == 26)
{
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(27);
write_coord(korigin[0]); // coord, coord, coord (start)
write_coord(korigin[1]);
write_coord(korigin[2]);
write_byte(30); // byte (radius in 10's)
write_byte®; // byte byte byte (color)
write_byte(g);
write_byte( ;
write_byte(70); // byte (life in 10's)
write_byte(11); // byte (decay rate in 10's)
message_end();
}
else if (random(10) == 7)
{
new color = random_num(0,255);
new width = random_num(400,1000);
// TE_PARTICLEBURST
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(122); // very similar to lavasplash.
write_coord(korigin[0]); // coord, coord, coord (start)
write_coord(korigin[1]);
write_coord(korigin[2]);
write_short (width);
write_byte (color); // (particle color)
write_byte (40); // (duration * 10) (will be randomized a bit)
message_end();
}
else if (random(10) == 9)
{
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(14);
write_coord(korigin[0]);
write_coord(korigin[1]);
write_coord(korigin[2]-100);
write_byte(5000); // radius
write_byte(80);
write_byte(20);
message_end();
}
else if (wpn == 6)
{
// nothing...
}
else
{
engclient_cmd(id,"weapon_knife");
}
}
else
remove_task(id);
return PLUGIN_CONTINUE;
}
public smokin_1(id)
{
if(is_user_alive(id))
{
if(get_cvar_num("amx_dice_debug") == 2)
log_amx("DEBUG (Advanced Roll the Dice): Function smokin_1");
new vec[3];
new a,b, y1,x1;
x1 = random_num(-40,40);
y1 = random_num(-40,40);
get_user_origin(id,vec);
//Smoke
message_begin( MSG_BROADCAST,SVC_TEMPENTITY);
write_byte( 5 );
write_coord(vec[0]+x1);
write_coord(vec[1]+y1);
write_coord(vec[2]+30);
write_short( sprSmoke );
write_byte( 30 );
write_byte( 10 );
message_end();
setFOV(id,random_num(10,120));
b = random_num(0,9);
if(moved[id])
{
client_cmd(id,"-moveleft;-moveright;-forward;-back");
moved[id] = false;
}
if(b == 1)
{
emit_sound(id,CHAN_ITEM, sounds[12], 1.0, ATTN_NORM, 0, PITCH_NORM);
a = random_num(0,3);
client_cmd(id,moves[a]);
moved[id] = true;
new aimvec[3];
new velocityvec[3];
new length;
new speed = 500;
get_user_origin(id,aimvec,2);
velocityvec[0]=aimvec[0]-vec[0];
velocityvec[1]=aimvec[1]-vec[1];
velocityvec[2]=aimvec[2]-vec[2];
length=sqrt(velocityvec[0]*velocityvec[0]+velocityvec[1]*velocityvec[1]+velocityvec[2]*velocityvec[2]);
velocityvec[0]=velocityvec[0]*speed/length;
velocityvec[1]=velocityvec[1]*speed/length;
velocityvec[2]=velocityvec[2]*speed/length;
emit_sound(id,CHAN_ITEM, sounds[12], 1.0, ATTN_NORM, 0, PITCH_NORM);
a = random_num(0,3);
client_cmd(id,moves[a]);
moved[id] = true;
// TE_MODEL from HL-SDK common/const.h
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(106);
write_coord(vec[0]);
write_coord(vec[1]);
write_coord(vec[2]+20);
write_coord(velocityvec[0]);
write_coord(velocityvec[1]);
write_coord(velocityvec[2]+100);
write_angle (0);
if(random(8) == 4)
write_short (mdlWbottle);
else
write_short (mdlWcan);
write_byte (2);
write_byte (255);
message_end();
}
}
return PLUGIN_CONTINUE;
}
setFOV(id, FOV)
{
message_begin(MSG_ONE, 95, {0,0,0}, id);
write_byte(FOV);
message_end();
}
public sqrt(num)
{
new div = num;
new result = 1;
while (div > result) // end when div == result, or just below
{
div = (div + result) / 2; // take mean value as new divisor
result = num / div;
}
return div;
}
public give_fullammo(id , weapon , clip)
{
if (!is_user_alive(id))
return PLUGIN_HANDLED
if (!clip)
{
new weapname[33]
get_weaponname(weapon , weapname , 32)
new wpn = -1
while((wpn = fm_find_ent_by_class(wpn , weapname)) != 0)
{
if(id == pev(wpn,pev_owner))
{
cs_set_weapon_ammo(wpn , maxclip(weapon))
break;
}
}
}
return PLUGIN_CONTINUE
}
//Stock by v3x
stock maxclip(weapon)
{
new ca = 0
switch (weapon)
{
case CSW_P228 : ca = 13
case CSW_SCOUT : ca = 10
case CSW_HEGRENADE : ca = 0
case CSW_XM1014 : ca = 7
case CSW_C4 : ca = 0
case CSW_MAC10 : ca = 30
case CSW_AUG : ca = 30
case CSW_SMOKEGRENADE : ca = 0
case CSW_ELITE : ca = 30
case CSW_FIVESEVEN : ca = 20
case CSW_UMP45 : ca = 25
case CSW_SG550 : ca = 30
case CSW_GALI : ca = 35
case CSW_FAMAS : ca = 25
case CSW_USP : ca = 12
case CSW_GLOCK18 : ca = 20
case CSW_AWP : ca = 10
case CSW_MP5NAVY : ca = 30
case CSW_M249 : ca = 100
case CSW_M3 : ca = 8
case CSW_M4A1 : ca = 30
case CSW_TMP : ca = 30
case CSW_G3SG1 : ca = 20
case CSW_FLASHBANG : ca = 0;
case CSW_DEAGLE : ca = 7
case CSW_SG552 : ca = 30
case CSW_AK47 : ca = 30
case CSW_P90 : ca = 50
}
return ca;
}
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <fakemeta>
#include <engine>
#define fm_find_ent_by_class(%1,%2) engfunc(EngFunc_FindEntityByString, %1, "classname", %2)
#define MAX_PLAYERS 32
#define MAX_INDEX MAX_PLAYERS+1
#define COOLDOWN 30.0
#define HLDTIME 5.0
#define HUD_RED 0
#define HUD_GREEN 255
#define HUD_BLUE 0
new SayText,TeamInfo,ScoreInfo;
new bool:cantTake[MAX_INDEX];
new bool:isRambo[MAX_INDEX];
new bool:wasRambo[MAX_INDEX];
new bool:isoldman[MAX_INDEX];
new bool:isIdiot[MAX_INDEX];
new bool:wasVIP[MAX_INDEX];
new bool:wasBritney[MAX_INDEX];
new bool:wasMonkey[MAX_INDEX];
new bool:wasDrunk[MAX_INDEX];
new bool:moved[MAX_INDEX];
new bool:have_unlimited[MAX_INDEX];
new bool:haveMac10[MAX_INDEX];
new bool:cpun[MAX_INDEX];
new uses[MAX_INDEX];
new user_weapons[MAX_INDEX][33];
new gmsgBarTime;
#define SOUNDS_C 15
new sounds[SOUNDS_C][50]=
{
"Ruletka/Kosiarz/niemambroni.wav", //0
"Ruletka/Rambo/pozabijam.wav", //1
"Ruletka/Rambo/niepokonany.wav", //2
"Ruletka/Stary_czlowiek/staryczlowiek.wav", //3
"Ruletka/VIP/VIP.wav", //4
"Ruletka/VIP/koniec_VIPa.wav", //5
"Ruletka/Britney/dieta_bananowa.wav", //6
"Ruletka/Britney/spy_girls.wav", //7
"Ruletka/Malpa/Malpa.wav", //8
"Ruletka/Malpa/ekspetymenty.wav", //9
"Ruletka/Pijak/burp.wav", //10
"Ruletka/Pijak/pijak.wav", //11
"Ruletka/Wiesniak/wiesniak.wav", //12
"Ruletka/Cpun/nanana.wav", //13
"Ruletka/Cpun/czarny.wav" //14
}
enum Color
{
YELLOW = 1, // Yellow
GREEN, // Green Color
TEAM_COLOR, // Red, grey, blue
GREY, // grey
RED, // Red
BLUE, // Blue
}
new TeamName[][] =
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
}
new moves[4][] = {"+moveleft","+moveright","+back","+forward"};
new g_sModelIndexSmoke, white;
new sprMflash,sprFlare6,sprLightning;
new sprBflare, sprRflare,sprGflare,sprTflare;
new sprOflare,sprPflare, sprYflare;
new sprSmoke,mdlWbottle,mdlWcan;
new r_speed,r_britney_time,r_pijak_time;
new round=false;
public plugin_init(){
register_plugin( "Ruletka", "3.0", "R3X" ); // dzięki
register_dictionary("ruletka.txt");
register_logevent("round_end", 2, "1=Round_End");
register_logevent("round_start", 2, "1=Round_Start");
register_clcmd("say /ruletka","silverek");
register_event("CurWeapon","event_cur_weapon","be", "1=1");
register_event("Damage","event_damage","b");
register_event("DeathMsg","event_death","a");
SayText = get_user_msgid("SayText");
TeamInfo = get_user_msgid("TeamInfo");
gmsgBarTime = get_user_msgid("BarTime");
r_speed = register_cvar("ruletka_oldman_speed","72.0");
r_britney_time= register_cvar("ruletka_britney_time","25");
r_pijak_time = register_cvar("ruletka_pijak_time","25");
register_event( "TextMsg", "round_end", "a", "2&#Game_will_restart_in" );
ScoreInfo=get_user_msgid("ScoreInfo");
register_clcmd("showWeapons","showWeapons");
}
public showWeapons(id)
{
for(new i=0;i<33;i++)
{
new wid=user_weapons[id][i],weaponname[15];
get_weaponname(wid,weaponname,14);
console_print(id,"%s",weaponname);
}
}
public client_putinserver(id)
{
cantTake[id]=false;
isRambo[id]=false;
isIdiot[id]=false;
uses[id]=0;
wasVIP[id]=false;
wasBritney[id]=false;
wasMonkey[id]=false;
wasDrunk[id]=false;
have_unlimited[id]=false;
haveMac10[id]=false;
cpun[id]=false;
}
public round_start()
{
set_task(0.3,"makeOldMan");
round=true;
new Players[32], playerCount, player;
get_players(Players, playerCount);
for (new i=0; i<playerCount; i++) {
player = Players[i];
if(isoldman[player])
{
if(!task_exists(player))
set_task(10.0,"removeOldMan",player);
}
set_pev(player,pev_gravity, 1.0);
setFOV(player,90);
removeNoClip(player);
}
}
public makeOldMan()
{
new Players[32], playerCount;
get_players(Players, playerCount);
for (new i=0; i<playerCount; i++) {
new id=Players[i];
if(isoldman[id])
set_user_maxspeed(id, get_pcvar_float(r_speed));
}
}
public round_end()
{
round=false;
new Players[32], playerCount, player;
get_players(Players, playerCount);
for (new i=0; i<playerCount; i++) {
player = Players[i];
if(isoldman[player])
removeOldMan(player);
if(task_exists(player))
remove_task(player);
cantTake[player]=false;
new name[40];
get_user_name(player,name,39);
Vexd_ClearModel(player);
isRambo[player]=false;
isoldman[player]=false;
set_user_godmode (player);
wasRambo[player]=false;
isIdiot[player]=false;
if(uses[player]==2)
uses[player]=0;
if(uses[player]==1)
uses[player]=2;
clear_weapons(player);
wasVIP[player]=false;
wasBritney[player]=false;
if(wasMonkey[player])
set_pev(player,pev_gravity, 1.0);
wasMonkey[player]=false;
setFOV(player,90);
wasDrunk[player]=false;
have_unlimited[player]=false;
haveMac10[player]=false;
cpun[player]=false;
}
}
clear_weapons(id)
{
for(new i=0; i<33; i++)
{
user_weapons[id][i] = 0;
}
}
public event_cur_weapon(id)
{
new weapon = read_data(2);
new clip = read_data(3);
if(haveMac10[id] && clip==0)
haveMac10[id]=false;
if(!is_user_alive(id))
return PLUGIN_HANDLED;
if(isoldman[id])
{
set_user_maxspeed(id, get_pcvar_float(r_speed));
}
if(cantTake[id] && isRambo[id])
engclient_cmd(id,"weapon_m249");
else if(cantTake[id] && haveMac10[id])
{
engclient_cmd(id,"weapon_mac10");
}
else if(cantTake[id])
engclient_cmd(id,"weapon_knife");
if(have_unlimited[id])
{
give_fullammo(id , weapon , clip);
}
return PLUGIN_CONTINUE;
}
public silverek(id){
new buf[80];
if (!is_user_alive ( id ))
{
formatex(buf,79,"%L",LANG_PLAYER,"PL_DEAD");
ColorChat(id, GREEN, buf)
return PLUGIN_HANDLED;
}
if(uses[id]!=0 || !round)
{
formatex(buf,79,"%L",LANG_PLAYER,"PL_WAIT");
ColorChat(id, GREEN, buf);
return PLUGIN_HANDLED;
}
nagroda(id);
return PLUGIN_HANDLED;
}
HUDsay(message[])
{
set_hudmessage(HUD_RED, HUD_GREEN, HUD_BLUE, -1.0, 0.24, 0, 6.0, HLDTIME);
show_hudmessage(0, message)
}
nagroda(id){
new name[40];
get_user_name(id,name,39);
new buf[80],buf2[80],buf3[80];
switch(random_num(1,16))
{
case 1:{//Kosiarz
strip_user_weapons (id);
give_item(id, "weapon_knife");
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM1");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM1_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM1_HUD",name);
cantTake[id]=true;
play(0, sounds[0]);
}
case 2 :{//Idiota
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM2");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM2_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM2_HUD",name);
Vexd_PlayerModel(id);
isIdiot[id]=true;
}
case 3 :{//Rambo
set_user_godmode ( id, 1);
strip_user_weapons (id);
give_item(id, "weapon_knife");
give_item(id, "weapon_m249");
give_item(id, "ammo_556natobox");
give_item(id, "ammo_556natobox");
give_item(id, "ammo_556natobox");
give_item(id, "ammo_556natobox");
give_item(id, "ammo_556natobox");
give_item(id, "ammo_556natobox");
give_item(id, "ammo_556natobox");
message_begin(MSG_ONE,gmsgBarTime,{0,0,0},id);
write_short(20);
message_end();
//aura
set_pev(id,pev_rendercolor,200.0,0.0,0.0);
set_pev(id,pev_rendermode,kRenderNormal);
set_pev(id,pev_renderfx,kRenderFxGlowShell);
set_pev(id,pev_renderamt,25.0);
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM3");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM3_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM3_HUD",name);
set_task(20.0,"removeRambo",id);
isRambo[id]=true;
cantTake[id]=true;
play(0,sounds[1]);
}
case 4:{//stary czlowiek
new boom=random_num(0,9);
if(boom < 3){
new vec[3];
get_user_origin ( id, vec);
slay_explode(vec);
user_kill(id);
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM4_HUD",name);
}
else
{
isoldman[id]=true;
if(round)
set_user_maxspeed(id, get_pcvar_float(r_speed));
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM4_HUD2",name);
}
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM4");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM4_DESC");
if(isoldman[id] && round)
set_task(10.0,"removeOldMan",id);
play(0,sounds[3]);
}
case 5:{//Vip
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM6");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM6_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM6_HUD",name);
play(0,sounds[5]);
wasVIP[id]=true;
give_item(id, "weapon_m4a1");
give_item(id, "weapon_awp");
give_item(id, "weapon_m3");
give_ammo(id);
}
case 6:{//malpa
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM7");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM7_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM7_HUD",name);
set_pev(id,pev_gravity,0.6);
play(0, sounds[10]);
wasMonkey[id]=true;
}
case 7:{//Britney
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM8");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM8_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM8_HUD",name);
set_task(0.5, "britney",id,"",0,"b");
new args[1];
args[0]=id;
set_task(get_pcvar_float(r_britney_time),"removeBritney",0,args,1);
wasBritney[id]=true;
play(0, sounds[8]);
}
case 8:{//Pijak
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM9");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM9_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM9_HUD",name);
set_task(0.5,"smokin_1",id,"",0,"b");
new args[1];
args[0]=id;
set_task(get_pcvar_float(r_pijak_time),"removePijak",0,args,1);
wasDrunk[id]=true;
}
case 9:{//full ammo
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM10");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM10_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM10_HUD",name);
have_unlimited[id]=true;
}
case 10:{//Dodatkowe HP
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM11");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM11_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM11_HUD",name);
new health=pev(id,pev_health);
set_pev(id,pev_health,float(min(health+random_num(10,50),255)));
}
case 11:{//Dodatkowa kasa
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM12");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM12_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM12_HUD",name);
new prize=random_num(2000,5000);
cs_set_user_money(id, cs_get_user_money(id)+prize);
}
case 12:{//slay
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM13");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM13_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM13_HUD",name);
new vec[3];
get_user_origin ( id, vec);
slay_explode(vec);
user_kill(id);
}
case 13:{//slap
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM14");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM14_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM14_HUD",name);
new args[2];
args[0]=id;
args[1]=0;
set_task(0.2, "slapPlayer",_,args,2);
}
case 14:{//noclip
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM15");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM15_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM15_HUD",name);
set_user_noclip(id, 1);
set_task(15.0,"removeNoClip",id);
message_begin(MSG_ONE,gmsgBarTime,{0,0,0},id);
write_short(15);
message_end();
}
case 15:{//Wieśniak
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM16");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM16_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM16_HUD",name);
strip_user_weapons(id);
give_item(id, "weapon_mac10");
give_item(id, "weapon_knife");
haveMac10[id]=true;
cantTake[id]=true;
play(0, sounds[14]);
}
case 16:{//Ćpun
formatex(buf,79,"[Ruletka]^x03 %L",LANG_PLAYER,"RULETKA_ITEM17");
formatex(buf2,79,"[Ruletka]^x01 %L",LANG_PLAYER,"RULETKA_ITEM17_DESC");
formatex(buf3,79,"%L",LANG_SERVER,"RULETKA_ITEM17_HUD",name);
setFOV(id, 150);
play(0, sounds[13]);
cpun[id]=true;
}
}
ColorChat(id, GREEN, buf);
ColorChat(id, GREEN, buf2);
HUDsay(buf3);
uses[id]=1;
return true;
}
public slapPlayer(args[2]){
user_slap(args[0],random_num(0,5));
if(args[1]<9){
args[1]++;
set_task(0.2, "slapPlayer",_,args,2);
}
}
public removeRambo(id)
{
isRambo[id]=false;
wasRambo[id]=true;
cantTake[id]=false;
set_user_godmode (id);
set_pev(id,pev_renderfx,kRenderFxNone);
}
public removeOldMan(id)
{
isoldman[id]=false;
set_user_maxspeed(id,250.0);
}
public removeBritney(id[])
{
remove_task(id[0]);
wasBritney[id[0]]=false;
play(0, sounds[9]);
}
public removePijak(id[])
{
remove_task(id[0]);
wasDrunk[id[0]]=false;
play(0, sounds[13]);
setFOV(id[0],90);
client_cmd(id[0],"-moveleft;-moveright;-forward;-back");
}
public removeNoClip(id)
{
set_user_noclip(id);
}
public ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
static message[256];
switch(type)
{
case YELLOW: // Yellow
{
message[0] = 0x01;
}
case GREEN: // Green
{
message[0] = 0x04;
}
default: // White, Red, Blue
{
message[0] = 0x03;
}
}
vformat(message[1], 251, msg, 4);
// Make sure message is not longer than 192 character. Will crash the server.
message[192] = '^0';
new team, ColorChange, index, MSG_Type;
if(!id)
{
index = FindPlayer();
MSG_Type = MSG_ALL;
} else {
MSG_Type = MSG_ONE;
index = id;
}
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, SayText, _, id);
write_byte(id)
write_string(message);
message_end();
}
Team_Info(id, type, team[])
{
message_begin(type, 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()
{
new i = -1;
while(i <= MAX_PLAYERS)
{
if(is_user_connected(++i))
{
return i;
}
}
return -1;
}
play(id, sound[])
{
new end=strlen(sound)-4;
if(containi(sound,".mp3") == end && end>0)
client_cmd(id,"mp3 play sound/%s",sound);
else if(containi(sound,".wav") == end && end>0)
client_cmd(id, "spk sound/%s",sound);
else
client_cmd(id, "speak %s",sound);
}
public plugin_precache()
{
for(new i=0;i<SOUNDS_C;i++)
precache_sound(sounds[i]);
precache_model("models/player/trekker/trekker.mdl")
g_sModelIndexSmoke = precache_model("sprites/steam1.spr");
white = precache_model("sprites/white.spr");
sprMflash = precache_model("sprites/muzzleflash.spr");
sprFlare6 = precache_model("sprites/Flare6.spr");
sprLightning = precache_model("sprites/lgtning.spr");
sprBflare = precache_model("sprites/fireworks/bflare.spr");
sprRflare = precache_model("sprites/fireworks/rflare.spr");
sprGflare = precache_model("sprites/fireworks/gflare.spr");
sprTflare = precache_model("sprites/fireworks/tflare.spr");
sprOflare = precache_model("sprites/fireworks/oflare.spr");
sprPflare = precache_model("sprites/fireworks/pflare.spr");
sprYflare = precache_model("sprites/fireworks/yflare.spr");
sprSmoke = precache_model("sprites/steam1.spr");
if(file_exists("models/winebottle.mdl")==1)
{
mdlWbottle = precache_model("models/winebottle.mdl");
}
else
{
mdlWbottle = precache_model("models/can.mdl");
}
mdlWcan = precache_model("models/can.mdl");
}
public event_damage(victim_id)
{
new attacker_id = get_user_attacker(victim_id);
if(!is_user_alive(attacker_id))
return;
if(isRambo[attacker_id])
log_kill(attacker_id,victim_id,"m249")
}
public event_death()
{
new vid=read_data(2);
if(wasRambo[vid] || isRambo[vid])
play(0,sounds[2]);
if(wasVIP[vid])
play(0,sounds[7]);
if(wasMonkey[vid])
play(0,sounds[11]);
if(cpun[vid])
play(0,sounds[14]);
if(isIdiot[vid])
Vexd_ClearModel(vid);
}
//add money
public addMoney(id, money)
{
if(is_user_alive(id))
{
new newMoney = cs_get_user_money(id)+money;
if(newMoney > 16000)
newMoney = 16000;
cs_set_user_money(id, newMoney);
}
}
//reduce money
public reduceMoney(id, money)
{
if(is_user_alive(id))
{
new newMoney = cs_get_user_money(id)-money;
if(newMoney < 0)
newMoney = 0;
cs_set_user_money(id, newMoney);
}
}
//only for msg ScoreInfo - team
public get_teamId(CsTeams:team)
{
if(team==CS_TEAM_UNASSIGNED)
return 0;
else if(team==CS_TEAM_T)
return 1;
else if(team==CS_TEAM_CT)
return 2;
else if(team==CS_TEAM_SPECTATOR)
return 3;
return 0;
}
stock log_kill(killer, victim, weapon[], headshot=0){
if(!is_user_alive(victim))
return PLUGIN_CONTINUE;
new TK=get_user_team(killer) == get_user_team(victim);
message_begin( MSG_ALL, get_user_msgid("DeathMsg"), {0,0,0}, 0 );
write_byte( killer );
write_byte( victim );
write_byte( headshot );
write_string( weapon );
message_end();
new kfrags = pev( killer , pev_frags);
if(!TK)
{
addMoney(killer,300);
set_pev(killer,pev_frags,float(++kfrags));
}
else
{
reduceMoney(killer,3300);
set_pev(killer,pev_frags,float(--kfrags));
}
new kdeaths=cs_get_user_deaths (killer);
new CsTeams:kteam=cs_get_user_team(killer)
message_begin( MSG_ALL, ScoreInfo, {0,0,0}, 0 );
write_byte( killer );
write_short( kfrags );
write_short( kdeaths);
write_short( 0 );
write_short( get_teamId(kteam) );
message_end();
new vfrags = pev( victim , pev_frags);
set_pev(victim,pev_frags,float(++vfrags));
new vdeaths=cs_get_user_deaths (victim);
new CsTeams:vteam=cs_get_user_team(victim);
message_begin( MSG_ALL,ScoreInfo, {0,0,0}, 0 );
write_byte( victim );
write_short( vfrags );
write_short( vdeaths);
write_short( 0 );
write_short( get_teamId(vteam) );
message_end();
user_silentkill( victim );
return PLUGIN_CONTINUE;
}
public Vexd_PlayerModel(player){
if (!player) return PLUGIN_HANDLED
cs_set_user_model(player, "trekker")
return PLUGIN_HANDLED_MAIN ;
}
public Vexd_ClearModel(player) {
if (!player) return PLUGIN_HANDLED
cs_reset_user_model(player)
return PLUGIN_HANDLED_MAIN;
}
//by DoubleTap
slay_explode(vec1[3]) {
// blast circles
message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
write_byte( 21 )
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2] + 16)
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2] + 1936)
write_short( white )
write_byte( 0 ) // startframe
write_byte( 0 ) // framerate
write_byte( 2 ) // life
write_byte( 16 ) // width
write_byte( 0 ) // noise
write_byte( 188 ) // r
write_byte( 220 ) // g
write_byte( 255 ) // b
write_byte( 255 ) //brightness
write_byte( 0 ) // speed
message_end()
//Explosion2
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte( 12 )
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_byte( 188 ) // byte (scale in 0.1's)
write_byte( 10 ) // byte (framerate)
message_end()
//Smoke
message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
write_byte( 5 )
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_short( g_sModelIndexSmoke )
write_byte( 2 )
write_byte( 10 )
message_end()
}
give_ammo(id)
{
for(new i=0;i<6;i++)
{
give_item(id, "ammo_357sig");
give_item(id, "ammo_762nato");
give_item(id, "ammo_buckshot");
give_item(id, "ammo_45acp");
give_item(id, "ammo_556nato");
give_item(id, "ammo_9mm");
give_item(id, "ammo_338magnum");
give_item(id, "ammo_556natobox");
give_item(id, "ammo_50ae");
give_item(id, "ammo_57mm");
}
}
public britney(id)
{
if( (is_user_alive(id)))
{
client_cmd(id,"impulse 100");
new r,g,b;
r = random_num(0,255);
g = random_num(0,255);
b = random_num(0,255);
new korigin[3];
get_user_origin(id,korigin);
new wpn = read_data(2);
if (random(30) == 1)
{
//TE_SPRITE - additive sprite, plays 1 cycle
message_begin( MSG_BROADCAST,SVC_TEMPENTITY);
write_byte( 17 );
write_coord(korigin[0]); // coord, coord, coord (position)
write_coord(korigin[1]);
write_coord(korigin[2]);
write_short( sprMflash ); // short (sprite index)
write_byte ( 20 ); // byte (scale in 0.1's)
write_byte ( 200 ); // byte (brightness)
message_end();
}
else if (random(50) == 8)
{
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(20); // TE_BEAMDISK
write_coord(korigin[0]); // coord coord coord (center position)
write_coord(korigin[1]);
write_coord(korigin[2]);
write_coord(korigin[0]); // coord coord coord (axis and radius)
write_coord(korigin[1]);
write_coord(korigin[2]+random_num(250,750));
switch(random_num(0,1))
{
case 0: write_short(sprFlare6); // short (sprite index)
case 1: write_short(sprLightning); // short (sprite index)
}
write_byte(0); // byte (starting frame)
write_byte(0); // byte (frame rate in 0.1's)
write_byte(45); // byte (life in 0.1's)
write_byte(150); // byte (line width in 0.1's)
write_byte(0); // byte (noise amplitude in 0.01's)
write_byte®; // byte,byte,byte (color)
write_byte(g);
write_byte( ;
write_byte(155); // byte (brightness)
write_byte(0); // byte (scroll speed in 0.1's)
message_end();
}
else if (random(30) == 15)
{
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(15); // TE_SPRITETRAIL
write_coord(korigin[0]); // coord, coord, coord (start)
write_coord(korigin[1]);
write_coord(korigin[2]-20);
write_coord(korigin[0]); // coord, coord, coord (end)
write_coord(korigin[1]);
write_coord(korigin[2]+20);
if ((r > 128) && (g < 127) && (b < 127))
write_short(sprRflare);
else if ((r < 127) && (g > 128) && (b < 127))
write_short(sprGflare);
else if ((r < 127) && (g < 127) && (b > 128))
write_short(sprBflare);
else if ((r < 127) && (g > 128) && (b > 128))
write_short(sprTflare);
else if ((r > 128) && (g < 127) && (b < 200) && (b > 100))
write_short(sprPflare);
else if ((r > 128) && (g > 128) && (b < 127))
write_short(sprYflare);
else if ((r > 128) && (g > 100) && (g < 200) && (b < 127))
write_short(sprOflare);
else
write_short(sprBflare);
write_byte(get_cvar_num("fireworks_flare_count")); // byte (count)
write_byte(10); // byte (life in 0.1's)
write_byte(10); // byte (scale in 0.1's)
write_byte(random_num(40,100)); // byte (velocity along vector in 10's)
write_byte(40); // byte (randomness of velocity in 10's)
message_end();
}
else if (random(30) == 26)
{
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(27);
write_coord(korigin[0]); // coord, coord, coord (start)
write_coord(korigin[1]);
write_coord(korigin[2]);
write_byte(30); // byte (radius in 10's)
write_byte®; // byte byte byte (color)
write_byte(g);
write_byte( ;
write_byte(70); // byte (life in 10's)
write_byte(11); // byte (decay rate in 10's)
message_end();
}
else if (random(10) == 7)
{
new color = random_num(0,255);
new width = random_num(400,1000);
// TE_PARTICLEBURST
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(122); // very similar to lavasplash.
write_coord(korigin[0]); // coord, coord, coord (start)
write_coord(korigin[1]);
write_coord(korigin[2]);
write_short (width);
write_byte (color); // (particle color)
write_byte (40); // (duration * 10) (will be randomized a bit)
message_end();
}
else if (random(10) == 9)
{
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(14);
write_coord(korigin[0]);
write_coord(korigin[1]);
write_coord(korigin[2]-100);
write_byte(5000); // radius
write_byte(80);
write_byte(20);
message_end();
}
else if (wpn == 6)
{
// nothing...
}
else
{
engclient_cmd(id,"weapon_knife");
}
}
else
remove_task(id);
return PLUGIN_CONTINUE;
}
public smokin_1(id)
{
if(is_user_alive(id))
{
if(get_cvar_num("amx_dice_debug") == 2)
log_amx("DEBUG (Advanced Roll the Dice): Function smokin_1");
new vec[3];
new a,b, y1,x1;
x1 = random_num(-40,40);
y1 = random_num(-40,40);
get_user_origin(id,vec);
//Smoke
message_begin( MSG_BROADCAST,SVC_TEMPENTITY);
write_byte( 5 );
write_coord(vec[0]+x1);
write_coord(vec[1]+y1);
write_coord(vec[2]+30);
write_short( sprSmoke );
write_byte( 30 );
write_byte( 10 );
message_end();
setFOV(id,random_num(10,120));
b = random_num(0,9);
if(moved[id])
{
client_cmd(id,"-moveleft;-moveright;-forward;-back");
moved[id] = false;
}
if(b == 1)
{
emit_sound(id,CHAN_ITEM, sounds[12], 1.0, ATTN_NORM, 0, PITCH_NORM);
a = random_num(0,3);
client_cmd(id,moves[a]);
moved[id] = true;
new aimvec[3];
new velocityvec[3];
new length;
new speed = 500;
get_user_origin(id,aimvec,2);
velocityvec[0]=aimvec[0]-vec[0];
velocityvec[1]=aimvec[1]-vec[1];
velocityvec[2]=aimvec[2]-vec[2];
length=sqrt(velocityvec[0]*velocityvec[0]+velocityvec[1]*velocityvec[1]+velocityvec[2]*velocityvec[2]);
velocityvec[0]=velocityvec[0]*speed/length;
velocityvec[1]=velocityvec[1]*speed/length;
velocityvec[2]=velocityvec[2]*speed/length;
emit_sound(id,CHAN_ITEM, sounds[12], 1.0, ATTN_NORM, 0, PITCH_NORM);
a = random_num(0,3);
client_cmd(id,moves[a]);
moved[id] = true;
// TE_MODEL from HL-SDK common/const.h
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(106);
write_coord(vec[0]);
write_coord(vec[1]);
write_coord(vec[2]+20);
write_coord(velocityvec[0]);
write_coord(velocityvec[1]);
write_coord(velocityvec[2]+100);
write_angle (0);
if(random(8) == 4)
write_short (mdlWbottle);
else
write_short (mdlWcan);
write_byte (2);
write_byte (255);
message_end();
}
}
return PLUGIN_CONTINUE;
}
setFOV(id, FOV)
{
message_begin(MSG_ONE, 95, {0,0,0}, id);
write_byte(FOV);
message_end();
}
public sqrt(num)
{
new div = num;
new result = 1;
while (div > result) // end when div == result, or just below
{
div = (div + result) / 2; // take mean value as new divisor
result = num / div;
}
return div;
}
public give_fullammo(id , weapon , clip)
{
if (!is_user_alive(id))
return PLUGIN_HANDLED
if (!clip)
{
new weapname[33]
get_weaponname(weapon , weapname , 32)
new wpn = -1
while((wpn = fm_find_ent_by_class(wpn , weapname)) != 0)
{
if(id == pev(wpn,pev_owner))
{
cs_set_weapon_ammo(wpn , maxclip(weapon))
break;
}
}
}
return PLUGIN_CONTINUE
}
//Stock by v3x
stock maxclip(weapon)
{
new ca = 0
switch (weapon)
{
case CSW_P228 : ca = 13
case CSW_SCOUT : ca = 10
case CSW_HEGRENADE : ca = 0
case CSW_XM1014 : ca = 7
case CSW_C4 : ca = 0
case CSW_MAC10 : ca = 30
case CSW_AUG : ca = 30
case CSW_SMOKEGRENADE : ca = 0
case CSW_ELITE : ca = 30
case CSW_FIVESEVEN : ca = 20
case CSW_UMP45 : ca = 25
case CSW_SG550 : ca = 30
case CSW_GALI : ca = 35
case CSW_FAMAS : ca = 25
case CSW_USP : ca = 12
case CSW_GLOCK18 : ca = 20
case CSW_AWP : ca = 10
case CSW_MP5NAVY : ca = 30
case CSW_M249 : ca = 100
case CSW_M3 : ca = 8
case CSW_M4A1 : ca = 30
case CSW_TMP : ca = 30
case CSW_G3SG1 : ca = 20
case CSW_FLASHBANG : ca = 0;
case CSW_DEAGLE : ca = 7
case CSW_SG552 : ca = 30
case CSW_AK47 : ca = 30
case CSW_P90 : ca = 50
}
return ca;
}
amxx - http://amxx.pl/kompi...me=ruletka3.sma
#359925 [ROZWIĄZANE] Pobieranie czasu rundy
Napisane przez FetaGreen w 07.02.2012 12:23
by R3X
Half-Life 1 Game Events - AlliedModders Wiki
Wysyłane jest osobno do każdego raz (a nie co sekundę) i nie masz pewności, że to początek rundy.
Musisz użyć set_task(1.0, ...) z flagą "b", na początku zapisywać w zmiennej globalnej czas, coś takiego (nie testowałem)
by diablix
Half-Life 1 Game Events - AlliedModders Wiki
register_event("RoundTime", "eventRoundTime", "b");
public eventRoundTime(id){
}
Wysyłane jest osobno do każdego raz (a nie co sekundę) i nie masz pewności, że to początek rundy.
Musisz użyć set_task(1.0, ...) z flagą "b", na początku zapisywać w zmiennej globalnej czas, coś takiego (nie testowałem)
#define TASKID 146
new gRoundStart;
public plugin_init(){
register_logevent("eventStartRound", 2, "1=Round_Start");
register_logevent("eventEndRound", 2, "1=Round_End");
}
public eventStartRound(){
gRoundStart = get_systime();
set_task(1.0, "eventTimerTick", TASKID, _, _, "b")
}
public eventEndRound(){
if(task_exists( TASKID ))
remove_task(TASKID );
}
public eventTimerTick(){
new iRoundTime = get_systime() - gRoundStart;
//iRoundTime - tyle sekund minęło od początku rundy
}
by diablix
#include <amxmodx>
#define VERSION "0.1"
public plugin_init(){
register_plugin("Czas Rundy", VERSION, "diablix");
register_event("RoundTime", "eventRoundTime", "bc");
}
public eventRoundTime(){
new iTimer = read_data(1), iNum;
new iPlayers[32];
new Float:flCvarTime = (get_cvar_float("mp_roundtime") * 60.0);
set_hudmessage(100, 72, 12, 0.01, 0.16, 0, 0.1, 0.1, 0.1, 0.1, 3);
get_players(iPlayers, iNum);
for(new i = 0 ; i < iNum ; i ++)
ShowSyncHudMsg(i, CreateHudSyncObj(), "Czas do końca rundy: %d", floatround(flCvarTime - iTimer));
}
#359636 [Gun Xp Mod 2.0] Jak dodać nowy item do sklepu.
Napisane przez FetaGreen w 06.02.2012 19:01
Witajcie.
W tym poradniku pokaże wam jak dodać nowy item do sklepu chodzi o ten plugin: http://amxx.pl/topic...-zapis-na-nick/ .
A więc zaczynajmy.
Glowna budowa pluginu wygląda tak:
Teraz zrobimy poradnik jak dodać item np. więcej życia.
A więc tworzymy nowy plugin wpisując calą taką treść:
Potem w plugin init pod register_plugin dodajemy tą linijke:
Zycie - Item
Dodaje 80 HP - Opis itemu
50 - Cena itemu (Liczone w XP)
Szukamy linijki:
I zamieniamy ją na tą:
W linijce ustawiania hp:
set_user_health - Ustawianie HP
get_user_health - Pobieranie HP
+ 80 - Ile HP chcemy dodać
W linijce wyświetlania wiadomości:
client_print - Drukowanie wiadomości
id - gracz
2 - rodzaj tekstu (print,console,center). 2 oznacza print_center
"Wlasnie zakupiles 80HP za 50XP" - Tekst wyświetlanej sie wiadomości
I to taki latwy item ktory polega na dokupieniu HP (80 życia)
Poradnik napisany w 100% przez FetaGreen.
Poradnik napisalem na odpracowanie warna.
Dlaczego taki? No bo nie ma żadnego tutoriala do tego pluginu/modu.
W tym poradniku pokaże wam jak dodać nowy item do sklepu chodzi o ten plugin: http://amxx.pl/topic...-zapis-na-nick/ .
A więc zaczynajmy.
Glowna budowa pluginu wygląda tak:
#include <amxmodx>
#include <gunxpmod>
new PLUGIN_NAME[] = "Unlock : Item"
new PLUGIN_AUTHOR[] = "author"
new PLUGIN_VERSION[] = "1.0"
public plugin_init(){
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_gxm_item("Item", "Co daje item", koszt)
}
public gxm_item_enabled(id)
Teraz zrobimy poradnik jak dodać item np. więcej życia.
A więc tworzymy nowy plugin wpisując calą taką treść:
#include <amxmodx>
#include <gunxpmod>
new PLUGIN_NAME[] = "Unlock : +80 HP"
new PLUGIN_AUTHOR[] = "FetaGreen"
new PLUGIN_VERSION[] = "1.0"
public plugin_init(){
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
}
public gxm_item_enabled(id)
Potem w plugin init pod register_plugin dodajemy tą linijke:
register_gxm_item("Zycie", "Dodaje 80 HP", 50)
Zycie - Item
Dodaje 80 HP - Opis itemu
50 - Cena itemu (Liczone w XP)
Szukamy linijki:
public gxm_item_enabled(id)
I zamieniamy ją na tą:
public gxm_item_enabled(id) { set_user_health(id, get_user_health(id) + 80); client_print(id, 2, "Wlasnie zakupiles 80HP za 50XP"); }
W linijce ustawiania hp:
set_user_health - Ustawianie HP
get_user_health - Pobieranie HP
+ 80 - Ile HP chcemy dodać
W linijce wyświetlania wiadomości:
client_print - Drukowanie wiadomości
id - gracz
2 - rodzaj tekstu (print,console,center). 2 oznacza print_center
"Wlasnie zakupiles 80HP za 50XP" - Tekst wyświetlanej sie wiadomości
I to taki latwy item ktory polega na dokupieniu HP (80 życia)
Poradnik napisany w 100% przez FetaGreen.
Poradnik napisalem na odpracowanie warna.
Dlaczego taki? No bo nie ma żadnego tutoriala do tego pluginu/modu.
- AMXX.pl: Support AMX Mod X i SourceMod
- → Przeglądanie profilu: Reputacja: FetaGreen
- Regulamin