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

Magiczny pisak, nie działa dla Vipow


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
8 odpowiedzi w tym temacie

#1 LucKy_skiLL

    Godlike

  • Power User

Reputacja: 163
Profesjonalista

  • Postów:1 301
  • GG:
  • Lokalizacja:Kraków
Offline

Napisano 23.10.2011 16:17

Flaga jest ADMIN_LEVEL_H dodaje graczowi w users.ini flage "t" ale on nie moze pisac a np. osoba ze wszystkimi flagami moze


#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <xs>
#include <ColorChat>
#define PLUGIN "Magic Marker"
#define VERSION "3.0"
#define AUTHOR "stupok69"
#define MAX_PLAYERS 32
#define FLAGA ADMIN_LEVEL_H
new Float:origin[MAX_PLAYERS+1][3]
new prethink_counter[MAX_PLAYERS+1]
new bool:is_drawing[MAX_PLAYERS+1]
new bool:is_holding[MAX_PLAYERS+1]
new spriteid
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("+paint", "paint_handler", FLAGA, "Paint on the walls!")
register_clcmd("-paint", "paint_handler", FLAGA, "Paint on the walls!")
register_forward(FM_PlayerPreThink, "forward_FM_PlayerPreThink", 0)
}
public plugin_precache()
{
spriteid = precache_model("sprites/lgtning.spr")
}
public paint_handler(id, level, cid)
{
if(!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED

if(!is_user_alive(id))
{
ColorChat(id, GREEN, "[JailBreak]^x01 Nie mozesz uzywac pisaka gdy nie zyjesz")
return PLUGIN_HANDLED
}

static cmd[2]
read_argv(0, cmd, 1)

switch(cmd[0])
{
case '+': is_drawing[id] = true
case '-': is_drawing[id] = false
}
return PLUGIN_HANDLED
}
public forward_FM_PlayerPreThink(id)
{
if(prethink_counter[id]++ > 5)
{
if(is_drawing[id] && !is_aiming_at_sky(id))
{
static Float:cur_origin[3], Float:distance
cur_origin = origin[id]

if(!is_holding[id])
{
fm_get_aim_origin(id, origin[id])
move_toward_client(id, origin[id])
is_holding[id] = true
return FMRES_IGNORED
}

fm_get_aim_origin(id, origin[id])
move_toward_client(id, origin[id])

distance = get_distance_f(origin[id], cur_origin)

if(distance > 2)
{
draw_line(origin[id], cur_origin)
}
}
else
{
is_holding[id] = false
}
prethink_counter[id] = 0
}

return FMRES_IGNORED
}
stock draw_line(Float:origin1[3], Float:origin2[3])
{
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_BEAMPOINTS)
engfunc(EngFunc_WriteCoord, origin1[0])
engfunc(EngFunc_WriteCoord, origin1[1])
engfunc(EngFunc_WriteCoord, origin1[2])
engfunc(EngFunc_WriteCoord, origin2[0])
engfunc(EngFunc_WriteCoord, origin2[1])
engfunc(EngFunc_WriteCoord, origin2[2])
write_short(spriteid)
write_byte(0)
write_byte(10)
write_byte(255)
write_byte(50)
write_byte(0)
write_byte(random(255))
write_byte(random(255))
write_byte(random(255))
write_byte(255)
write_byte(0)
message_end()
}
//from fakemeta_util.inc
stock fm_get_aim_origin(index, Float:origin[3])
{
static Float:start[3], Float:view_ofs[3]
pev(index, pev_origin, start)
pev(index, pev_view_ofs, view_ofs)
xs_vec_add(start, view_ofs, start)

static Float:dest[3]
pev(index, pev_v_angle, dest)
engfunc(EngFunc_MakeVectors, dest)
global_get(glb_v_forward, dest)
xs_vec_mul_scalar(dest, 9999.0, dest)
xs_vec_add(start, dest, dest)

engfunc(EngFunc_TraceLine, start, dest, 0, index, 0)
get_tr2(0, TR_vecEndPos, origin)

return 1
}
stock move_toward_client(id, Float:origin[3])
{
static Float:player_origin[3]

pev(id, pev_origin, player_origin)

origin[0] += (player_origin[0] > origin[0]) ? 1.0 : -1.0
origin[1] += (player_origin[1] > origin[1]) ? 1.0 : -1.0
origin[2] += (player_origin[2] > origin[2]) ? 1.0 : -1.0
}
//Thanks Alka!
stock bool:is_aiming_at_sky(index)
{
static target, temp

get_user_aiming(index, target, temp)

if(engfunc(EngFunc_PointContents,target) == CONTENTS_SKY)
return true

return false
}

  • +
  • -
  • 0

