Nie będę ukrywał sma jak to inni robią po to robie pluginy, aby pokazywać sma naprawiać błędy usprawniać kod ;]
Co nie działa?
/home/groups/amxmodx/tmp3/textsBCtNr.sma(59) : error 001: expected token: ",", but found "-identifier-" /home/groups/amxmodx/tmp3/textsBCtNr.sma(59) : error 017: undefined symbol "E" /home/groups/amxmodx/tmp3/textsBCtNr.sma(59) : error 029: invalid expression, assumed zero /home/groups/amxmodx/tmp3/textsBCtNr.sma(59) : fatal error 107: too many error messages on one line
Wcześniej miałem około 20 błędów, które z powodzeniem naprawiłem... tutaj się domyślam o co chodzi, ale jednak źle działam...
/*
* Okulary przeciwsloneczne v1.0b - poprawiono bug zwiazany z czasem oslepienia.
*
* ---------------
* by silversurfer
* ---------------
*
*
*
* CVARY:
* amx_kupokulary < 1 / 0 > - domyślnie 1
* amx_koszt < koszt okularów > - domyślnie 3000
*
* KOMENDY:
* Uzyj czyli przycisk "e" wkłada okulary przeciwsłoneczne
*
*/
#include <amxmodx>
#include <fakemeta>
#define PLUGIN "Okulary przeciwsloneczne"
#define VERSION "1.0b"
#define AUTHOR "silversurfer"
#define OFFSET_CSMONEY 115
#define LINUX_EXTRAOFFSET 5
new Float:lastspam[33],Float:lastflash[33],kupokulary,koszt,SayText,ScreenFade,Money,Hudmes;
public plugin_init()
{
register_plugin(PLUGIN,VERSION,AUTHOR);
register_cvar(PLUGIN,AUTHOR,FCVAR_SERVER|FCVAR_UNLOGGED);
kupokulary = register_cvar("amx_kupokulary","1",FCVAR_SERVER|FCVAR_UNLOGGED);
koszt = register_cvar("amx_koszt","3000",FCVAR_SERVER|FCVAR_UNLOGGED);
register_event("ScreenFade","sloneczne","be","4=255","5=255","6=255","7>199");
register_forward(FM_CmdStart,"sloneczne_okulary",1);
SayText = get_user_msgid("SayText");
ScreenFade = get_user_msgid("ScreenFade");
Money = get_user_msgid("Money");
Hudmes = CreateHudSyncObj();
}
public sloneczne(const id)
{
if (get_pcvar_num(kupokulary))
{
new Float:time;
global_get(glb_time,time);
lastflash[id] = time;
if (!lastspam[id] || (time-lastspam[id]>400.0 && random_num(0,1)))
{
lastspam[id] = time;
static message[100];
formatex(message,99,"^4[NonSteam.pl] Nacisnij ^3+Uzyj - domyslnie klawisz "E"^4 zeby uzyc okulary tylko ^3$%d^4.",get_pcvar_num(koszt))
message_begin(MSG_ONE,SayText,_,id);
write_byte(id);
write_string(message);
message_end();
}
}
}
public sloneczne_okulary(const id)
{
new Float:time;
global_get(glb_time,time);
if (get_pcvar_num(kupokulary) && (pev(id,pev_button) & IN_USE) && !(pev(id,pev_oldbuttons) & IN_USE) && time-lastflash[id]<5.0)
{
new user_money = get_pdata_int(id,OFFSET_CSMONEY,LINUX_EXTRAOFFSET);
if (user_money<get_pcvar_num(koszt))
{
static message[100];
formatex(message,99,"^4[NonSteam.pl] Nie masz kasy. Okulary przeciwsloneczne kosztuja ^3$%d^4.",get_pcvar_num(koszt))
message_begin(MSG_ONE,SayText,_,id);
write_byte(id);
write_string(message);
message_end();
}
else
{
message_begin(MSG_ONE,ScreenFade,_,id);
write_short(1000);
write_short(1000);
write_short(0);
write_byte(0);
write_byte(150);
write_byte(0);
write_byte(70);
message_end();
user_money -= get_pcvar_num(koszt);
set_pdata_int(id,OFFSET_CSMONEY,user_money,LINUX_EXTRAOFFSET);
message_begin(MSG_ONE,Money,_,id);
write_long(user_money);
write_byte(1);
message_end();
static name[16];
get_user_name(id,name,15);
set_hudmessage(0, 240, 10, 0.70, 0.77, 0, 5.0, 5.0, 0.5, 0.15, -1);
ShowSyncHudMsg(0, Hudmes, "%s posiada okulary przeciwsloneczne!",name);
}
lastflash[id] = time - 5.0;
}
return FMRES_IGNORED;
}
public client_disconnect(id)
lastspam[id] = lastflash[id] = 0.0;


Dodatki SourceMod



Temat jest zamknięty



plugin.amxx






