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
 

RecJew - zdjęcie

RecJew

Rejestracja: 26.08.2012
Aktualnie: Nieaktywny
Poza forum Ostatnio: 13.04.2013 17:29
-----

Moje tematy

Problem z vote_fun_mod

29.03.2013 20:42

SIema. Z nudów zrobiłem plugin który na początek każdej rundy robi vote, jaki typ gry wybrac, tylko że nie wiem jak zrobić, aby po kazdej rundzie plugin sie resetował, i rovił vote w kolejnej rundzie, poza tym mam w nim kilka będów. Mam nadzieje, że ktoś mi pomoze.

błędy:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

vote_fun_mod.sma(12) : error 029: invalid expression, assumed zero
vote_fun_mod.sma(12) : error 017: undefined symbol "start_vote"
vote_fun_mod.sma(32) : error 017: undefined symbol "choises"
vote_fun_mod.sma(32) : warning 215: expression has no effect
vote_fun_mod.sma(32) : error 001: expected token: ";", but found "]"
vote_fun_mod.sma(32) : error 029: invalid expression, assumed zero
vote_fun_mod.sma(32) : fatal error 107: too many error messages on one line

Compilation aborted.
6 Errors.


Kod SMA Pluginu:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <ns>

public plugin_init() {
register_logevent("Poczatek_Rundy", 2, "1=Round_Start")
}
public Poczatek_Rundy(id)
{
public start_vote(id)
{
new menu = menu_create("\rWybierz rodzaj rozgrywki!", "menu_handler")
menu_additem(menu, "\wNormal", "1", 0)
menu_additem(menu, "\w5000 hp", "2", 0)
menu_additem(menu, "\wboss MOD", "3", 0)
menu_additem(menu, "\wonly HS", "4", 0)
menu_additem(menu, "\wonly AWP", "5", 0)
menu_addblank(menu, 0)
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)

new players[32], inum
get_players(players, inum, "ch")
for(new i = 0; i < inum; i++)
{
menu_display(players[i], menu, 0)
}

set_task(5.0, "finish_vote")

choises[1] = choises[2] = choises[3] = choises[4] = choises[5] = 0

return 1

}
}
public menu_handler(id, menu, item)
{
if (item == MENU_EXIT)
{
menu_cancel(id)
return PLUGIN_HANDLED
}

new data[6], name[32]
new access, callback

menu_item_getinfo(menu, item, access, data, 5, _, _, callback)

new key = str_to_num(data)
get_user_name(id, name, 31)

switch (key)
{
case 1:
{
client_print (0, print_chat, "[AMXX] %s zaglosowal na Normal", name);
}
case 2:
{
client_print (0, print_chat, "[AMXX] %s zaglosowal na 5000 HP", name);
}
case 3:
{
client_print (0, print_chat, "[AMXX] %s zaglosowal na boss MOD", name);
}
case 4:
{
client_print (0, print_chat, "[AMXX] %s zaglosowal na only HS", name);

}
case 5:
{
client_print (0, print_chat, "[AMXX] %s zaglosowal na only AWP", name);
}
}

++choises[key]

menu_cancel(id)
return PLUGIN_HANDLED
}