Oglądasz seriale typu: The Flash, Arrow, Daredevil, The Walking Dead? Jeśli tak, to zapraszam na mój kanał YouTube


#2 ;((

    Super Hero

  • Użytkownik

Reputacja: 347
Wszechpomocny

  • Postów:1 157
  • Lokalizacja:Aha
Offline

Napisano 23.10.2011 16:51

Try


#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <xs>
#include <ColorChat>
#define PLUGIN "Magic Marker"
#define VERSION "3.0"
#define AUTHOR "stupok69"
#define MAX_PLAYERS 32
#define FLAGA ADMIN_LEVEL_H
new Float:origin[MAX_PLAYERS+1][3]
new prethink_counter[MAX_PLAYERS+1]
new bool:is_drawing[MAX_PLAYERS+1]
new bool:is_holding[MAX_PLAYERS+1]
new spriteid
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("+paint", "paint_handler", FLAGA, "Paint on the walls!")
register_clcmd("-paint", "paint_handler", FLAGA, "Paint on the walls!")
register_forward(FM_PlayerPreThink, "forward_FM_PlayerPreThink", 0)
}
public plugin_precache()
{
spriteid = precache_model("sprites/lgtning.spr")
}
public paint_handler(id, level, cid)
{
if(cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED

if(!is_user_alive(id))
{
ColorChat(id, GREEN, "[JailBreak]^x01 Nie mozesz uzywac pisaka gdy nie zyjesz")
return PLUGIN_HANDLED
}

static cmd[2]
read_argv(0, cmd, 1)

switch(cmd[0])
{
case '+': is_drawing[id] = true
case '-': is_drawing[id] = false
}
return PLUGIN_HANDLED
}
public forward_FM_PlayerPreThink(id)
{
if(prethink_counter[id]++ > 5)
{
if(is_drawing[id] && !is_aiming_at_sky(id))
{
static Float:cur_origin[3], Float:distance
cur_origin = origin[id]

if(!is_holding[id])
{
fm_get_aim_origin(id, origin[id])
move_toward_client(id, origin[id])
is_holding[id] = true
return FMRES_IGNORED
}

fm_get_aim_origin(id, origin[id])
move_toward_client(id, origin[id])

distance = get_distance_f(origin[id], cur_origin)

if(distance > 2)
{
draw_line(origin[id], cur_origin)
}
}
else
{
is_holding[id] = false
}
prethink_counter[id] = 0
}

return FMRES_IGNORED
}
stock draw_line(Float:origin1[3], Float:origin2[3])
{
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_BEAMPOINTS)
engfunc(EngFunc_WriteCoord, origin1[0])
engfunc(EngFunc_WriteCoord, origin1[1])
engfunc(EngFunc_WriteCoord, origin1[2])
engfunc(EngFunc_WriteCoord, origin2[0])
engfunc(EngFunc_WriteCoord, origin2[1])
engfunc(EngFunc_WriteCoord, origin2[2])
write_short(spriteid)
write_byte(0)
write_byte(10)
write_byte(255)
write_byte(50)
write_byte(0)
write_byte(random(255))
write_byte(random(255))
write_byte(random(255))
write_byte(255)
write_byte(0)
message_end()
}
//from fakemeta_util.inc
stock fm_get_aim_origin(index, Float:origin[3])
{
static Float:start[3], Float:view_ofs[3]
pev(index, pev_origin, start)
pev(index, pev_view_ofs, view_ofs)
xs_vec_add(start, view_ofs, start)

static Float:dest[3]
pev(index, pev_v_angle, dest)
engfunc(EngFunc_MakeVectors, dest)
global_get(glb_v_forward, dest)
xs_vec_mul_scalar(dest, 9999.0, dest)
xs_vec_add(start, dest, dest)

engfunc(EngFunc_TraceLine, start, dest, 0, index, 0)
get_tr2(0, TR_vecEndPos, origin)

return 1
}
stock move_toward_client(id, Float:origin[3])
{
static Float:player_origin[3]

pev(id, pev_origin, player_origin)

origin[0] += (player_origin[0] > origin[0]) ? 1.0 : -1.0
origin[1] += (player_origin[1] > origin[1]) ? 1.0 : -1.0
origin[2] += (player_origin[2] > origin[2]) ? 1.0 : -1.0
}
//Thanks Alka!
stock bool:is_aiming_at_sky(index)
{
static target, temp

get_user_aiming(index, target, temp)

if(engfunc(EngFunc_PointContents,target) == CONTENTS_SKY)
return true

return false
}


  • +
  • -
  • 0

