Fixi vajab
Lehekülg 1, lehekülgi kokku 1 • Share
- Tehnik aKKomeet
- Liitus : 28/03/2013
Postitusi : 453
Tervist!
Kas keegi palun saaks ära fixida.
1. Tekst imelik.
2. Võtad hp või armouri läheb 100 hp pealt ja armouostis 10-ne peale hoopis mitte ei tule juurde.
3. Et saaks iga round 1 korra kasutada ,hetkel saab kaks.
Kas keegi palun saaks ära fixida.
- Kood:
#include amxmodx
#include amxmisc
#include fakemeta
#include cstrike
const ACCES_VIP = ADMIN_LEVEL_H
#define LIMITS 2
const KEYSMENU = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5
new bool:noflash[33]
new limit[33]
new bool:hasgravity[33]
public plugin_init()
{
register_event("HLTV", "newround", "a", "1=0", "2=0")
register_clcmd("say /vipmenu", "show_menu_vip")
register_menu("Vip Menu", KEYSMENU, "vip_menu")
register_concmd("vip_menu", "show_menu_vip")
register_event("ScreenFade", "eventFlash", "be", "4=255", "5=255", "6=255", "7>199")
}
public newround(){
for(new id = 1; id <= get_maxplayers(); id++)
{
if(get_user_flags(id) & ACCES_VIP)
{
limit[id] = 0
noflash[id] = false
hasgravity[id] = false
}
}
}
public eventFlash(id)
{
if(is_user_connected(id) && noflash[id] == true && get_user_flags(id) & ACCES_VIP)
{
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)
write_short(1)
write_short(1)
write_short(1)
write_byte(0)
write_byte(0)
write_byte(0)
write_byte(255)
message_end()
}
}
public show_menu_vip(id)
{
static menu[255], len
len = 0
len += formatex(menu[len], charsmax(menu) - len, "\yVIP MENU | You is: %s^n^n", get_user_flags(id) & ACCES_VIP ? "VIP Member" : "Simple Player")
if(get_user_flags(id) & ACCES_VIP)
{
len += formatex(menu[len], charsmax(menu) - len, "\r1.\w 10HitPoints^n")
len += formatex(menu[len], charsmax(menu) - len, "\r2.\w 10Armour^n")
if(hasgravity[id] == false)
len += formatex(menu[len], charsmax(menu) - len, "\r3.\w Gravity 700^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\r3.\d Gravity 700^n")
if(noflash[id] == false)
len += formatex(menu[len], charsmax(menu) - len, "\r4.\w No Flash^n")
else
len += formatex(menu[len], charsmax(menu) - len, "\r4.\d No Flash^n")
len += formatex(menu[len], charsmax(menu) - len, "\r5.\w 250$^n^n")
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\r1.\d 10HitPoints^n")
len += formatex(menu[len], charsmax(menu) - len, "\r2.\d 10Armour^n")
len += formatex(menu[len], charsmax(menu) - len, "\r3.\d Gravity 700^n")
len += formatex(menu[len], charsmax(menu) - len, "\r4.\d No Flash^n")
len += formatex(menu[len], charsmax(menu) - len, "\r5.\d 250$^n^n")
}
len += formatex(menu[len], charsmax(menu) - len, "^n^n\r0.\w Exit")
show_menu(id, KEYSMENU, menu, -1, "Vip Menu")
}
public vip_menu(id, key)
{
if(limit[id] >= LIMITS)
{
client_print(id, print_chat, "You can use a VIP Member privileges just %d times on round", LIMITS)
return;
}
if(get_user_flags(id) & ACCES_VIP)
{
switch (key)
{
case 0: {fm_set_user_health(id, pev(id, pev_health) + 10)
limit[id]++
}
case 1: {set_pev(id, pev_armorvalue, 10.0)
limit[id]++
}
case 2: { if(hasgravity[id] == true)
return;
set_pev(id, pev_gravity, 0.7)
hasgravity[id] = true
limit[id]++
}
case 3: {
if(noflash[id] == true)
return;
noflash[id] = true
limit[id]++
}
case 4: {cs_set_user_money(id, cs_get_user_money(id) + 250)
limit[id]++
}
}
}
}
stock fm_set_user_health(index, health)
{
(health > 0) ? set_pev(index, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, index)
}
1. Tekst imelik.
2. Võtad hp või armouri läheb 100 hp pealt ja armouostis 10-ne peale hoopis mitte ei tule juurde.
3. Et saaks iga round 1 korra kasutada ,hetkel saab kaks.
- Tonight
- Liitus : 19/02/2012
Postitusi : 18000
Kohutav kood, seda pole mõtet fixida. Asi küll ilmselt töötab, aga nii scriptiti aastal 2008. Kirjutan sulle täna või homme kaasaegsema koodi.
// Sa muidu loed ka, mida plugin sisaldab või lihtsalt paigaldad? Scriptis selgelt kirjas #define LIMITS 2 ehk saabki kasutada 2 korda. Praegu tundub küll nii, et võin kasvõi ennast omanikuks kirjutada pluginas, sa ei kontrolli üle.
Testimata:
// Sa muidu loed ka, mida plugin sisaldab või lihtsalt paigaldad? Scriptis selgelt kirjas #define LIMITS 2 ehk saabki kasutada 2 korda. Praegu tundub küll nii, et võin kasvõi ennast omanikuks kirjutada pluginas, sa ei kontrolli üle.
Testimata:
- Kood:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#define PLUGIN "VIPMenu"
#define VERSION "0.0.7"
#define AUTHOR "Faval"
new bool:noflash[33]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Spawn, "player", "Spawnimine", 1)
RegisterHam(Ham_Spawn, "player", "CmdVip", 1)
register_event("ScreenFade", "eventFlash", "be", "4=255", "5=255", "6=255", "7>199")
}
public CmdVip(id) {
if (get_user_flags(id) & ADMIN_LEVEL_H) {
new menu = menu_create("VIPMenu:", "vip_handler")
menu_additem(menu, "+10 HP", "1", 0)
menu_additem(menu, "+10 AP", "2", 0)
menu_additem(menu, "Gravity 700", "3", 0)
menu_additem(menu, "No Flash", "4", 0)
menu_additem(menu, "+250$", "5", 0)
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_setprop(menu, MPROP_EXITNAME, "Välju")
menu_display(id, menu, 0)
}
}
public vip_handler(id, menu, item) {
new data[6], szName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data, charsmax(data), szName, charsmax(szName),
callback)
new key = str_to_num(data)
switch (key) {
case 1:
{
set_user_health(id, 110)
}
case 2:
{
set_user_armor(id, 110)
}
case 3:
{
set_user_gravity(id, 0.875)
}
case 4:
{
noflash[id] = true
}
case 5:
{
cs_set_user_money(id, cs_get_user_money(id) + 250)
}
}
menu_destroy(menu);
return PLUGIN_HANDLED
}
public eventFlash(id)
{
if(is_user_connected(id) && noflash[id] == true && get_user_flags(id) & ADMIN_LEVEL_H)
{
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)
write_short(1)
write_short(1)
write_short(1)
write_byte(0)
write_byte(0)
write_byte(0)
write_byte(255)
message_end()
}
}
public Spawnimine(id)
{
if (is_user_alive(id))
{
noflash[id] = false
set_user_gravity(id, 1.0)
}
}
- Tehnik aKKomeet
- Liitus : 28/03/2013
Postitusi : 453
Panen serveris /vipmenu ei avane midagi
- Tonight
- Liitus : 19/02/2012
Postitusi : 18000
See avaneb automaatselt spawnimisel, loe koodi.
Kui tahad käsklusega, siis RegisterHam(Ham_Spawn, "player", "CmdVip", 1) => register_clcmd("say /vipmenu", "CmdVip")
Kui tahad käsklusega, siis RegisterHam(Ham_Spawn, "player", "CmdVip", 1) => register_clcmd("say /vipmenu", "CmdVip")
- Tehnik aKKomeet
- Liitus : 28/03/2013
Postitusi : 453
Fukk ma ei oska teha nii, spawnimisel mul ju relvad
- Tehnik aKKomeet
- Liitus : 28/03/2013
Postitusi : 453
????
- flammable
- Liitus : 17/08/2014
Postitusi : 1600
Jäta /vipmenu roundi alguseks, võta relvad maha. Kas sul on surf või official?
- Tonight
- Liitus : 19/02/2012
Postitusi : 18000
- Kood:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#define PLUGIN "VIPMenu"
#define VERSION "0.0.7"
#define AUTHOR "Faval"
new bool:Kasutanud[33]
new bool:noflash[33]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /vipmenu", "VIPMenu")
register_clcmd("say_team /vipmenu", "VIPMenu")
RegisterHam(Ham_Spawn, "player", "Spawnimine", 1)
register_event("ScreenFade", "eventFlash", "be", "4=255", "5=255", "6=255", "7>199")
}
public VIPMenu(id) {
if(get_user_flags(id) & ADMIN_LEVEL_H && Kasutanud[id] == false && is_user_alive(id)) {
new menu = menu_create("VIPMenu:", "vip_handler")
menu_additem(menu, "+10 HP", "1", 0)
menu_additem(menu, "+10 AP", "2", 0)
menu_additem(menu, "Gravity 700", "3", 0)
menu_additem(menu, "No Flash", "4", 0)
menu_additem(menu, "+250$", "5", 0)
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_setprop(menu, MPROP_EXITNAME, "Välju")
menu_display(id, menu, 0)
}
}
public vip_handler(id, menu, item) {
if(!is_user_alive(id))
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new data[6], szName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data, charsmax(data), szName, charsmax(szName),
callback)
new key = str_to_num(data)
switch (key) {
case 1:
{
set_user_health(id, 110)
Kasutanud[id] = true
}
case 2:
{
set_user_armor(id, 110)
Kasutanud[id] = true
}
case 3:
{
set_user_gravity(id, 0.875)
Kasutanud[id] = true
}
case 4:
{
noflash[id] = true
Kasutanud[id] = true
}
case 5:
{
cs_set_user_money(id, cs_get_user_money(id) + 250)
Kasutanud[id] = true
}
}
menu_destroy(menu);
return PLUGIN_HANDLED
}
public eventFlash(id)
{
if(is_user_connected(id) && noflash[id] == true && get_user_flags(id) & ADMIN_LEVEL_H)
{
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)
write_short(1)
write_short(1)
write_short(1)
write_byte(0)
write_byte(0)
write_byte(0)
write_byte(255)
message_end()
}
}
public Spawnimine(id)
{
if (is_user_alive(id))
{
Kasutanud[id] = false
noflash[id] = false
set_user_gravity(id, 1.0)
}
}
- viljrJuunior
- Liitus : 01/01/2015
Postitusi : 86
Proovisin kah "New Games"
Niisugune bug sellel, kui ma võtan roundi keskel /vipmenüü ja elusid jäänud 23, siis võtan hp saan 100 elu täis ??
Niisugune bug sellel, kui ma võtan roundi keskel /vipmenüü ja elusid jäänud 23, siis võtan hp saan 100 elu täis ??
- Tonight
- Liitus : 19/02/2012
Postitusi : 18000
Hmm, jah, kirjutasin koodi kohe 110 hp (mitte praegune + 10).
Fixed:
Fixed:
- Kood:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#define PLUGIN "VIPMenu"
#define VERSION "0.0.7"
#define AUTHOR "Faval"
new bool:Kasutanud[33]
new bool:noflash[33]
new elud
new armor
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /vipmenu", "VIPMenu")
register_clcmd("say_team /vipmenu", "VIPMenu")
RegisterHam(Ham_Spawn, "player", "Spawnimine", 1)
register_event("ScreenFade", "eventFlash", "be", "4=255", "5=255", "6=255", "7>199")
}
public VIPMenu(id) {
if(get_user_flags(id) & ADMIN_LEVEL_H && Kasutanud[id] == false && is_user_alive(id)) {
new menu = menu_create("VIPMenu:", "vip_handler")
menu_additem(menu, "+10 HP", "1", 0)
menu_additem(menu, "+10 AP", "2", 0)
menu_additem(menu, "Gravity 700", "3", 0)
menu_additem(menu, "No Flash", "4", 0)
menu_additem(menu, "+250$", "5", 0)
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_setprop(menu, MPROP_EXITNAME, "Välju")
menu_display(id, menu, 0)
}
}
public vip_handler(id, menu, item) {
if(!is_user_alive(id))
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new data[6], szName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data, charsmax(data), szName, charsmax(szName),
callback)
new key = str_to_num(data)
switch (key) {
case 1:
{
elud = get_user_health(id)
set_user_health(id, elud + 10)
Kasutanud[id] = true
}
case 2:
{
armor = get_user_armor(id)
set_user_armor(id, armor + 10)
Kasutanud[id] = true
}
case 3:
{
set_user_gravity(id, 0.875)
Kasutanud[id] = true
}
case 4:
{
noflash[id] = true
Kasutanud[id] = true
}
case 5:
{
cs_set_user_money(id, cs_get_user_money(id) + 250)
Kasutanud[id] = true
}
}
menu_destroy(menu);
return PLUGIN_HANDLED
}
public eventFlash(id)
{
if(is_user_connected(id) && noflash[id] == true && get_user_flags(id) & ADMIN_LEVEL_H)
{
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)
write_short(1)
write_short(1)
write_short(1)
write_byte(0)
write_byte(0)
write_byte(0)
write_byte(255)
message_end()
}
}
public Spawnimine(id)
{
if (is_user_alive(id))
{
Kasutanud[id] = false
noflash[id] = false
set_user_gravity(id, 1.0)
}
}
Soovid vestluses osaleda?
Selleks logi sisse või tee endale kasutaja.
Lehekülg 1, lehekülgi kokku 1
Permissions in this forum:
Sa ei saa vastata siinsetele teemadele