Kilka błędów...
DarkItachiPL
01.02.2009
Cześć.. Mam kilka błędów w skrypcie... Proszę się nie złościć, jestem newbie
Linijka 59:
Linijka 87:
Linijka 110:
Linijka 121:
Co robić? Jak ktoś już potrzebuje SMA to na prv mogę dać
Welcome to the AMX Mod X 1.8.1-300 Compiler. Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team Warning: Loose indentation on line 59 Warning: Loose indentation on line 87 Warning: Loose indentation on line 110 Warning: Loose indentation on line 121 Header size: 1152 bytes Code size: 6828 bytes Data size: 2916 bytes Stack/heap size: 16384 bytes; estimated max. usage=1360 cells (5440 bytes) Total requirements: 27280 bytes 4 Warnings. Done.
Linijka 59:
if (userTeam == CS_TEAM_T) {
Linijka 87:
if (userTeam == CS_TEAM_T) {
Linijka 110:
entity_get_vector(id, EV_VEC_velocity, velocity)
Linijka 121:
return PLUGIN_CONTINUE;
Co robić? Jak ktoś już potrzebuje SMA to na prv mogę dać
Seba 01.02.2009
Tutaj raczej chodzi o linijki przed, kod jest źle ułożony. Wklej kod do postu.
DarkItachiPL
01.02.2009
#define DAMAGE_RECIEVED #include <amxmodx> #include <amxmodx> #include <amxmisc> #include <engine> #include <cstrike> #include <fun> #include <vault> #define PLUGIN "Rezerwacja Slota dla Vipa" #define VERSION "1.1" #define AUTHOR "DarkItachiPL" new maxplayers new g_MsgSync new Float: velocity[3] static const COLOR[] = "^x04" //green #if defined DAMAGE_RECIEVED new g_MsgSync2 #endif public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_logevent("logevent_Round_Start", 2, "1=Round_Start"); register_event("Damage","Damage","b") register_event("DeathMsg","death_msg","a") maxplayers = get_maxplayers() g_MsgSync = CreateHudSyncObj() #if defined DAMAGE_RECIEVED g_MsgSync2 = CreateHudSyncObj() #endif register_clcmd("say /vip","ShowMotd"); register_clcmd("say", "handle_say") } public plugin_precache() { precache_model("models/player/vip_ct/vip_ct.mdl") precache_model("models/player/vip_tt/vip_tt.mdl") return PLUGIN_CONTINUE } public logevent_Round_Start() { new players[32], player, pnum; get_players(players, pnum, "a"); for(new i = 0; i < pnum; i++) { player = players[i]; if(has_flags(player,"b")) { new CsTeams:userTeam = cs_get_user_team(player); if (userTeam == CS_TEAM_TT) { give_item(player,"weapon_ak47") } else if(userTeam == CS_TEAM_CT) { give_item(player,"weapon_m4a1") } else { // Nic <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/naughty.gif' class='bbc_emoticon' alt='^^' /> } give_item(player,"ammo_556nato") give_item(player,"ammo_556nato") give_item(player,"ammo_556nato") 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") give_item(player,"weapon_hegrenade") give_item(player, "weapon_hegrenade"); give_item(player, "weapon_flashbang"); give_item(player, "weapon_flashbang"); give_item(player, "weapon_smokegrenade"); give_item(player, "item_kevlar"); give_item(player,"weapon_knife") set_task(0.1, "cwall", player, "", 0, "b"); if (userTeam == CS_TEAM_T) { cs_set_user_model(player, "vip_tt") } else if(userTeam == CS_TEAM_CT) { cs_set_user_model(player, "vip_ct") } else { cs_reset_user_model(player) } } } } public cwall(id) { new buttons = get_user_button(id) if(buttons & IN_ATTACK) return PLUGIN_HANDLED if(!is_user_connected(id)) return PLUGIN_HANDLED entity_get_vector(id, EV_VEC_velocity, velocity) if(buttons & IN_JUMP && (buttons & IN_FORWARD || buttons & IN_BACK)) { if(velocity[0] == 0.0 || velocity[1] == 0.0) { velocity[1] = 10.0 velocity[2] = 220.0 entity_set_vector(id, EV_VEC_velocity, velocity) } } return PLUGIN_CONTINUE; } public has_flags(id,string[]) { new ret=1 new byte new len = strlen(string) new p_flag = get_user_flags(id) for(new i=0;i<=len;i++) { if(string[i]>='a' && string[i]<='z') byte = (1<<(string[i]-'a')) else if(string[i]>='A' && string[i]<='Z') byte = (1<<(string[i]-'A')) else if(string[i]==',' && ret==1) return 1 else if(string[i]==',') ret=1 if(byte!=0 && !(p_flag & byte)) ret=0 byte=0 } return ret } public ShowMotd(id) { show_motd(id, "vip.txt") } public client_authorized(id) { set_task(30.0, "PrintText" ,id) } public PrintText(id) { client_print(id, print_chat, "[VIP] Uzyj: /vip i zobacz jakie udogodnienia ma VIP!") } public on_damage(id) { new attacker = get_user_attacker(id) #if defined DAMAGE_RECIEVED // id should be connected if this message is sent, but lets check anyway if ( is_user_connected(id) && is_user_connected(attacker) ) if (get_user_flags(attacker) & ADMIN_LEVEL_H) { new damage = read_data(2) set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1) ShowSyncHudMsg(id, g_MsgSync2, "%i^n", damage) #else if ( is_user_connected(attacker) && if (get_user_flags(attacker) & ADMIN_LEVEL_H) ) { new damage = read_data(2) #endif set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1) ShowSyncHudMsg(attacker, g_MsgSync, "%i^n", damage) } } public death_msg() { if(read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2)) cs_set_user_money(read_data(1),cs_get_user_money(read_data(1)) + 500 - 300) } public handle_say(id) { new said[192] read_args(said,192) if( ( containi(said, "vipy") != -1 && containi(said, "/vipy") != -1 ) || contain(said, "/vipacc") != -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 - > Userzy z Kontem Vip: ",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 ) { client_print(user, print_chat, message) len = format(message, 255, "%s ",COLOR) } } client_print(user, print_chat, message) } else { len += format(message[len], 255-len, "Brak Userow z Kontem Vip.") client_print(user, print_chat, message) } }
Może to i nie całkiem mój kod, ale ja go sklejałem i dawałem to co chciałem więc. Wszelkie Prawa Zastrzeżone
stmn
01.02.2009
Spróbuj załącznika.
Poza Lose Indentation, miałeś też CS_TEAM_TT zamiast CS_TEAM_T, a Vault'a chyba nie używasz.
Poza Lose Indentation, miałeś też CS_TEAM_TT zamiast CS_TEAM_T, a Vault'a chyba nie używasz.