#3 LucKy_skiLL

    Godlike

  • Autor tematu
  • Power User

Reputacja: 163
Profesjonalista

  • Postów:1 301
  • GG:
  • Lokalizacja:Kraków
Offline

Napisano 26.10.2011 08:27

Teraz wszyscy mogą ryskować

Odświeżam
  • +
  • -
  • 0

Oglądasz seriale typu: The Flash, Arrow, Daredevil, The Walking Dead? Jeśli tak, to zapraszam na mój kanał YouTube


#4 Misiaczek ;c

    /dev/null

  • Moderator

Reputacja: 1 678
Godlike

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

Napisano 26.10.2011 12:40

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <xs>

#define PLUGIN "Magic Marker"
#define VERSION "3.1"
#define AUTHOR "stupok69"

#define MAX_PLAYERS 32
#define USAGE_LEVEL ADMIN_LEVEL_H

new Float:origin[MAX_PLAYERS+1][3]
new prethink_counter[MAX_PLAYERS+1]
new bool:is_drawing[MAX_PLAYERS+1]
new bool:is_holding[MAX_PLAYERS+1]

new spriteid

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("+paint", "paint_handler", USAGE_LEVEL, "Paint on the walls!")
register_clcmd("-paint", "paint_handler", USAGE_LEVEL, "Paint on the walls!")
register_forward(FM_PlayerPreThink, "forward_FM_PlayerPreThink", 0)
}

public plugin_precache()
{
spriteid = precache_model("sprites/lgtning.spr")
}

public paint_handler(id, level, cid)
{
if(!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED

if(!is_user_alive(id))
{
client_print(id, print_chat, "* You cannot use the magic marker when you are dead.")
return PLUGIN_HANDLED
}

static cmd[2]
read_argv(0, cmd, 1)

switch(cmd[0])
{
case '+': is_drawing[id] = true
case '-': is_drawing[id] = false
}
return PLUGIN_HANDLED
}

public forward_FM_PlayerPreThink(id)
{
if(prethink_counter[id]++ > 5)
{
if(is_drawing[id] && !is_aiming_at_sky(id))
{
static Float:cur_origin[3], Float:distance

cur_origin = origin[id]

if(!is_holding[id])
{
fm_get_aim_origin(id, origin[id])
move_toward_client(id, origin[id])
is_holding[id] = true
return FMRES_IGNORED
}

fm_get_aim_origin(id, origin[id])
move_toward_client(id, origin[id])

distance = get_distance_f(origin[id], cur_origin)

if(distance > 2)
{
draw_line(origin[id], cur_origin)
}
}
else
{
is_holding[id] = false
}
prethink_counter[id] = 0
}

return FMRES_IGNORED
}

stock draw_line(Float:origin1[3], Float:origin2[3])
{
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_BEAMPOINTS)
engfunc(EngFunc_WriteCoord, origin1[0])
engfunc(EngFunc_WriteCoord, origin1[1])
engfunc(EngFunc_WriteCoord, origin1[2])
engfunc(EngFunc_WriteCoord, origin2[0])
engfunc(EngFunc_WriteCoord, origin2[1])
engfunc(EngFunc_WriteCoord, origin2[2])
write_short(spriteid)
write_byte(0)
write_byte(10)
write_byte(255)
write_byte(50)
write_byte(0)
write_byte(random(255))
write_byte(random(255))
write_byte(random(255))
write_byte(255)
write_byte(0)
message_end()
}

//from fakemeta_util.inc
stock fm_get_aim_origin(index, Float:origin[3])
{
static Float:start[3], Float:view_ofs[3]
pev(index, pev_origin, start)
pev(index, pev_view_ofs, view_ofs)
xs_vec_add(start, view_ofs, start)

static Float:dest[3]
pev(index, pev_v_angle, dest)
engfunc(EngFunc_MakeVectors, dest)
global_get(glb_v_forward, dest)
xs_vec_mul_scalar(dest, 9999.0, dest)
xs_vec_add(start, dest, dest)

engfunc(EngFunc_TraceLine, start, dest, 0, index, 0)
get_tr2(0, TR_vecEndPos, origin)

return 1
}

stock move_toward_client(id, Float:origin[3])
{
static Float:player_origin[3]

pev(id, pev_origin, player_origin)

origin[0] += (player_origin[0] > origin[0]) ? 1.0 : -1.0
origin[1] += (player_origin[1] > origin[1]) ? 1.0 : -1.0
origin[2] += (player_origin[2] > origin[2]) ? 1.0 : -1.0
}
//Thanks AdaskoMX!
bool:is_aiming_at_sky(index)
{
new Float:origin[3];
fm_get_aim_origin(index, origin);

return engfunc(EngFunc_PointContents, origin) == CONTENTS_SKY;
}

  • +
  • -
  • 0

#5 LucKy_skiLL

    Godlike

  • Autor tematu
  • Power User

Reputacja: 163
Profesjonalista

  • Postów:1 301
  • GG:
  • Lokalizacja:Kraków
Offline

Napisano 28.10.2011 16:57

Dalej nie działa, daje graczowi takie flagi "mtu"

Odświeżam
  • +
  • -
  • 0

Oglądasz seriale typu: The Flash, Arrow, Daredevil, The Walking Dead? Jeśli tak, to zapraszam na mój kanał YouTube


#6 sNH.

    Czy MisieQ ukradł ciasteczko?

  • Power User

Reputacja: 299
Wszechwidzący

  • Postów:1 070
  • Steam:steam
  • Imię:Bartek
  • Lokalizacja:Ełk
Offline

Napisano 28.10.2011 17:13

Flaga jest ADMIN_LEVEL_H dodaje graczowi w users.ini flage "t" ale on nie moze pisac a np. osoba ze wszystkimi flagami moze
no to w users,ini wpisz flagę h
  • +
  • -
  • 0

#7 LucKy_skiLL

    Godlike

  • Autor tematu
  • Power User

Reputacja: 163
Profesjonalista

  • Postów:1 301
  • GG:
  • Lokalizacja:Kraków
Offline

Napisano 05.11.2011 20:07

Flaga h to "ADMIN_CFG" wiec to nie ma sensu

Odświeżam

Odświeżam

Odświeżam

Odświeżam
  • +
  • -
  • 0

Oglądasz seriale typu: The Flash, Arrow, Daredevil, The Walking Dead? Jeśli tak, to zapraszam na mój kanał YouTube


#8 speedkill

    Godlike

  • Przyjaciel

Reputacja: 1 592
Godlike

  • Postów:2 733
  • GG:
  • Steam:steam
  • Imię:Michał
  • Lokalizacja:Prudnik
Offline

Napisano 05.11.2011 20:25

Wywal
if(!cmd_access(id, level, cid, 1))
    return PLUGIN_HANDLED
I z register_clcmd( Usage level
w funkcji
public paint_handler(id, level, cid)
Wywal level,cid i daj tak
public paint_handler(id)
W tej komedzie daj
if (get_user_flags(id) &amp; ADMIN_LEVEL_H)
Czyli
public paint_handler(id)
{
    if(!is_user_alive(id))
    {
        client_print(id, print_chat, "* You cannot use the magic marker when you are dead.")
        return PLUGIN_HANDLED
    }
    if (get_user_flags(id) & ADMIN_LEVEL_H)
    {
        static cmd[2]
        read_argv(0, cmd, 1)
        
        switch(cmd[0])
        {
            case '+': is_drawing[id] = true
                case '-': is_drawing[id] = false
            }
        return PLUGIN_HANDLED
    }
}

Użytkownik speedkill123 edytował ten post 05.11.2011 20:27

  • +
  • -
  • 0

If you can dream it, you can do it.


#9 LucKy_skiLL

    Godlike

  • Autor tematu
  • Power User

Reputacja: 163
Profesjonalista

  • Postów:1 301
  • GG:
  • Lokalizacja:Kraków
Offline

Napisano 08.11.2011 21:15

Ehh dalej nie działa

Odświeżam
  • +
  • -
  • 0

Oglądasz seriale typu: The Flash, Arrow, Daredevil, The Walking Dead? Jeśli tak, to zapraszam na mój kanał YouTube





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

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