Skocz do zawartości

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.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie
Modyfikacja

Dodanie do pluginu vipa opcji resetscore

Modyfikacja

  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
1 odpowiedź w tym temacie

#1 dansiwek

    Początkujący

  • Użytkownik

Reputacja: -2
Nowy

  • Postów:19
  • Lokalizacja:NDM
Offline

Napisano 30.03.2012 19:41

Witam, znalazłem ostatnio plugin reset score i bardzo mi się spodobał. Jednak chciałbym aby był on dostępny tylko dla graczy z vip. Posiadam wersie vip_v4. Problem polega na tym, aby wkleić kod pluginu resetscore do pluginu vipa.

Vip_v4

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <fakemeta_util>
static const COLOR[] = "^x04" //green
new maxplayers
new gmsgSayText
new weapons[] = {CSW_GLOCK18, CSW_USP, CSW_P228};
new szMapName[32];

public plugin_init()
{
register_plugin("VIP", "1.04", "XvAK")
register_clcmd("say /kupvipa","ShowMotd")
register_clcmd("say /kupvip","ShowMotd")
register_clcmd("say_team /kupvipa","ShowMotd")
register_clcmd("say_team /kupvip","ShowMotd")
maxplayers = get_maxplayers()
gmsgSayText = get_user_msgid("SayText")
register_clcmd("say", "handle_say")
register_logevent("Poczatek_Rundy", 2, "1=Round_Start")

get_mapname(szMapName, 31)
}
public Poczatek_Rundy() {
new players[32], player, pnum;
get_players(players, pnum, "a");
for(new i = 0; i < pnum; i++)
{
player = players[i];
if(get_user_flags(player) & ADMIN_LEVEL_H)
{
cs_set_user_money(player,cs_get_user_money(player) + 800)
cs_set_user_armor(player,100,CS_ARMOR_VESTHELM)

if(equal(szMapName, "knife_zone", 10))
client_print(player, print_chat, "[VIP] Jako gracz VIP(na mapie knife_zone) otrzymujesz 800$, kevlar z helmem.");
else
if(equal(szMapName, "aim_crazyjump", 10))
client_print(player, print_chat, "[VIP] Jako gracz VIP(na mapie aim_crazyjump) otrzymujesz 800$, kevlar z helmem.");
else
if(equal(szMapName, "aim_map", 10))
client_print(player, print_chat, "[VIP] Jako gracz VIP(na mapie aim_map) otrzymujesz 800$, kevlar z helmem.");
else
if(equal(szMapName, "aim_map_usp", 10))
client_print(player, print_chat, "[VIP] Jako gracz VIP(na mapie aim_map_usp) otrzymujesz 800$, kevlar z helmem.");
else
if(equal(szMapName, "awp_india", 10))
client_print(player, print_chat, "[VIP] Jako gracz VIP(na mapie awp_india) otrzymujesz 800$, kevlar z helmem.");
else
if(equal(szMapName, "awp_map_esl", 10))
client_print(player, print_chat, "[VIP] Jako gracz VIP(na mapie awp_map) otrzymujesz 800$, kevlar z helmem.");
else
if(equal(szMapName, "fy_pool_day", 10))
client_print(player, print_chat, "[VIP] Jako gracz VIP(na mapie fy_pool_day) otrzymujesz 800$, kevlar z helmem.");
else
if(equal(szMapName, "scoutzknivez", 10))
client_print(player, print_chat, "[VIP] Jako gracz VIP(na mapie scoutzknivez) otrzymujesz 800$, kevlar z helmem.");
else
{for(new i = 0; i < 2; i++)
{
fm_strip_user_gun(player, weapons[i]);
give_item(player,"weapon_deagle");
give_item(player,"ammo_50ae");
give_item(player,"ammo_50ae");
give_item(player,"ammo_50ae");
give_item(player,"ammo_50ae");
give_item(player,"ammo_50ae");
give_item(player,"ammo_50ae");
give_item(player,"ammo_50ae");
(player,100,CS_ARMOR_VESTHELM)

}
client_print(player, print_chat, "[VIP] Jako gracz VIP otrzymujesz 800$, kevlar z helmem i deagl'a.");
}


}
}
return PLUGIN_HANDLED
}
public ShowMotd(id)
{
show_motd(id, "vip.txt")
}
public client_authorized(id)
{
set_task(30.0, "PrintText" ,id)
set_task(120.0, "PrintTextX" ,id)
}
public PrintText(id)
{
client_print(id, print_chat, "[VIP] Wpisz /kupvipa aby zobaczyc wiecej informacji.")
}
public PrintTextX(id)
{
client_print(id, print_chat, "[VIP] Wpisz /vip aby zobaczyc liste VIPow.")
}
public handle_say(id) {
new said[192]
read_args(said,192)
if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/vip") != -1 )
set_task(0.1,"print_adminlist",id)
return PLUGIN_CONTINUE
}
public print_adminlist(user)
{
new adminnames[33][32]
new message[256]
new id, count, x, len

for(id = 1 ; id <= maxplayers ; id++)
if(is_user_connected(id))
if(get_user_flags(id) & ADMIN_LEVEL_H)
get_user_name(id, adminnames[count++], 31)
len = format(message, 255, "%s VIP ONLINE: ",COLOR)
if(count > 0) {
for(x = 0 ; x < count ; x++) {
len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
if(len > 96 ) {
print_message(user, message)
len = format(message, 255, "%s ",COLOR)
}
}
print_message(user, message)
}
else {
len += format(message[len], 255-len, "Brak VIPow na serwerze.")
print_message(user, message)
}
}
print_message(id, msg[]) {
message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
write_byte(id)
write_string(msg)
message_end()
}


