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

Kilka błędów...


  • Zamknięty Temat jest zamknięty
4 odpowiedzi w tym temacie

#1 DarkItachiPL

    Początkujący

  • Użytkownik

Reputacja: 0
Nowy

  • Postów:16
Offline

Napisano 01.02.2009 03:20

Cześć.. Mam kilka błędów w skrypcie... Proszę się nie złościć, jestem newbie :)

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ć :)
  • +
  • -
  • 0

#2 Seba

    Wszechobecny

  • Zbanowany

Reputacja: 198
Profesjonalista

  • Postów:424
  • Lokalizacja:Internet
Offline

Napisano 01.02.2009 04:26

Tutaj raczej chodzi o linijki przed, kod jest źle ułożony. Wklej kod do postu.

#3 DarkItachiPL

    Początkujący

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:16
Offline

Napisano 01.02.2009 10:09

#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 ^^
  • +
  • -
  • 0

#4 stmn

    Pomocny

  • Użytkownik

Reputacja: 6
Nowy

  • Postów:64
  • GG:
  • Lokalizacja:Poznań
Offline

Napisano 01.02.2009 15:37

Spróbuj załącznika.
Poza Lose Indentation, miałeś też CS_TEAM_TT zamiast CS_TEAM_T, a Vault'a chyba nie używasz.

Załączone pliki


  • +
  • -
  • 0

#5 Misiaczek ;c

    /dev/null

  • Moderator

Reputacja: 1 678
Godlike

  • Postów:2 496
  • GG:
  • Steam:steam
  • Imię:Michał
  • Lokalizacja:Halemba
Offline

Napisano 01.02.2009 18:50

daj też orginalne sma nie przerabiane przez ciebie...
  • +
  • -
  • 0




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

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