public finish_vote()
{


if(choises[1] > choises[2] && choises[1] > choises[3] && choises[1] > choises[4] && choises[1] > choises[5])
{
client_print(0, print_chat, "[AMXX] Typ rundy został ustawiony na Normal, wybralo go %d osob", choises[1])
}
else if(choises[2] > choises[1] && choises[2] > choises[3] && choises[2] > choises[4] && choises[2] > choises[5])
{
client_print(0, print_chat, "[AMXX] Typ rundy został ustawiony na 5000 HP, wybralo go %d osob", choises[2])
new CsTeams:userTeam = cs_get_user_team(id)
if(userTeam == CS_TEAM_T)
{
give_item(id, "weapon_ak47")
give_item(id, "weapon_glock")
}
else if(userTeam == CS_TEAM_CT)
{
give_item(id, "weapon_m4a1")
give_item(id, "weapon_usp")
}
set_user_health(id, 5000)
set_user_maxspeed(id, 5.0)
}
else if(choises[3] > choises[1] && choises[3] > choises[2] && choises[3] > choises[4] && choises[3] > choises[5])
{
client_print(0, print_chat, "[AMXX] Typ rundy został ustawiony na boss MOD, wybralo go %d osob", choises[3])
public vote_gracz()
{

new play[32],num
get_players(play, num, "ahe")
new gracz=play[random(num)]
set_user_health(gracz, 5000)
client_print (0, print_chat, "[AMXX] %s JEST BOSSEM, JAZDA NA NIEGO!", name)
}
new CsTeams:userTeam = cs_get_user_team(id)
if)userTeam == CS_TEAM_T)
{
give_item(id, "weapon_ak47")
give_item(id, "weapon_glock")
}
else if(userTeam == CS_TEAM_CT)
{
give_item(id, "weapon_m4a1")
give_item(id, "weapon_usp")
}
}

else if(choises[4] > choises[1] && choises[4] > choises[2] && choises[4] > choises[3] && choises[4] > choises[5])
{
client_print(0, print_chat, "[AMXX] Typ rundy został ustawiony na Only HS, wybralo go %d osob", choises[4])
new CsTeams:userTeam = cs_get_user_team(id)
if(userTeam == CS_TEAM_T)
{
give_item(id, "weapon_ak47")
give_item(id, "weapon_glock")
}
else if(userTeam == CS_TEAM_CT)
{
give_item(id, "weapon_m4a1")
give_item(id, "weapon_usp")
}
server_cmd("amx_hs_mode 1")
}

else if(choises[5] > choises[1] && choises[5] > choises[2] && choises[5] > choises[3] && choises[5] > choises[4])
{
server_cmd("amx_hs_mode 1")
new CsTeams:userTeam = cs_get_user_team(id)
if)userTeam == CS_TEAM_T)
{
give_item(id, "weapon_awp")
give_item(id, "weapon_glock")
}
else if(userTeam == CS_TEAM_CT)
{
give_item(id, "weapon_awp")
give_item(id, "weapon_usp")
}
}
}

Problem z vote_fun_mod.

28.03.2013 16:53

SIema. Z nudów zrobiłem plugin. Mam w nim kilka błędów, tylko nie wiem gdzie nie moge ich znaleść. Mam nadzieje, że ktos mi pomoże!

błędy:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

aaa.sma(12) : error 029: invalid expression, assumed zero
aaa.sma(12) : error 017: undefined symbol "start_vote"
aaa.sma(32) : error 017: undefined symbol "choises"
aaa.sma(32) : warning 215: expression has no effect
aaa.sma(32) : error 001: expected token: ";", but found "]"
aaa.sma(32) : error 029: invalid expression, assumed zero
aaa.sma(32) : fatal error 107: too many error messages on one line

Compilation aborted.
6 Errors.


Kod sma pluginu:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <ns>

public plugin_init() {
register_logevent("Poczatek_Rundy", 2, "1=Round_Start")
}
public Poczatek_Rundy(id)
{
public start_vote(id)
{
new menu = menu_create("\rWybierz rodzaj rozgrywki!", "menu_handler")
menu_additem(menu, "\wNormal", "1", 0)
menu_additem(menu, "\w5000 hp", "2", 0)
menu_additem(menu, "\wboss MOD", "3", 0)
menu_additem(menu, "\wonly HS", "4", 0)
menu_additem(menu, "\wonly AWP", "5", 0)
menu_addblank(menu, 0)
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)

new players[32], inum
get_players(players, inum, "ch")
for(new i = 0; i < inum; i++)
{
menu_display(players[i], menu, 0)
}

set_task(5.0, "finish_vote")

choises[1] = choises[2] = choises[3] = choises[4] = choises[5] = 0

return 1

}
}
public menu_handler(id, menu, item)
{
if (item == MENU_EXIT)
{
menu_cancel(id)
return PLUGIN_HANDLED
}

new data[6], name[32]
new access, callback

menu_item_getinfo(menu, item, access, data, 5, _, _, callback)

new key = str_to_num(data)
get_user_name(id, name, 31)

switch (key)
{
case 1:
{
client_print (0, print_chat, "[AMXX] %s zaglosowal na Normal", name);
}
case 2:
{
client_print (0, print_chat, "[AMXX] %s zaglosowal na 5000 HP", name);
}
case 3:
{
client_print (0, print_chat, "[AMXX] %s zaglosowal na boss MOD", name);
}
case 4:
{
client_print (0, print_chat, "[AMXX] %s zaglosowal na only HS", name);

}
case 5:
{
client_print (0, print_chat, "[AMXX] %s zaglosowal na only AWP", name);
}
}

++choises[key]

menu_cancel(id)
return PLUGIN_HANDLED
}