resetscore

/*
This is a simple plugin I made that will just restart a players score
making their deaths and kills set to 0, this is to help players out a
little bit because they no longer have to reconnect or retry if they
want their score to start over, they can just type a simple command

---------------------------------
--------- MADE BY SILENTTT -----
------ MADE BY SILENTTT ------
-- MADE BY SILENTTT -------
------ MADE BY SILENTTT ------
--------- MADE BY SILENTTT -----
---------------------------------
*/

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define adtime 600.0 //Default of 10 minuites

new pcvar_Advertise
new pcvar_Display

public plugin_init()
{
register_plugin("Reset Score", "1.0", "Silenttt")

//You may type /resetscore or /restartscore
register_clcmd("say /resetscore", "reset_score")
register_clcmd("say /restartscore", "reset_score")
register_clcmd("say /rs", "reset_score")
register_clcmd("say /usunstaty", "reset_score")

//This command by default will be set at 0
//Change it to 1 in server.cfg if you want
//A message to be shown to advertise this.
pcvar_Advertise = register_cvar("sv_rsadvertise", "0")
//This command by default is also 0
//Change it to 1 in server.cfg if you want
//It to show who reset their scores when they do it
pcvar_Display = register_cvar("sv_rsdisplay", "0")

if(get_cvar_num("sv_rsadvertise") == 1)
{
set_task(adtime, "advertise", _, _, _, "b")
}
}

public reset_score(id)
{
//These both NEED to be done twice, otherwise your frags wont
//until the next round
cs_set_user_deaths(id, 0)
set_user_frags(id, 0)
cs_set_user_deaths(id, 0)
set_user_frags(id, 0)

if(get_pcvar_num(pcvar_Display) == 1)
{
new name[33]
get_user_name(id, name, 32)
client_print(0, print_chat, "%s wlasnie zresetowal sobie statystyki", name)
}
else
{
client_print(id, print_chat, "Wlasnie zresetowales sobie statystki")
}
}

public advertise()
{
set_hudmessage(255, 0, 0, -1.0, 0.20, 0, 0.2, 12.0)
show_hudmessage(0, "Wpisz /rs aby zresetowac sobie zabicia i zginiecia")
}

public client_putinserver(id)
{
if(get_pcvar_num(pcvar_Advertise) == 1)
{
set_task(10.0, "connectmessage", id, _, _, "a", 1)
}
}

public connectmessage(id)
{
if(is_user_connected(id))
{
client_print(id, print_chat, "Wpisz /rs aby zresetowac sobie zabicia i zginiecia. Mozesz to zrobic w kazdym momencie gry")
}
}


Użytkownik dansiwek edytował ten post 30.03.2012 19:44

  • +
  • -
  • 0

#2 A może sma?

    Godlike

  • Power User

Reputacja: 547
Wszechwiedzący

  • Postów:1 464
  • Steam:steam
  • Imię:Tomasz
  • Lokalizacja:Polska
Offline

Napisano 04.04.2012 00:07

W 2. pluginie podmień tą funkcję:
public reset_score(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_H))
{
client_print(id, print_chat, "Funkcja tylko dla VIPow");
return;
}
//These both NEED to be done twice, otherwise your frags wont
//until the next round
cs_set_user_deaths(id, 0)
set_user_frags(id, 0)
cs_set_user_deaths(id, 0)
set_user_frags(id, 0)

if(get_pcvar_num(pcvar_Display) == 1)
{
new name[33]
get_user_name(id, name, 32)
client_print(0, print_chat, "%s wlasnie zresetowal sobie statystyki", name)
}
else
{
client_print(id, print_chat, "Wlasnie zresetowales sobie statystki")
}
}

  • +
  • -
  • 0





Również z jednym lub większą ilością słów kluczowych: Modyfikacja

Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych