Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

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

3 errory ;(


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

#1 rafenn

    Pomocny

  • Użytkownik

Reputacja: 0
zer0.

  • Postów:43
  • Lokalizacja:jestes?
Offline

Napisano 19.12.2009 20:19

Witam mam problem wyskakują mi 3 errory ;)
#include <amxmodx> 
#include <amxmisc>  
#include <cstrike>
#include <fun>
#include <nvault> 
#define MAXCLASSES 5 

#define PLUGIN "Exp Mod" 
#define VERSION "1.0" 
#define AUTHOR "gal  anonim "

new PlayerXP[33],PlayerLevel[33],PlayerClass[33]
new <img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Kill,<img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Knife,<img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Hs,SaveXP
new g_vault 

new const CLASSES[MAXCLASSES][] = {
    "Blockmaker",
    "Blockninja",
    "Blockmag",
    "Blockzabujca",
    "Blocklamus"
} 

new const LEVELS[14] = {
    0,
    100,//1
    200,//2
    400,//3
    800,//4
    1600,//5
    3200,//6
    4200, //7
    6800, //8
    9700, //9
    12700, //9
    19200, //10
    29280, //11
    37450 //12
} 

new bool:kupil[33]
new bool:uzyl[33]
new cvaron

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("say /buyhp", "buyhp")
    register_clcmd("say /usehp", "usehp")
    register_clcmd("say /usebuyhp", "usebuyhp")
    register_event("HLTV", "NewRound", "a", "1=0", "2=0") 
    register_clcmd("say /onsr", "wol")
    cvaron = register_cvar("amx_expmod","1")
    register_event("DeathMsg", "eDeath", "a")
    SaveXP = register_cvar("SaveXP","1")
    <img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Kill=register_cvar("XP_per_kill", "30")
    <img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Hs=register_cvar("XP_hs_bonus","10")
    <img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Knife=register_cvar("XP_knife_bonus","10")
    g_vault = nvault_open("sredniomod")
    register_clcmd("say /klasa", "ChangeClass")
    register_clcmd("say_team /class", "ChangeClass")
    register_clcmd("say /xp", "ShowXP")
    register_clcmd("say_team /xp", "ShowXP")
    register_clcmd("say_team /info", "infokom")
    register_clcmd("say /info", "infokom")
    register_clcmd("say /adminfo", "infokomadm")
    register_clcmd("say_team /adminfo", "infokomadm")
}
public client_connect(id)  
{  
    kupil[id] = true
    uzyl[id] = false
    if(get_pcvar_num(SaveXP) == 1) 
    { 
        LoadData(id) 
    } 
}
public eDeath( ) 
{ 
    new attacker = read_data(1)
    if(PlayerClass[attacker] == 0)
        return PLUGIN_CONTINUE
    
    new headshot = read_data( 3 )
    new clip, ammo, weapon = get_user_weapon(attacker,clip,ammo)
    PlayerXP[attacker] += get_pcvar_num(<img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Kill) 
    if(headshot) 
        PlayerXP[attacker] += get_pcvar_num(<img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Hs) 
    if(weapon == CSW_KNIFE)
        PlayerXP[attacker] += get_pcvar_num(<img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Knife)
    while(PlayerXP[attacker] >= LEVELS[PlayerLevel[attacker]]) 
    {
        client_print(attacker, print_chat, "[<img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />] Gratulacje osiagnales level %i %s!", PlayerLevel[attacker],CLASSES[PlayerClass[attacker]]);        PlayerLevel[attacker] += 1 
    } 
    ShowHud(attacker)
    return PLUGIN_CONTINUE
    
} 
public ShowHud(id) 
{ 
    set_hudmessage(255, 0, 0, 0.75, 0.01, 0, 6.0, 15.0) 
    show_hudmessage(id, "Level: %i^nXP: %i^nKlasa: %s",PlayerLevel[id],PlayerXP[id],CLASSES[PlayerClass[id]]) 
} 
public ChangeClass(id) 
{
    new menu = menu_create("Klas Menu" , "Class_Handle")
    menu_additem(menu ,"Asasyn", "1" , 0); 
    menu_additem(menu ,"Rycerz", "2" , 0); 
    menu_additem(menu ,"Mag", "3" , 0); 
    menu_additem(menu ,"Druid", "4" , 0);
    menu_setprop(menu , MPROP_EXIT , MEXIT_ALL);
    menu_display(id , menu , 0); 
    return PLUGIN_CONTINUE; 
} 