public finish_vote()
{


if(choises[1] > choises[2] && choises[1] > choises[3] && choises[1] > choises[4] && choises[1] > choises[5])
{
client_print(0, print_chat, "[AMXX] Typ rundy został ustawiony na Normal, wybralo go %d osob", choises[1])
}
else if(choises[2] > choises[1] && choises[2] > choises[3] && choises[2] > choises[4] && choises[2] > choises[5])
{
client_print(0, print_chat, "[AMXX] Typ rundy został ustawiony na 5000 HP, wybralo go %d osob", choises[2])
new CsTeams:userTeam = cs_get_user_team(id)
if(userTeam == CS_TEAM_T)
{
give_item(id, "weapon_ak47")
give_item(id, "weapon_glock")
}
else if(userTeam == CS_TEAM_CT)
{
give_item(id, "weapon_m4a1")
give_item(id, "weapon_usp")
}
set_user_health(id, 5000)
set_user_maxspeed(id, 5.0)
}
else if(choises[3] > choises[1] && choises[3] > choises[2] && choises[3] > choises[4] && choises[3] > choises[5])
{
client_print(0, print_chat, "[AMXX] Typ rundy został ustawiony na boss MOD, wybralo go %d osob", choises[3])
public vote_gracz()
{

new play[32],num
get_players(play, num, "ahe")
new gracz=play[random(num)]
set_user_health(gracz, 5000)
client_print (0, print_chat, "[AMXX] %s JEST BOSSEM, JAZDA NA NIEGO!", name)
}
new CsTeams:userTeam = cs_get_user_team(id)
if)userTeam == CS_TEAM_T)
{
give_item(id, "weapon_ak47")
give_item(id, "weapon_glock")
}
else if(userTeam == CS_TEAM_CT)
{
give_item(id, "weapon_m4a1")
give_item(id, "weapon_usp")
}
}

else if(choises[4] > choises[1] && choises[4] > choises[2] && choises[4] > choises[3] && choises[4] > choises[5])
{
client_print(0, print_chat, "[AMXX] Typ rundy został ustawiony na Only HS, wybralo go %d osob", choises[4])
new CsTeams:userTeam = cs_get_user_team(id)
if(userTeam == CS_TEAM_T)
{
give_item(id, "weapon_ak47")
give_item(id, "weapon_glock")
}
else if(userTeam == CS_TEAM_CT)
{
give_item(id, "weapon_m4a1")
give_item(id, "weapon_usp")
}
server_cmd("amx_hs_mode 1")
}

else if(choises[5] > choises[1] && choises[5] > choises[2] && choises[5] > choises[3] && choises[5] > choises[4])
{
server_cmd("amx_hs_mode 1")
new CsTeams:userTeam = cs_get_user_team(id)
if)userTeam == CS_TEAM_T)
{
give_item(id, "weapon_awp")
give_item(id, "weapon_glock")
}
else if(userTeam == CS_TEAM_CT)
{
give_item(id, "weapon_awp")
give_item(id, "weapon_usp")
}
}
}

Gdzieś mam błędy

27.03.2013 21:32

SIema! Nudiło mi się wieć chciałem napisać plugin, taki dla fanu, i mam w nim kilka błędów, i nigdzie nie moge ich znaleźć. Jeśli ktoś je znajdzie proszę o pomoc! Dzięki z góry!

aaa.sma(12) : error 029: invalid expression, assumed zero
aaa.sma(12) : error 017: undefined symbol "start_vote"
aaa.sma(31) : error 017: undefined symbol "choises"
aaa.sma(31) : warning 215: expression has no effect
aaa.sma(31) : error 001: expected token: ";", but found "]"
aaa.sma(31) : error 029: invalid expression, assumed zero
aaa.sma(31) : fatal error 107: too many error messages on one line

Compilation aborted.
6 Errors.

Kod sma pluginu:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <ns>

public plugin_init() {
register_logevent("Poczatek_Rundy", 2, "1=Round_Start")
}
public Poczatek_Rundy(id)
{
public start_vote(id)
{
new menu = menu_create("\rWybierz rodzaj rozgrywki!", "menu_handler")
menu_additem(menu, "\wNormal", "1", 0)
menu_additem(menu, "\w5000 hp", "2", 0)
menu_additem(menu, "\wboss MOD", "3", 0)
menu_additem(menu, "\wonly HS", "4", 0)
menu_addblank(menu, 0)
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)

new players[32], inum
get_players(players, inum, "ch")
for(new i = 0; i < inum; i++)
{
menu_display(players[i], menu, 0)
}

set_task(15.0, "finish_vote")

choises[1] = choises[2] = choises[3] = choises[4] = 0

return 1

}
}
public menu_handler(id, menu, item)
{
if (item == MENU_EXIT)
{
menu_cancel(id)
return PLUGIN_HANDLED
}

new data[6], name[32]
new access, callback

menu_item_getinfo(menu, item, access, data, 5, _, _, callback)

new key = str_to_num(data)
get_user_name(id, name, 31)

switch (key)
{
case 1:
{
client_print (0, print_chat, "[AMXX] %s zaglosowal na Normal", name);
}
case 2:
{
client_print (0, print_chat, "[AMXX] %s zaglosowal na 5000 HP", name);
}
case 3:
{
client_print (0, print_chat, "[AMXX] %s zaglosowal na boss MOD", name);
}
case 4:
{
client_print (0, print_chat, "[AMXX] %s zaglosowal na only HS", name);

}
}

++choises[key]

menu_cancel(id)
return PLUGIN_HANDLED
}

public finish_vote()
{


if(choises[1] > choises[2] && choises[1] > choises[3] && choises[1] > choises[4])
{
client_print(0, print_chat, "[AMXX] Typ rundy został ustawiony na Normal, wybralo go %d osob", choises[1])
}

else if(choises[2] > choises[1] && choises[2] > choises[3] && choises[2] > choises[4])
{
client_print(0, print_chat, "[AMXX] Typ rundy został ustawiony na 5000 HP, wybralo go %d osob", choises[2])
}
else if(choises[3] > choises[1] && choises[3] > choises[2] && choises[3] > choises[4])
{
client_print(0, print_chat, "[AMXX] Typ rundy został ustawiony na boss MOD, wybralo go %d osob", choises[3])
}

else if(choises[4] > choises[1] && choises[4] > choises[2] && choises[4] > choises[3])
{
client_print(0, print_chat, "[AMXX] Typ rundy został ustawiony na Only HS, wybralo go %d osob", choises[4])
}

}
public menu_start(id)
{
++choises[key]
public menu_Normal(id)
{
if(choies[1])
PLUGIN_CANNELED
}
public menu_5000hp(id)
{
if(choies[2])
{
new CsTeams:userTeam = cs_get_user_team(id)
if(userTeam == CS_TEAM_T)
{
give_item(id, "weapon_ak47")
give_item(id, "weapon_glock")
}
else if(userTeam == CS_TEAM_CT){
give_item(id, "weapon_m4a1")
give_item(id, "weapon_usp")
}
set_user_health(id, 5000)
set_user_maxspeed(id, 5.0)
}
}
public menu_boss(id)
{
if(choies[3])
{
new play[32],num
get_players(play, num, "ahe")
new gracz=play[random(num)]
set_user_health(gracz, 5000)
client_print (0, print_chat, "[AMXX] %s JEST BOSSEM, JAZDA NA NIEGO!", name)
new CsTeams:userTeam = cs_get_user_team(id)
if(userTeam == CS_TEAM_T){
give_item(id, "weapon_ak47")
give_item(id, "weapon_glock")
}
else if(userTeam == CS_TEAM_CT){
give_item(id, "weapon_m4a1")
give_item(id, "weapon_usp")
}
}
if(choises[3])
{
new CsTeams:userTeam = cs_get_user_team(id)
if(userTeam == CS_TEAM_T)
{
give_item(id, "weapon_ak47")
give_item(id, "weapon_glock")
}
else if(userTeam == CS_TEAM_CT)
{
give_item(id, "weapon_m4a1")
give_item(id, "weapon_usp")
}
}
}
public menu_OnlyHS(id)
{
if(choies[4])
{
new CsTeams:userTeam = cs_get_user_team(id)
if(userTeam == CS_TEAM_T){
give_item(id, "weapon_ak47")
give_item(id, "weapon_glock")
}
else if(userTeam == CS_TEAM_CT){
give_item(id, "weapon_m4a1")
give_item(id, "weapon_usp")
}
server_cmd("amx_hs_mode 1")
}
}
}

Problem z Kompilacją perku

14.03.2013 18:26

Witam. Dopiero zaczynam pisać pluginy i dziś prubolłem napisać perk do cod moda.
I nadal nie wiem gdzie mam takie błędy:
a.sma(27) : error 029: invalid expression, assumed zero
a.sma(27) : warning 221: label name "Float" shadows tag name
a.sma(27) : error 017: undefined symbol "speed"
a.sma(27) : error 029: invalid expression, assumed zero
a.sma(27) : fatal error 107: too many error messages on one line


Oto kod perku:

#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <codmod>
#include <cstrike>

#define DMG_BULLET (1<<1)

new const perk_name[] = "Mistrz M4A1";
new const perk_desc[] = "Natychmiastowe zabicie z M4A1, 10hp oraz zmniejszony speed";

new bool:ma_perk[33];

public plugin_init()
{
register_plugin(perk_name, "1.0", "QTM_Peyote");

cod_register_perk(perk_name, perk_desc);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
}

public Moc(id)
{
set_user_health (id, 10)
set_user_maxspeed (id, [ Float:speed = - 0.5 ] )
}

public cod_perk_enabled(id)
{
cod_give_weapon(id, CSW_M4A1);
ma_perk[id] = true;
}

public cod_perk_disabled(id)
{
cod_take_weapon(id, CSW_M4A1);
ma_perk[id] = false;
}

public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;

if(!ma_perk[idattacker])
return HAM_IGNORED;

if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_M4A1 && damagebits & DMG_BULLET)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);

return HAM_IGNORED;
}

[ROZWIĄZANE] Problem z kompilacją

11.03.2013 18:14

Witam, mam problem z kompilacją, ciągle mam ten błąd:
modele.sma(21) : error 001: expected token: "}", but found "-end of file-"

Wiem, że jest to bardzo prosty plugin, lecz dopiero zaczynam.


#include <amxmodx>
#include <amxmisc>
#include <cstrike>


#define PLUGIN "New Plug-In"
#define VERSION "0.1"
#define AUTHOR "RecJew"

public Moc(id) {
if (get_user_flags(id) & ADMIN_LEVEL_A)
{
new CsTeams:team
team = cs_get_user_team(id)

if (team == CS_TEAM_CT)
cs_set_user_model(id, "adminct") //kamuflaz
else

cs_set_user_model(id, "admintt") //kamuflaz
}