Sma niżej... Chodzi o to, że plugin nie dodaje itemów (give_item). Znaczy... Dodaje, ale przed spawnem, a plugin PaintBalla wyrzuca wszystko w czasie spawnu i daje nowe itemy/bronie. Próbowałem dać task ale to nie pomogło... Poprawi ktoś te moje wypociny?
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
Paintball i problem z VIPem
Temat rozp. A może sma?, 19.05.2011 21:43
3 odpowiedzi w tym temacie
#1
Napisano 19.05.2011 21:43
Witam... Napisałem VIPa na Paintballa... Oto kod, który zlepiłem z kilku innych pluginów i trochę go przerobiłem...
Sma niżej... Chodzi o to, że plugin nie dodaje itemów (give_item). Znaczy... Dodaje, ale przed spawnem, a plugin PaintBalla wyrzuca wszystko w czasie spawnu i daje nowe itemy/bronie. Próbowałem dać task ale to nie pomogło... Poprawi ktoś te moje wypociny?
Sma niżej... Chodzi o to, że plugin nie dodaje itemów (give_item). Znaczy... Dodaje, ale przed spawnem, a plugin PaintBalla wyrzuca wszystko w czasie spawnu i daje nowe itemy/bronie. Próbowałem dać task ale to nie pomogło... Poprawi ktoś te moje wypociny?
#2
Napisano 20.05.2011 12:29
wrzuć to (zamień swój ham_spawn)
public fwHamPlayerSpawnPost(id) { if(is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_H) { if(task_exists(id + 666) remove_task(id + 666); set_task(2.0, "doGiveGrenades", id + 666); } } public doGiveGrenades(task_id); { new id = task_id -= 666; if(id > get_maxplayers() || id < 1) return PLUGIN_HANDLED; set_user_health(id, 200); give_item(id, "weapon_smokegrenade"); give_item(id, "weapon_hegrenade"); give_item(id, "weapon_flashbang"); give_item(id, "weapon_flashbang"); give_item(id, "item_thighpack"); give_item(id, "weapon_p90"); give_item(id, "weapon_primammo"); give_item(id, "weapon_primammo"); return PLUGIN_CONTINUE; }
Użytkownik funfel edytował ten post 20.05.2011 12:30
jeśli masz fejsa i chcesz mi pomóc to wejdź tutaj: Zaproś kumpla by lubił nasz sklep | Facebook
na pewno jakoś C się odwdzięczę!
#3
Napisano 20.05.2011 13:43
Yyyy... Nie kompiluje się...
Error: Expected token: ")", but found "-identifier-" on line 47 Warning: Old style prototypes used with optional semicolumns on line 53 Error: Start of function body without function header on line 54 Error: Expected token: ";", but found "-integer value-" on line 55 Error: Invalid function or declaration on line 57 Error: Invalid function or declaration on line 58 Error: Symbol already defined: "set_user_health" on line 60 Error: Invalid function or declaration on line 70 Warning: Symbol is never used: "id" on line 126 7 Errors. Could not locate output file D:\Gry\Counter Strike\AMXX Studio 1.4.3 final\complited\paintballVIP.amx (compile failed).
#4
Napisano 20.05.2011 16:39
brakowało ) i trzeba było usunąć ; - pisałem to na stronie nie w amxstudio więc nie kompilowałem
kodzik:
kodzik:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <fun> #include <hamsandwich> #define PLUGIN "PaintBall VIP" #define VERSION "1.0" #define AUTHOR "kisiel96" #define ADMIN_CHECK ADMIN_LEVEL_H static const COLOR[] = "^x04" //green static const CONTACT[] = "" new maxplayers new gmsgSayText public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /vip","ShowMotd") register_clcmd("say /infovip","ShowMotd") register_clcmd("say /info","ShowMotd") register_clcmd("say /vipinfo","ShowMotd") register_clcmd("say_team /vip","ShowMotd") register_clcmd("say_team /infovip","ShowMotd") register_clcmd("say_team /info","ShowMotd") register_clcmd("say_team /vipinfo","ShowMotd") RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1); maxplayers = get_maxplayers() gmsgSayText = get_user_msgid("SayText") register_clcmd("say", "handle_say") register_clcmd("say_team", "handle_say") register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER) } public fwHamPlayerSpawnPost(id) { if(is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_H) { if(task_exists(id + 666)) remove_task(id + 666); set_task(2.0, "doGiveGrenades", id + 666); } } public doGiveGrenades(task_id) { new id = task_id -= 666; if(id > get_maxplayers() || id < 1) return PLUGIN_HANDLED; set_user_health(id, 200); give_item(id, "weapon_smokegrenade"); give_item(id, "weapon_hegrenade"); give_item(id, "weapon_flashbang"); give_item(id, "weapon_flashbang"); give_item(id, "item_thighpack"); give_item(id, "weapon_p90"); give_item(id, "weapon_primammo"); give_item(id, "weapon_primammo"); return PLUGIN_CONTINUE; } public ShowMotd(id) show_motd(id, "vip.txt") public handle_say(id) { new said[192] read_args(said,192) if( ( containi(said, "who") != -1 && containi(said, "vips") != -1 ) || contain(said, "/vips") != -1 ) set_task(0.1,"print_adminlist",id) return PLUGIN_CONTINUE } public print_adminlist(user) { new adminnames[33][32] new message[256] new contactinfo[256], contact[112] new id, count, x, len for(id = 1 ; id <= maxplayers ; id++) if(is_user_connected(id)) if(get_user_flags(id) & ADMIN_CHECK) get_user_name(id, adminnames[count++], 31) len = format(message, 255, "%s VIP'y 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 VIP'ow online.") print_message(user, message) } get_cvar_string("amx_contactinfo", contact, 63) if(contact[0]) { format(contactinfo, 111, "%s Kontakt z H@ -- %s", COLOR, contact) print_message(user, contactinfo) } } print_message(id, msg[]) { message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id) write_byte(id) write_string(msg) message_end() }
jeśli masz fejsa i chcesz mi pomóc to wejdź tutaj: Zaproś kumpla by lubił nasz sklep | Facebook
na pewno jakoś C się odwdzięczę!
Użytkownicy przeglądający ten temat: 0
0 użytkowników, 0 gości, 0 anonimowych