public Class_Handle(id , menu , item) 
{ 
    if(item == MENU_EXIT) 
    { 
        menu_destroy(menu); 
    } 
    new szCommand[6] , szName[64]; new access , callback
    menu_item_getinfo(menu , item , access , szCommand , 5 , szName , 63 , callback);
    new i = str_to_num(szCommand);
    if(PlayerClass[id] != i) 
    { 
        PlayerClass[id] = i client_print(id,print_chat,"Jestes teraz %s",CLASSES[i]);
    }
    else 
    { 
        client_print(id,print_chat,"Przeciez jestes %s",CLASSES[i]);
    } 
    menu_destroy(menu); 
    return PLUGIN_CONTINUE 
} 
public SaveData(id) 
{ 
    new AuthID[35] get_user_authid(id,AuthID,34)
    new vaultkey[64],vaultdata[256] 
    format(vaultkey,63,"%s-Mod",AuthID) ;
    format(vaultdata,255,"%i#%i#",PlayerXP[id],PlayerLevel[id]) ;
    nvault_set(g_vault,vaultkey,vaultdata) ;
    return PLUGIN_CONTINUE ;
} 
public LoadData(id) 
{ 
    new AuthID[35] get_user_authid(id,AuthID,34) 
    new vaultkey[64],vaultdata[256] 
    format(vaultkey,63,"%s-Mod",AuthID) 
    format(vaultdata,255,"%i#%i#",PlayerXP[id],PlayerLevel[id]) 
    nvault_get(g_vault,vaultkey,vaultdata,255) 
    replace_all(vaultdata, 255, "#", " ") 
    new playerxp[32], playerlevel[32] 
    parse(vaultdata, playerxp, 31, playerlevel, 31) 
    PlayerXP[id] = str_to_num(playerxp) 
    PlayerLevel[id] = str_to_num(playerlevel) 
    return PLUGIN_CONTINUE 
} 
public buyhp(id) 
{
    if(kupil[id]||cvaron == 1)
        client_print(id,print_chat,"[HnS] Nie moge sprzedac ci wiecej napojow zycia.");
    else
    {
        client_print(id,print_chat,"[HnS] Kupiles napoj zycia.");
        uzyl[id] = false
        kupil[id] = true
    } 
}
public usehp(id)
{
    if(uzyl[id]||cvaron == 1)
        client_print(id,print_chat,"[HnS] Nie masz napojow zycia.");
    else
    {
        set_user_health(id, 100)
        client_print(id,print_chat,"[HnS] Uzyles napoju zycia.");
        uzyl[id] = true
    }
}
public itoito(id)
{
    if(kupil[id]||cvaron == 1)
        set_user_health(id, 100)
    
    uzyl[id] = true
    kupil[id] = true         
} 
public usebuyhp(id)
{
    if(uzyl[id]||kupil[id]||cvaron == 1)
        client_print(id,print_chat, "[HnS] Nie mozesz wiecej kupic i uzyc napojow Gracza.");
    else
        set_task(0.1, "itoito", _, _, _, "a", 1) 
    
}
public NewRound(id)
{
    kupil[id] = false
    uzyl[id] = false
}
public wol(id)
{
    if(is_user_admin(id))
        set_task(0.1, "online", _, _, _, "a", 1) 
    else
        client_print(id,print_chat, "[HnS] Komenda nie dostępna dla normalnego Gracza.");
}
public woler(id)
{
    if(is_user_admin(id))
        set_task(0.1, "offline", _, _, _, "a", 1) 
    
    else
        client_print(id,print_chat, "[HnS] Komenda nie dostępna dla normalnego Gracza.");
}
public online(id)
{
    if(is_user_admin(id))
        server_cmd("amx_cvar amx_expmod 1")
}
public offline(id)
{
    if(is_user_admin(id))
        server_cmd("amx_cvar amx_expmod 0")
}
public info(id)
{
        client_print(id,print_chat, "[HnS] Exp MoD oferuje dobra zabawe , duzo emocji oraz zroznicowane klasy /shop by otworzyc sklep /info po informacje.")
}
public admininfo(id)
{
  if(is_user_admin(id))
        client_print(id,print_chat, "[HnS] amx_expmod 1 by wlaczyc 0 by wylaczyc.")
}
public infokom(id)
{
        set_task(0.1, "info", _, _, _, "a", 1) 
  if(is_user_admin(id))
        set_task(0.1, "admininfo", _, _, _, "a", 1)
} 
public infokomadm(id)
{
  if(is_user_admin(id))
{
        set_task(0.1, "admininfo", _, _, _, "a", 1)
}
else
{
        client_print(id,print_chat, "[HnS] Komenda dostepna wylacznie dla admina.")
}
}
public autoinfo(id)
{
        set_task(130.0, "info", _, _, _, "b")
}



public client_disconnect(id) 
{ 
    if(get_pcvar_num(SaveXP) == 1) 
        SaveData(id) 
}  

Errory

 error 001: expected token: ";", but found "-identifier-"
error 001: expected token: ";", but found "-identifier-"
error 001: expected token: ";", but found "-identifier-"
warning 217: loose indentation
warning 217: loose indentation

  • +
  • -
  • 0

#2 DarkGL

    Nie oddam ciasteczka !

  • Administrator

Reputacja: 6034
Godlike

  • Postów:10832
  • GG:
  • Steam:steam
  • Imię:Rafał
  • Lokalizacja:Warszawa
Offline

Napisano 19.12.2009 22:18

#include <amxmodx> 

#include <amxmisc>  

#include <cstrike> 

#include <fun> 

#include <nvault> 

#define MAXCLASSES 5 



#define PLUGIN "Exp Mod" 

#define VERSION "1.0" 

#define AUTHOR "gal  anonim " 



new PlayerXP[33],PlayerLevel[33],PlayerClass[33] 

new <img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Kill,<img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Knife,<img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Hs,SaveXP 

new g_vault 



new const CLASSES[MAXCLASSES][] = { 

	"Blockmaker", 

	"Blockninja", 

	"Blockmag", 

	"Blockzabujca", 

	"Blocklamus" 

} 



new const LEVELS[14] = { 

	0, 

	100,//1 

	200,//2 

	400,//3 

	800,//4 

	1600,//5 

	3200,//6 

	4200, //7 

	6800, //8 

	9700, //9 

	12700, //9 

	19200, //10 

	29280, //11 

	37450 //12 

} 



new bool:kupil[33] 

new bool:uzyl[33] 

new cvaron 



public plugin_init() 

{ 

	register_plugin(PLUGIN, VERSION, AUTHOR) 

	register_clcmd("say /buyhp", "buyhp") 

	register_clcmd("say /usehp", "usehp") 

	register_clcmd("say /usebuyhp", "usebuyhp") 

	register_event("HLTV", "NewRound", "a", "1=0", "2=0") 

	register_clcmd("say /onsr", "wol") 

	cvaron = register_cvar("amx_expmod","1") 

	register_event("DeathMsg", "eDeath", "a") 

	SaveXP = register_cvar("SaveXP","1") 

	<img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Kill=register_cvar("XP_per_kill", "30") 

	<img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Hs=register_cvar("XP_hs_bonus","10") 

	<img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Knife=register_cvar("XP_knife_bonus","10") 

	g_vault = nvault_open("sredniomod") 

	register_clcmd("say /klasa", "ChangeClass") 

	register_clcmd("say_team /class", "ChangeClass") 

	register_clcmd("say /xp", "ShowXP") 

	register_clcmd("say_team /xp", "ShowXP") 

	register_clcmd("say_team /info", "infokom") 

	register_clcmd("say /info", "infokom") 

	register_clcmd("say /adminfo", "infokomadm") 

	register_clcmd("say_team /adminfo", "infokomadm") 

} 

public client_connect(id)  

{  

	kupil[id] = true 

	uzyl[id] = false 

	if(get_pcvar_num(SaveXP) == 1) 

	{ 

		LoadData(id) 

	} 

} 

public eDeath( ) 

{ 

	new attacker = read_data(1) 

	if(PlayerClass[attacker] == 0) 

		return PLUGIN_CONTINUE 

	

	new headshot = read_data( 3 ) 

	new clip, ammo, weapon = get_user_weapon(attacker,clip,ammo) 

	PlayerXP[attacker] += get_pcvar_num(<img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Kill) 

	if(headshot) 

		PlayerXP[attacker] += get_pcvar_num(<img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Hs) 

	if(weapon == CSW_KNIFE) 

		PlayerXP[attacker] += get_pcvar_num(<img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Knife) 

	while(PlayerXP[attacker] >= LEVELS[PlayerLevel[attacker]]) 

	{ 

		client_print(attacker, print_chat, "[<img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />] Gratulacje osiagnales level %i %s!", PlayerLevel[attacker],CLASSES[PlayerClass[attacker]]);        PlayerLevel[attacker] += 1 

	} 

	ShowHud(attacker) 

	return PLUGIN_CONTINUE 

	

} 

public ShowHud(id) 

{ 

	set_hudmessage(255, 0, 0, 0.75, 0.01, 0, 6.0, 15.0) 

	show_hudmessage(id, "Level: %i^nXP: %i^nKlasa: %s",PlayerLevel[id],PlayerXP[id],CLASSES[PlayerClass[id]]) 

} 

public ChangeClass(id) 

{ 

	new menu = menu_create("Klas Menu" , "Class_Handle") 

	menu_additem(menu ,"Asasyn", "1" , 0); 

	menu_additem(menu ,"Rycerz", "2" , 0); 

	menu_additem(menu ,"Mag", "3" , 0); 

	menu_additem(menu ,"Druid", "4" , 0); 

	menu_setprop(menu , MPROP_EXIT , MEXIT_ALL); 

	menu_display(id , menu , 0); 

	return PLUGIN_CONTINUE; 

} 



public Class_Handle(id , menu , item) 

{ 

	if(item == MENU_EXIT) 

	{ 

		menu_destroy(menu); 

	} 

	new szCommand[6] , szName[64]; new access , callback 

	menu_item_getinfo(menu , item , access , szCommand , 5 , szName , 63 , callback); 

	new i = str_to_num(szCommand); 

	if(PlayerClass[id] != i) 

	{ 

		PlayerClass[id] = i 

		client_print(id,print_chat,"Jestes teraz %s",CLASSES[i]); 

	} 

	else 

	{ 

		client_print(id,print_chat,"Przeciez jestes %s",CLASSES[i]); 

	} 

	menu_destroy(menu); 

	return PLUGIN_CONTINUE 

} 

public SaveData(id) 

{ 

	new AuthID[35];

	get_user_authid(id,AuthID,34) 

	new vaultkey[64],vaultdata[256] 

	format(vaultkey,63,"%s-Mod",AuthID) ; 

	format(vaultdata,255,"%i#%i#",PlayerXP[id],PlayerLevel[id]) ; 

	nvault_set(g_vault,vaultkey,vaultdata) ; 

	return PLUGIN_CONTINUE ; 

} 

public LoadData(id) 

{ 

	new AuthID[35];

	get_user_authid(id,AuthID,34) 

	new vaultkey[64],vaultdata[256] 

	format(vaultkey,63,"%s-Mod",AuthID) 

	format(vaultdata,255,"%i#%i#",PlayerXP[id],PlayerLevel[id]) 

	nvault_get(g_vault,vaultkey,vaultdata,255) 

	replace_all(vaultdata, 255, "#", " ") 

	new playerxp[32], playerlevel[32] 

	parse(vaultdata, playerxp, 31, playerlevel, 31) 

	PlayerXP[id] = str_to_num(playerxp) 

	PlayerLevel[id] = str_to_num(playerlevel) 

	return PLUGIN_CONTINUE 

} 

public buyhp(id) 

{ 

	if(kupil[id]||cvaron == 1) 

		client_print(id,print_chat,"[HnS] Nie moge sprzedac ci wiecej napojow zycia."); 

	else 

	{ 

		client_print(id,print_chat,"[HnS] Kupiles napoj zycia."); 

		uzyl[id] = false 

		kupil[id] = true 

	} 

} 

public usehp(id) 

{ 

	if(uzyl[id]||cvaron == 1) 

		client_print(id,print_chat,"[HnS] Nie masz napojow zycia."); 

	else 

	{ 

		set_user_health(id, 100) 

		client_print(id,print_chat,"[HnS] Uzyles napoju zycia."); 

		uzyl[id] = true 

	} 

} 

public itoito(id) 

{ 

	if(kupil[id]||cvaron == 1) 

		set_user_health(id, 100) 

	

	uzyl[id] = true 

	kupil[id] = true          

} 

public usebuyhp(id) 

{ 

	if(uzyl[id]||kupil[id]||cvaron == 1) 

		client_print(id,print_chat, "[HnS] Nie mozesz wiecej kupic i uzyc napojow Gracza."); 

	else 

		set_task(0.1, "itoito", _, _, _, "a", 1) 

	

} 

public NewRound(id) 

{ 

	kupil[id] = false 

	uzyl[id] = false 

} 

public wol(id) 

{ 

	if(is_user_admin(id)) 

		set_task(0.1, "online", _, _, _, "a", 1) 

	else 

		client_print(id,print_chat, "[HnS] Komenda nie dostępna dla normalnego Gracza."); 

} 

public woler(id) 

{ 

	if(is_user_admin(id)) 

		set_task(0.1, "offline", _, _, _, "a", 1) 

	

	else 

		client_print(id,print_chat, "[HnS] Komenda nie dostępna dla normalnego Gracza."); 

} 

public online(id) 

{ 

	if(is_user_admin(id)) 

		server_cmd("amx_cvar amx_expmod 1") 

} 

public offline(id) 

{ 

	if(is_user_admin(id)) 

		server_cmd("amx_cvar amx_expmod 0") 

} 

public info(id) 

{ 

	client_print(id,print_chat, "[HnS] Exp MoD oferuje dobra zabawe , duzo emocji oraz zroznicowane klasy /shop by otworzyc sklep /info po informacje.") 

} 

public admininfo(id) 

{ 

	if(is_user_admin(id)) 

		client_print(id,print_chat, "[HnS] amx_expmod 1 by wlaczyc 0 by wylaczyc.") 

} 

public infokom(id) 

{ 

	set_task(0.1, "info", _, _, _, "a", 1) 

	if(is_user_admin(id)){

		set_task(0.1, "admininfo", _, _, _, "a", 1) 

	}

} 

public infokomadm(id) 

{ 

	if(is_user_admin(id)) 

	{ 

		set_task(0.1, "admininfo", _, _, _, "a", 1) 

	} 

	else 

	{ 

		client_print(id,print_chat, "[HnS] Komenda dostepna wylacznie dla admina.") 

	} 

} 

public autoinfo(id) 

{ 

	set_task(130.0, "info", _, _, _, "b") 

} 







public client_disconnect(id) 

{ 

	if(get_pcvar_num(SaveXP) == 1) 

		SaveData(id) 

}

  • +
  • -
  • 0

#3 rafenn

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
zer0.

  • Postów:43
  • Lokalizacja:jestes?
Offline

Napisano 19.12.2009 22:57

thx działa poleciał pomógł ;)
  • +
  • -
  • 0




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

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