PDA

View Full Version : Nesesito el Semiclip Plugin


p4rp4d30
08-13-2007, 23:04
Bueno quiero ver si me podrian conseguir o de alguna manera extraer el Semiclip del Plugin prokreedz que tiene 1 semiclip que al asercarte c pone transparente...
Lo unico que nesesito de aca es el SemiClip.

O sino crear 1 semiclip pero que al asercarte al Player sea transparente que lo pueda ver transparente al player Como en este plugin el prokreedz.

aca les dejo el Sma


#include <amxmodx>
#include <amxmisc>
#include <fun> // For some Adminstuff
#include <engine> // My most used module ;o
#include <cstrike> // I need this to give somebody a nvg :(
#include <nvault> // For top10
#define MAX_CPS 5 // MUST be greater than 2
#define NOBLOCK_DISTANCE 120.0 // Distance between 2 players - if distance is smaller -> semiclip
#define CP_DISTANCE 35.0 // Distance between player and checkpoint
#define KZ_LEVEL ADMIN_KICK // Adminlevel
#define BUTTON_DISTANCE 70.0 // Distance between timer button and player
#define MENU_KEYS MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|M ENU_KEY_5|MENU_KEY_0
#define MENU_KEYS_ADMIN MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|M ENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|ME NU_KEY_9|MENU_KEY_0
new bool:noblock[32]
new Float:checkpoints[32][MAX_CPS][3]
new checkpointnum[32]
new bool:needhelp[32]
new helpcount[32]
new bool:timer_started[32]
new timer_time[32]
new bool:showtimer[32]
new bhop[32]
new bool:usedbutton[32]
new bool:firstspawn[32]
// CVars (I like CVar pointers :o)
new kz_checkpoints
new kz_godmode
new kz_scout
new kz_help
new kz_semiclip
new kz_bhop
new kz_adminglow
new kz_cheatdetect
new kz_transparency
// Sprites
new Sbeam = 0
// ============================================= ============================================= =======
public plugin_init() {
register_plugin("ProKreedz","1.0","p4ddY")

register_cvar("prokreedz_version","1.0",FCVAR_SERVER)

// CVars
kz_checkpoints = register_cvar("kz_checkpoints","1")
kz_godmode = register_cvar("kz_godmode","1")
kz_scout = register_cvar("kz_scout","1")
kz_help = register_cvar("kz_help","0")
kz_semiclip = register_cvar("kz_semiclip","1")
kz_bhop = register_cvar("kz_bhop","0")
kz_adminglow = register_cvar("kz_adminglow","0")
kz_cheatdetect = register_cvar("kz_cheatdetect","0")
kz_transparency = register_cvar("kz_transparency","1")

// Cmds
register_clcmd("say .kreedz","kz_menu")
register_clcmd("say /kreedz","kz_menu")
register_clcmd("say .menu","kz_menu")
register_clcmd("say /menu","kz_menu")

register_clcmd("cp","checkpoint")
register_clcmd("checkpoint","checkpoint")
register_clcmd("say .cp","checkpoint")
register_clcmd("say /cp","checkpoint")
register_clcmd("say .checkpoint","checkpoint")
register_clcmd("say /checkpoint","checkpoint")

register_clcmd("tp","goto_checkpoint")
register_clcmd("gocheck","goto_checkpoint")
register_clcmd("say","goto_checkpoint_say")

register_clcmd("stuck","goto_stuck")
register_clcmd("unstuck","goto_stuck")
register_clcmd("say .stuck","goto_stuck")
register_clcmd("say /stuck","goto_stuck")
register_clcmd("say .unstuck","goto_stuck")
register_clcmd("say /unstuck","goto_stuck")

register_clcmd("say .help","help")
register_clcmd("say /help","help")

register_clcmd("say .reset","reset_checkpoints")
register_clcmd("say /reset","reset_checkpoints")

register_clcmd("kz_unhelp","admin_unhelp",KZ_LEVEL)
register_clcmd("kz_showhelp","admin_showhelp",KZ_LEVEL)
register_clcmd("say .noclip","admin_noclip",KZ_LEVEL)
register_clcmd("say /noclip","admin_noclip",KZ_LEVEL)
register_clcmd("kz_laser","admin_laser",KZ_LEVEL,"[blue|yellow|green|red|orange]")

// Some other admincmds
register_clcmd("kz_noclip","admin_noclip",KZ_LEVEL,"<name|#userid|steamid|@ALL> <on/off>")
register_clcmd("kz_teleport","admin_teleport",KZ_LEVEL,"<name|#userid|steamid> <name|#userid|steamid>")
register_clcmd("kz_gravity","admin_gravity",KZ_LEVEL,"<name|#userid|steamid|@ALL> <gravity>")

register_clcmd("say .amenu","kz_menu_admin_show",ADMIN_CVAR)
register_clcmd("say /amenu","kz_menu_admin_show",ADMIN_CVAR)
register_clcmd("say .adminmenu","kz_menu_admin_show",ADMIN_CVAR)
register_clcmd("say /adminmenu","kz_menu_admin_show",ADMIN_CVAR)


register_clcmd("say .top10","topten_show")
register_clcmd("say /top10","topten_show")
register_clcmd("say .top15","topten_show")
register_clcmd("say /top15","topten_show")

// Events
register_event("DeathMsg","deathmsg","a")
register_event("ResetHUD","resethud","be")
//register_touch("player","func_button","button_touch") SUCKS!

// Menue
register_menu("ProKreedz by p4ddY",MENU_KEYS,"menu_handler")
register_menu("Adminmenu",MENU_KEYS_ADMIN,"menu_handler_admin")

set_task(0.1,"noblock_task",1000,"",0,"ab")
set_task(1.0,"timer_task",2000,"",0,"ab")

new kreedz_cfg[128], cfgdir[64]

get_configsdir(cfgdir,64)
format(kreedz_cfg,128,"%s/kreedz.cfg",cfgdir)

if(file_exists(kreedz_cfg)) {
server_exec()
server_cmd("exec %s",kreedz_cfg)
}
}
public plugin_precache() {
Sbeam = precache_model("sprites/laserbeam.spr")
}
// ============================================= ============================================= =======
// Global Functions
// ============================================= ============================================= =======

// IF YOU USE THIS FOR YOUR OWN PLUGIN, PLEASE CREDIT ME! thanks
public noblock_task() {
if(get_pcvar_num(kz_semiclip) > -1) {
new bool:solid[32]
new Float:origin[3]
new Float:vorigin[3]
for(new x=1;x<=get_maxplayers();x++) {
if(is_user_connected(x) && is_user_alive(x)) {
if(get_pcvar_num(kz_semiclip) == 1 || noblock[x-1]) {
entity_get_vector(x,EV_VEC_origin,origin)
for(new i=1;i<=get_maxplayers();i++) {
if(x != i && is_user_connected(i) && is_user_alive(i)) {
entity_get_vector(i,EV_VEC_origin,vorigin)
if(get_distance_f(origin,vorigin) <= NOBLOCK_DISTANCE) {
entity_set_int(x,EV_INT_solid,SOLID_NOT)
entity_set_int(i,EV_INT_solid,SOLID_NOT)

if(get_pcvar_num(kz_transparency) == 1) {
set_rendering(x,kRenderFxNone,255,255,255,kRe nderTransAdd,60)
set_rendering(i,kRenderFxNone,255,255,255,kRe nderTransAdd,60)
}

solid[x-1] = true
solid[i-1] = true
}
else if(!solid[i-1]) {
entity_set_int(i,EV_INT_solid,SOLID_BBOX)
glow(i)
}
}
}
}
else if(!solid[x-1]) {
entity_set_int(x,EV_INT_solid,SOLID_BBOX)
glow(x)
}
}
}
}
else {
for(new i=1;i<=get_maxplayers();i++) {
if(is_user_connected(i) && is_user_alive(i)) {
entity_set_int(i,EV_INT_solid,SOLID_BBOX)
glow(i)
}
}
}
}
// ============================================= ============================================= =======
public timer_task() {
for(new i=1;i<=get_maxplayers();i++) {
if(is_user_connected(i) && is_user_alive(i) && showtimer[i-1] && timer_started[i-1]) {
new kreedztime = get_systime() - timer_time[i-1], imin
if((kreedztime / 60.0) >= 1) {
imin = floatround(kreedztime / 60.0,floatround_floor)
kreedztime -= (floatround(kreedztime / 60.0,floatround_floor) * 60)
}
client_print(i,print_center,"[ %d minute%s %d second%s ]",imin,imin == 1 ? "" : "s",kreedztime,kreedztime == 1 ? "" : "s")
}
}
}
// ============================================= ============================================= =======
public glow(id) {
new colors[3]
if(needhelp[id-1] && get_pcvar_num(kz_help) == 1)
colors = {255,0,0}
else if(access(id,KZ_LEVEL) && get_pcvar_num(kz_adminglow) == 1)
colors = {170,255,0}
else
colors = {0,0,0}

set_rendering(id,kRenderFxGlowShell,colors[0],colors[1],colors[2],kRenderNormal,25)
}
// ============================================= ============================================= =======
public detect_cheat(id,reason[]) { // I saw this feature in kz_mulitplugin :o
if(timer_started[id-1] && get_pcvar_num(kz_cheatdetect) == 1) {
client_print(id,print_chat,"[ProKreedz] Detected %s - Timer terminated",reason)
timer_started[id-1] = false
}
}
// ============================================= ============================================= =======
// Cmds
// ============================================= ============================================= =======
public checkpoint(id) {
if(get_pcvar_num(kz_checkpoints) == 1) {
if(is_user_alive(id)) {
if(entity_get_int(id,EV_INT_flags)&FL_DUCKING) {
client_print(id,print_chat,"[ProKreedz] You can not create a checkpoint while ducking")
return PLUGIN_HANDLED
}

for(new i=MAX_CPS-1;i>0;i--) {
checkpoints[id-1][i][0] = checkpoints[id-1][i-1][0]
checkpoints[id-1][i][1] = checkpoints[id-1][i-1][1]
checkpoints[id-1][i][2] = checkpoints[id-1][i-1][2]
}
new Float:origin[3]
entity_get_vector(id,EV_VEC_origin,origin)
checkpoints[id-1][0][0] = origin[0]
checkpoints[id-1][0][1] = origin[1]
checkpoints[id-1][0][2] = origin[2]

if(checkpointnum[id-1] > 0)
client_print(id,print_chat,"[ProKreedz] Checkpoint no. %d created, distance to the previous one: %dm",checkpointnum[id-1]+1,floatround(get_distance_f(checkpoints[id-1][1],origin) / 20,floatround_round))
else
client_print(id,print_chat,"[ProKreedz] First checkpoint created")
checkpointnum[id-1]++
}
else
client_print(id,print_chat,"[ProKreedz] You have to be alive to use this function")
}
else
client_print(id,print_chat,"[ProKreedz] Checkpoints are disabled")

return PLUGIN_HANDLED
}
// ============================================= ============================================= =======
public goto_checkpoint(id) {
if(get_pcvar_num(kz_checkpoints) == 1) {
if(is_user_alive(id)) {
if(checkpointnum[id-1] > 0) {
if(read_argc() == 2) {
new szcp[8], cpnum
read_argv(1,szcp,8)
cpnum = str_to_num(szcp) - 1

if(cpnum >= 0 && cpnum < MAX_CPS) {
if(cpnum < checkpointnum[id-1])
goto_cp(id,cpnum)
else
client_print(id,print_chat,"[ProKreedz] You have not created enough checkpoints")
}
else
goto_cp(id,0)
}
else {
goto_cp(id,0)
}
}
else
client_print(id,print_chat,"[ProKreedz] First you have to create a checkpoint")
}
else
client_print(id,print_chat,"[ProKreedz] You must be alive to use this function")
}
else
client_print(id,print_chat,"[ProKreedz] Checkpoints are disabled")

return PLUGIN_HANDLED
}
public goto_checkpoint_say(id) {
if(read_argc() == 2) {
new szarg1[32], args1[16], args2[16]
read_argv(1,szarg1,32)
copyc(args1,16,szarg1,32)
copy(args2,16,szarg1[strlen(args1)+1])
if(equal(args1,".tp") || equal(args1,"/tp") || equal(args1,".gocheck") || equal(args1,"/gocheck")) {
if(get_pcvar_num(kz_checkpoints) == 1) {
if(is_user_alive(id)) {
if(checkpointnum[id-1] > 0) {
new cpnum = str_to_num(args2) - 1
if(cpnum >= 0 && cpnum < MAX_CPS) {
if(cpnum < checkpointnum[id-1])
goto_cp(id,cpnum)
else
client_print(id,print_chat,"[ProKreedz] You have not created enough checkpoints")
}
else
goto_cp(id,0)
}
else
client_print(id,print_chat,"[ProKreedz] First you have to create a checkpoint")
}
else
client_print(id,print_chat,"[ProKreedz] You have to be alive to use this function")
}
else
client_print(id,print_chat,"[ProKreedz] Checkpoints are disabled")

return PLUGIN_HANDLED
}
}

return PLUGIN_CONTINUE
}
public goto_stuck(id) {
if(get_pcvar_num(kz_checkpoints) == 1) {
if(is_user_alive(id)) {
if(checkpointnum[id-1] > 1)
goto_cp(id,1)
else
client_print(id,print_chat,"[ProKreedz] You have not created enough checkpoints")
}
else
client_print(id,print_chat,"[ProKreedz] You have to be alive to use this function")
}
else
client_print(id,print_chat,"[ProKreedz] Checkpoints are disabled")

return PLUGIN_HANDLED
}
// ============================================= ============================================= =======
public goto_cp(id,cp) {
new semiclip = get_pcvar_num(kz_semiclip)
if(semiclip == -1 || (!noblock[id-1] && semiclip == 0)) {
new Float:origin[3]
for(new i=1;i<=get_maxplayers();i++) {
if(id != i && is_user_connected(i) && is_user_alive(id)) {
if(semiclip == -1 || (!noblock[i-1] && semiclip == 0)) {
entity_get_vector(i,EV_VEC_origin,origin)
if(get_distance_f(checkpoints[id-1][cp],origin) <= CP_DISTANCE) {
client_print(id,print_chat,"[ProKreedz] Somebody is too close to your checkpoint")
return false
}
}
}
}
}

entity_set_origin(id,checkpoints[id-1][cp])
entity_set_vector(id,EV_VEC_velocity,Float:{0 .0,0.0,0.0})
spawnsprite(checkpoints[id-1][cp])
set_user_gravity(id) // to fix the low gravity bug on kz_man_redrock (thanks to NoEx)
noblock_task()

return true
}
// ============================================= ============================================= =======
public spawnsprite(Float:origin[3]) {
new iorigin[3]
iorigin[0] = floatround(origin[0],floatround_ceil)
iorigin[1] = floatround(origin[1],floatround_ceil)
iorigin[2] = floatround(origin[2],floatround_ceil)

message_begin(MSG_ALL,SVC_TEMPENTITY)
write_byte(11)
write_coord(iorigin[0])
write_coord(iorigin[1])
write_coord(iorigin[2])
message_end()
}
// ============================================= ============================================= =======
public reset_checkpoints(id) {
checkpointnum[id-1] = 0
timer_started[id-1] = false
client_print(id,print_chat,"[ProKreedz] Timer and checkpoints resetted")
return PLUGIN_HANDLED
}
// ============================================= ============================================= =======
public help(id) {
if(get_pcvar_num(kz_help) == 1) {
new name[32]
get_user_name(id,name,32)
if(needhelp[id-1]) {
needhelp[id-1] = false
client_print(0,print_chat,"[ProKreedz] %s does not need help anymore",name)
}
else {
needhelp[id-1] = true
helpcount[id-1]++
client_print(0,print_chat,"[ProKreedz] %s needs help",name)
client_print(id,print_chat,"[ProKreedz] Type '.help' again if you do not need help anymore",name)
}
}
glow(id)

return PLUGIN_HANDLED
}
// ============================================= ============================================= =======
// AdminCmds
// ============================================= ============================================= =======
public admin_unhelp(id,level,cid) {
new name[32]
get_user_name(id,name,32)

if(read_argc() == 2) {
if(!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED

new sztarget[32]
read_argv(1,sztarget,32)
if(equal(sztarget,"@ALL")) {
for(new i=1;i<=get_maxplayers();i++) {
if(is_user_connected(i)) {
if(needhelp[i-1]) {
needhelp[i-1] = false
client_print(i,print_chat,"[ProKreedz] Admin %s has helped you",name)
}
glow(i)
}
}
}
else {
new target = cmd_target(id,sztarget,2)
if(target > 0) {
if(needhelp[target-1]) {
needhelp[target-1] = false
client_print(target,print_chat,"[ProKreedz] Admin %s has helped you",name)
}
glow(target)

}
}
}
else {
if(!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED

new aimid, body
get_user_aiming(id,aimid,body)
if(aimid > 0 && aimid < 33) {
needhelp[aimid-1] = false
glow(aimid)
client_print(aimid,print_chat,"[ProKreedz] Admin %s has helped you",name)
}
}

return PLUGIN_HANDLED
}
// ============================================= ============================================= =======
public admin_showhelp(id,level,cid) {
if(!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED

for(new i=1;i<=get_maxplayers();i++) {
if(is_user_connected(i) && is_user_alive(i) && needhelp[i-1]) {
message_begin(MSG_ONE,SVC_TEMPENTITY,{0,0,0}, id)
write_byte(8) // TE_BEAMENTS
write_short(id) // start entity
write_short(i) // end entity
write_short(Sbeam) // sprite to draw (precached below)
write_byte(0) // starting frame
write_byte(0) // frame rate
write_byte(100) // life in 0.1s
write_byte(3) // line width in 0.1u
write_byte(0) // noise in 0.1u
write_byte(255) // R
write_byte(0) // G
write_byte(0) // B
write_byte(200) // brightness
write_byte(2) // scroll speed
message_end()
}
}

return PLUGIN_HANDLED
}
// ============================================= ============================================= =======
public admin_noclip(id,level,cid) {
if(read_argc() == 1 || read_argc() == 2) {
if(!cmd_access(id,level,cid,1)) {
set_user_noclip(id,0)
return PLUGIN_HANDLED
}

set_user_noclip(id,get_user_noclip(id) == 1 ? 0 : 1)
if(get_user_noclip(id) == 1)
detect_cheat(id,"Noclip")
}
else if(read_argc() == 3) {
if(!cmd_access(id,level,cid,3))
return PLUGIN_HANDLED

new name[32]
get_user_name(id,name,32)

new szarg1[32], szarg2[8], bool:mode
read_argv(1,szarg1,32)
read_argv(2,szarg2,32)
if(equal(szarg2,"on"))
mode = true

if(equal(szarg1,"@ALL")) {
for(new i=1;i<=get_maxplayers();i++) {
if(is_user_connected(i) && is_user_alive(i)) {
set_user_noclip(i,mode ? 1 : 0)
client_print(i,print_chat,"[ProKreedz] Admin %s %s noclip",name,mode ? "gave you" : "removed your")
client_print(i,print_chat,"[ProKreedz] Type '.noclip' to remove it")
if(mode)
detect_cheat(i,"Noclip")
}
}
}
else {
new pid = cmd_target(id,szarg1,2)
if(pid > 0 && is_user_alive(pid)) {
set_user_noclip(pid,mode ? 1 : 0)
client_print(pid,print_chat,"[ProKreedz] Admin %s %s noclip",name,mode ? "gave you" : "removed your")
client_print(pid,print_chat,"[ProKreedz] Type '.noclip' to remove it")
if(mode)
detect_cheat(pid,"Noclip")
}
}
}

return PLUGIN_HANDLED
}
// ============================================= ============================================= =======
public admin_teleport(id,level,cid) {
new name[32]
get_user_name(id,name,32)

if(read_argc() == 3) {
if(!cmd_access(id,level,cid,3))
return PLUGIN_HANDLED

new szarg1[32], szarg2[32]
read_argv(1,szarg1,32)
read_argv(2,szarg2,32)

new id1 = cmd_target(0,szarg1,1&4), id2 = cmd_target(0,szarg2,4)
if(id1 > 0 && id2 > 0) {
new targetname[32]
get_user_name(id2,targetname,32)

if(entity_get_int(id2,EV_INT_flags)&FL_DUCKING)
client_print(id,print_console,"%s is ducking. Can not teleport",targetname)
else {
new Float:origin[3]
entity_get_vector(id2,EV_VEC_origin,origin)
entity_set_origin(id1,origin)

client_print(id1,print_chat,"[ProKreedz] Admin %s has teleported you to %s",name,targetname)
detect_cheat(id1,"Teleport")
}
}
}
else {
if(!cmd_access(id,level,cid,5))
return PLUGIN_HANDLED

new szarg1[32]
read_argv(1,szarg1,32)

new target = cmd_target(0,szarg1,1&4)
if(target > 0) {
new szargx[8], szargy[8], szargz[8]
read_argv(2,szargx,8)
read_argv(3,szargy,8)
read_argv(4,szargz,8)

new Float:origin[3]
origin[0] = str_to_float(szargx)
origin[1] = str_to_float(szargy)
origin[2] = str_to_float(szargz)

entity_set_origin(target,origin)
client_print(target,print_chat,"[ProKreedz] Admin %s has teleported you",name)
detect_cheat(target,"Teleport")
}
}

return PLUGIN_HANDLED
}
// ============================================= ============================================= =======
public admin_gravity(id,level,cid) {
if(!cmd_access(id,level,cid,3))
return PLUGIN_HANDLED

new name[32]
get_user_name(id,name,32)

new szarg1[32], szarg2[8], gravity, Float:fgravity
read_argv(1,szarg1,32)
read_argv(2,szarg2,8)
gravity = str_to_num(szarg2)
fgravity = gravity / float(get_cvar_num("sv_gravity"))

if(equal(szarg1,"@ALL")) {
for(new i=1;i<=get_maxplayers();i++) {
if(is_user_connected(i)) {
set_user_gravity(i,fgravity)
client_print(i,print_chat,"[ProKreedz] Admin %s has set your gravity to %d",name,gravity)
if(fgravity != 1.0)
detect_cheat(i,"Gravity")
}
}
}
else {
new target = cmd_target(0,szarg1,2)
if(target > 0) {
set_user_gravity(target,fgravity)
client_print(target,print_chat,"[ProKreedz] Admin %s has set your gravity to %d",name,gravity)
if(fgravity != 1.0)
detect_cheat(target,"Gravity")
}
}

return PLUGIN_HANDLED
}
// ============================================= ============================================= =======
public admin_laser(id,level,cid) {
if(!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED

new colors[3]
if(read_argc() > 1) {
new szcolor[8]
read_argv(1,szcolor,8)
if(equal(szcolor,"red"))
colors = {255,0,0}
else if(equal(szcolor,"blue"))
colors = {0,0,255}
else if(equal(szcolor,"yellow"))
colors = {255,255,0}
else if(equal(szcolor,"orange"))
colors = {255,150,0}
else if(equal(szcolor,"green"))
colors = {0,255,0}
else
colors = {255,255,255}
}
else
colors = {255,255,255}

new origin[3], aimorigin[3]
get_user_origin(id,origin)
get_user_origin(id,aimorigin,3)
message_begin(MSG_ALL,SVC_TEMPENTITY)
write_byte(0) // TE_BEAMPOINTS
write_coord(origin[0]) // start point
write_coord(origin[1])
write_coord(origin[2])
write_coord(aimorigin[0]) // end point
write_coord(aimorigin[1])
write_coord(aimorigin[2])
write_short(Sbeam) // sprite to draw (precached below)
write_byte(0) // starting frame
write_byte(0) // frame rate
write_byte(100) // life in 0.1s
write_byte(3) // line width in 0.1u
write_byte(0) // noise in 0.1u
write_byte(colors[0]) // R
write_byte(colors[1]) // G
write_byte(colors[2]) // B
write_byte(200) // brightness
write_byte(2) // scroll speed
message_end()

return PLUGIN_HANDLED
}
// ============================================= ============================================= =======
// Events / Forwards
// ============================================= ============================================= =======
public resethud(id) {
if(get_pcvar_num(kz_godmode) == 1)
set_user_godmode(id,1)
else
set_user_godmode(id)

if(get_pcvar_num(kz_scout) == 1 && !user_has_weapon(id,CSW_SCOUT))
give_item(id,"weapon_scout")
if(!user_has_weapon(id,CSW_KNIFE))
give_item(id,"weapon_knife")

glow(id)

cs_set_user_nvg(id)

if(firstspawn[id-1]) {
client_print(id,print_chat,"[ProKreedz] Type '.menu' to open the menu")
if(get_pcvar_num(kz_checkpoints) == 1)
client_print(id,print_chat,"[ProKreedz] Type '.cp' to create a checkpoint and '.tp' to go to your last one")
else
client_print(id,print_chat,"[ProKreedz] Checkpoints are disabled")
}
firstspawn[id-1] = false
}
// ============================================= ============================================= =======
public client_disconnect(id) {
checkpointnum[id-1] = 0
needhelp[id-1] = false
helpcount[id-1] = 0

timer_started[id-1] = false
showtimer[id-1] = false

usedbutton[id-1] = false
firstspawn[id-1] = true

bhop[id-1] = 0

noblock[id-1] = true
}
public client_putinserver(id) {
checkpointnum[id-1] = 0
needhelp[id-1] = false
helpcount[id-1] = 0

timer_started[id-1] = false
showtimer[id-1] = false

usedbutton[id-1] = false
firstspawn[id-1] = true

bhop[id-1] = 0

noblock[id-1] = true
}
// ============================================= ============================================= =======
// Menu
// ============================================= ============================================= =======
public kz_menu(id) {
new menu[512], szbhop[64], sznoblock[64]

if(get_pcvar_num(kz_semiclip) == -1)
format(sznoblock,64,"\r01. Semiclip disabled by server\w")
else if(get_pcvar_num(kz_semiclip) == 1)
format(sznoblock,64,"\r01. Semiclip enabled by server\w")
else {
if(noblock[id-1])
format(sznoblock,64,"\w01. Semiclip\w")
else
format(sznoblock,64,"\d01. Semiclip\w")
}
// muh
if(get_pcvar_num(kz_bhop) == 0)
format(szbhop,64,"\r03. Bhop disabled by server\w")
else if(get_pcvar_num(kz_bhop) == 1) {
if(bhop[id-1] == 0)
format(szbhop,64,"\d03. Bhop\w")
else
format(szbhop,64,"\w03. Bhop - No Slowdown\w")
}
else if(get_pcvar_num(kz_bhop) == 2) {
if(bhop[id-1] == 2)
format(szbhop,64,"\w03. Bhop - Autojump\w")
else if(bhop[id-1] == 1)
format(szbhop,64,"\w03. Bhop - No Slowdown\w")
else
format(szbhop,64,"\d03. Bhop\w")
}

format(menu,512,"^n^n^n\yProKreedz by p4ddY^n^n%s^n%s^n%s^n^n04. Reset^n^n00. Close",sznoblock,showtimer[id-1] ? "\w02. Show Timer" : "\d02. Show Timer\w",szbhop)
show_menu(id,MENU_KEYS,menu)
}
public menu_handler(id,key) {
switch(key) {
case 0:{
if(get_pcvar_num(kz_semiclip) != -1 && get_pcvar_num(kz_semiclip) != 1)
noblock[id-1] = (noblock[id-1] == false)

kz_menu(id)
}
case 1:{
showtimer[id-1] = (showtimer[id-1] == false)
kz_menu(id)
}
case 2:{
if(get_pcvar_num(kz_bhop) == 1) {
if(bhop[id-1] == 0)
bhop[id-1] = 1
else
bhop[id-1] = 0
}
else if(get_pcvar_num(kz_bhop) == 2) {
if(bhop[id-1] == 0)
bhop[id-1] = 1
else if(bhop[id-1] == 1)
bhop[id-1] = 2
else
bhop[id-1] = 0
}
kz_menu(id)
}
case 4:{
reset_checkpoints(id)
}
case 9:{
show_menu(id,0,"")
}
}
}
// ============================================= ============================================= =======
public kz_menu_admin_show(id,level,cid) {
if(!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED

kz_menu_admin(id)

return PLUGIN_HANDLED
}
public kz_menu_admin(id) {
new menu[512], szcheckpoints[32], szgodmode[32], szhelp[32], szscout[32], szadminglow[32], sznoblock[32], sztransparency[32], szcheatdetect[32], szbhop[32]
// this is the onliest fucking way.. else pawn tells me that the line is too long :o

if(get_pcvar_num(kz_checkpoints) == 1)
format(szcheckpoints,32,"\w01. Checkpoints\w")
else
format(szcheckpoints,32,"\r01. Checkpoints\w")

if(get_pcvar_num(kz_godmode) == 1)
format(szgodmode,32,"\w02. Godmode\w")
else
format(szgodmode,32,"\r02. Godmode\w")

if(get_pcvar_num(kz_help) == 1)
format(szhelp,32,"\w03. Help\w")
else
format(szhelp,32,"\r03. Help\w")

if(get_pcvar_num(kz_scout) == 1)
format(szscout,32,"\w04. Scout\w")
else
format(szscout,32,"\r04. Scout\w")

if(get_pcvar_num(kz_adminglow) == 1)
format(szadminglow,32,"\w05. Adminglow\w")
else
format(szadminglow,32,"\r05. Adminglow\w")

if(get_pcvar_num(kz_semiclip) == -1)
format(sznoblock,32,"\r06. Semiclip\w")
else if(get_pcvar_num(kz_semiclip) == 1)
format(sznoblock,32,"\w06. Semiclip\w")
else
format(sznoblock,32,"\w06. Semiclip - Client\w")

if(get_pcvar_num(kz_bhop) == 0)
format(szbhop,32,"\r07. Bhop\w")
else if(get_pcvar_num(kz_bhop) == 1)
format(szbhop,32,"\w07. Bhop - No Slowdown\w")
else if(get_pcvar_num(kz_bhop) == 2)
format(szbhop,32,"\w07. Bhop - Autojump\w")

if(get_pcvar_num(kz_transparency) == 1)
format(sztransparency,32,"\w08. Transparency\w")
else
format(sztransparency,32,"\r08. Transparency\w")

if(get_pcvar_num(kz_cheatdetect) == 1)
format(szcheatdetect,32,"\w09. Cheatdetect\w")
else
format(szcheatdetect,32,"\r09. Cheatdetect\w")

format(menu,512,"^n^n^n\yProKreedz by p4ddY - Adminmenu^n^n%s^n%s^n%s^n%s^n%s^n%s^n%s^n%s^n %s^n^n00. Close",szcheckpoints,szgodmode,szhelp,szscout,szadm inglow,sznoblock,szbhop,sztransparency,szchea tdetect)
show_menu(id,MENU_KEYS_ADMIN,menu)
}
public menu_handler_admin(id,key) {
switch(key) {
case 0:{
if(get_cvar_num("kz_checkpoints") == 0) {
set_cvar_num("kz_checkpoints",1)
client_print(0,print_chat,"[ProKreedz] Checkpoints are enabled now")
client_print(0,print_chat,"[ProKreedz] Type '.cp' to create a checkpoint and '.tp' to go to your last one")
}
else {
set_cvar_num("kz_checkpoints",0)
client_print(0,print_chat,"[ProKreedz] Checkpoints are disabled now")
}
kz_menu_admin(id)
}
case 1:{
if(get_cvar_num("kz_godmode") == 0) {
set_cvar_num("kz_godmode",1)
client_print(0,print_chat,"[ProKreedz] Godmode is enabled now")

for(new i=1;i<=get_maxplayers();i++) {
if(is_user_connected(i))
set_user_godmode(id,1)
}
}
else {
set_cvar_num("kz_godmode",0)
client_print(0,print_chat,"[ProKreedz] Godmode is disabled now")

for(new i=1;i<=get_maxplayers();i++) {
if(is_user_connected(i))
set_user_godmode(id,0)
}
}
kz_menu_admin(id)
}
case 2:{
if(get_cvar_num("kz_help") == 0) {
set_cvar_num("kz_help",1)
client_print(0,print_chat,"[ProKreedz] Backup is enabled now")
client_print(0,print_chat,"[ProKreedz] Type '.help' if you need help")
for(new i=1;i<=get_maxplayers();i++) {
if(is_user_connected(i))
glow(i)
}
}
else {
set_cvar_num("kz_help",0)
client_print(0,print_chat,"[ProKreedz] Backup is disabled now")
for(new i=1;i<=get_maxplayers();i++) {
if(is_user_connected(i))
glow(i)
}
}
kz_menu_admin(id)
}
case 3:{
if(get_cvar_num("kz_scout") == 0) {
set_cvar_num("kz_scout",1)
client_print(0,print_chat,"[ProKreedz] You will get a scout after respawn")
}
else {
set_cvar_num("kz_scout",0)
client_print(0,print_chat,"[ProKreedz] You will no longer get a scout")
}
kz_menu_admin(id)
}
case 4:{
if(get_cvar_num("kz_adminglow") == 0) {
set_cvar_num("kz_adminglow",1)
client_print(0,print_chat,"[ProKreedz] Admins glow green now")

for(new i=1;i<=get_maxplayers();i++) {
if(is_user_connected(i))
glow(i)
}
}
else {
set_cvar_num("kz_adminglow",0)
client_print(0,print_chat,"[ProKreedz] Admins are no longer glowing")

for(new i=1;i<=get_maxplayers();i++) {
if(is_user_connected(i))
glow(i)
}
}
kz_menu_admin(id)
}
case 5:{
if(get_cvar_num("kz_semiclip") == -1) {
set_cvar_num("kz_semiclip",0)
client_print(0,print_chat,"[ProKreedz] Semiclip is enabled now. Type '.menu' to enable/disable it")
}
else if(get_cvar_num("kz_semiclip") == 0) {
set_cvar_num("kz_semiclip",1)
client_print(0,print_chat,"[ProKreedz] Semiclip is enabled now")
}
else {
set_cvar_num("kz_semiclip",-1)
client_print(0,print_chat,"[ProKreedz] Semiclip is disabled now")
}
kz_menu_admin(id)
}
case 6:{
if(get_cvar_num("kz_bhop") == 0) {
set_cvar_num("kz_bhop",1)
client_print(0,print_chat,"[ProKreedz] Bhop (No Slowdown) is enabled now")
}
else if(get_cvar_num("kz_bhop") == 1) {
set_cvar_num("kz_bhop",2)
client_print(0,print_chat,"[ProKreedz] Bhop (Autojump) is enabled now")
}
else {
set_cvar_num("kz_bhop",0)
client_print(0,print_chat,"[ProKreedz] Bhop is disabled now")
}
kz_menu_admin(id)
}
case 7:{
if(get_cvar_num("kz_transparency") == 0) {
set_cvar_num("kz_transparency",1)
client_print(0,print_chat,"[ProKreedz] If someone activates semiclip he will be transparent")
}
else {
set_cvar_num("kz_transparency",0)
client_print(0,print_chat,"[ProKreedz] If someone activates semiclip he won't appear transparent any longer")
}
kz_menu_admin(id)
}
case 8:{
if(get_cvar_num("kz_cheatdetect") == 0) {
set_cvar_num("kz_cheatdetect",1)
client_print(0,print_chat,"[ProKreedz] Anti-Cheat is enabled now")
}
else {
set_cvar_num("kz_cheatdetect",0)
client_print(0,print_chat,"[ProKreedz] Anti-Cheat is disabled now")
}
kz_menu_admin(id)
}
case 9:{
show_menu(id,0,"")
}
}
}
// ============================================= ============================================= =======
// Timersystem
// ============================================= ============================================= =======
public client_PreThink(id) {
if(get_pcvar_num(kz_bhop) > 0 && bhop[id-1] > 0)
entity_set_float(id,EV_FL_fuser2,0.0)

new buttons = get_user_button(id)

if(get_pcvar_num(kz_bhop) == 2 && bhop[id-1] == 2) {
if(buttons&IN_JUMP) { // Credits to ts2do (cs13 plugin)
new flags = entity_get_int(id,EV_INT_flags)
if(flags&FL_ONGROUND && flags|FL_WATERJUMP && entity_get_int(id,EV_INT_waterlevel)<2) {
new Float:velocity[3]
entity_get_vector(id,EV_VEC_velocity,velocity )
velocity[2] += 260.0
entity_set_vector(id,EV_VEC_velocity,velocity )
entity_set_int(id,EV_INT_gaitsequence,6) // Play the Jump Animation
}
}
}

if(buttons&IN_USE) {
if(!usedbutton[id-1]) {
new aimid, body
if(get_user_aiming(id,aimid,body) != 0.0) {
new Float:origin[3]
entity_get_vector(id,EV_VEC_origin,origin)
if(find_ent_in_sphere(aimid-1,origin,BUTTON_DISTANCE) == aimid) { // This sucks, but i was not able, to get EV_VEC_origin of the button
new entname[32]
entity_get_string(aimid,EV_SZ_target,entname, 32)
//client_print(id,print_chat,"[Debug] Entityname: %s",entname)
if((equal(entname,"counter_start") || equal(entname,"clockstartbutton") || equal(entname,"firsttimerelay")) && !timer_started[id-1]) { // Man hat den Startbutton gedrueckt
if(checkpointnum[id-1] < 1) {
new bool:clean = true
if(get_pcvar_num(kz_cheatdetect) == 1) {
if(get_user_noclip(id) == 1) {
client_print(id,print_chat,"[ProKreedz] You can not start the timer because of noclip")
clean = false
}
else if(get_user_gravity(id) != 1.0) {
client_print(id,print_chat,"[ProKreedz] You can not start the timer because of gravity")
clean = false
}
else { // Now we check, whether the client uses hook or is grabbed :o
if(callfunc_begin("is_hooked","prokreedz_hook.amxx") == 1) {
callfunc_push_int(id)
if(callfunc_end()) {
clean = false
client_print(id,print_chat,"[ProKreedz] You can not start the timer because of hook")
}
}
else if(callfunc_begin("is_user_grabbed","prokreedz_grab.amxx") == 1) { // maybe it doesn't work Oo
callfunc_push_int(id)
if(callfunc_end() != -1) {
clean = false
client_print(id,print_chat,"[ProKreedz] You can not start the timer because of grab")
}
}
}
}
if(clean) {
client_print(id,print_chat,"[ProKreedz] Timer started, let's go :)")
timer_started[id-1] = true
timer_time[id-1] = get_systime()
}
}
else {
client_print(id,print_chat,"[ProKreedz] You already created checkpoints. Type '.reset' to reset them")
}
}
if((equal(entname,"counter_off") || equal(entname,"clockstopbutton") || equal(entname,"clockstop")) && timer_started[id-1]) { // Man hat den Stopbutton gedrueckt
new name[32], imin
get_user_name(id,name,32)
//format_time(sztime,16,"%M:%S",get_systime() - timer_time[id-1]) this sucks!
new kreedztime = get_systime() - timer_time[id-1]
if((kreedztime / 60.0) >= 1) {
imin = floatround(kreedztime / 60.0,floatround_floor)
kreedztime -= (floatround(kreedztime / 60.0,floatround_floor) * 60)
}

client_print(0,print_chat,"[ProKreedz] %s has been reached the target in %d minutes and %d seconds with %d checkpoint%s.",name,imin,kreedztime,checkpointnum[id-1],checkpointnum[id-1] == 1 ? "" : "s") // kreedztime ist in diesem Fall die uebrigen Sekunden
timer_started[id-1] = false
topten_update(id)
}
}
}
usedbutton[id-1] = true
}
}
else
usedbutton[id-1] = false
}
// ============================================= ============================================= =======
// Top10
// ============================================= ============================================= =======
public topten_update(id) {
new szvault[64], szmap[32], kreedztime
get_mapname(szmap,32)
format(szvault,64,"pk_%s",szmap)
kreedztime = get_systime() - timer_time[id-1]

new vault = nvault_open(szvault) // Now we have to sort the new list :o
if(vault != -1) {
new szkey[8]
for(new i=1;i<=10;i++) {
new szreturn[128]
new arg1[32], arg2[8]
format(szkey,8,"%d",i)
nvault_get(vault,szkey,szreturn,128)

if(parse(szreturn,arg1,32,arg2,8) == 0 || kreedztime < str_to_num(arg2)) {
new sznew[128], szname[32]
get_user_name(id,szname,32)
format(sznew,128,"^"%s^" ^"%d^" ^"%d^"",szname,kreedztime,checkpointnum[id-1])
if(i < 10) {
for(new x=10;x>i;x--) {
new sztemp[128], sztempkey[8]
format(sztempkey,8,"%d",x-1)
nvault_get(vault,sztempkey,sztemp,128)

if(!equal(sztemp,"")) {
format(sztempkey,8,"%d",x)
nvault_pset(vault,sztempkey,sztemp)
}
}
}
nvault_pset(vault,szkey,sznew)

if(i == 1)
client_print(0,print_chat,"[ProKreedz] %s has established a new record",szname)

break
}
}
nvault_close(vault)
}
}
public topten_show(id) {
new motd[2048]
new szvault[64], szmap[32]
get_mapname(szmap,32)
format(szvault,64,"pk_%s",szmap)

new vault = nvault_open(szvault)
if(vault != -1) {
add(motd,2048,"<html><head><style>")
add(motd,2048,"body { background-color:#000000; font-family:Tahoma; font-size:10px; color:#FFFFFF; }")
add(motd,2048,".tabel { border-style:solid; border-width:1px; border-color:#FFFFFF; font-family:Tahoma; font-size:10px; color:#FFFFFF; }")
add(motd,2048,".header { background-color:#292929; font-family:Tahoma; font-size:10px; color:#FFFFFF; font-weight:800; }")
add(motd,2048,"</style></head><body>")
add(motd,2048,"<br><br><table border=0 cellspacing=0 cellpadding=1 width=90% align=center class=tabel>")

add(motd,2048,"<tr><td class=header>#</td><td class=header>Name</td><td class=header>Time</td><td class=header>Checkpoints</td></tr>")
new szkey[8]
for(new i=1;i<=10;i++) {
new szreturn[128]
format(szkey,8,"%d",i)
nvault_get(vault,szkey,szreturn,128)

new arg1[32], arg2[8], arg3[8]
if(parse(szreturn,arg1,32,arg2,8,arg3,8) != 0) {
new sztime[32]
new imin, kreedztime = str_to_num(arg2)
if((kreedztime / 60.0) >= 1) {
imin = floatround(kreedztime / 60.0,floatround_floor)
kreedztime -= (floatround(kreedztime / 60.0,floatround_floor) * 60)
}
format(sztime,32,"%d minutes and %d seconds",imin,kreedztime)
add(motd,2048,"<tr><td>")
add(motd,2048,szkey)
add(motd,2048,"</td><td>")
add(motd,2048,arg1)
add(motd,2048,"</td><td>")
add(motd,2048,sztime)
add(motd,2048,"</td><td>")
add(motd,2048,arg3)
add(motd,2048,"</td></tr>")
}
}

nvault_close(vault)

add(motd,2048,"</table></body></html>")
show_motd(id,motd,"ProKreedz Top10")
}
}
// You reached the end of file
// This plugin was made by p4ddY :)


Espero que me ayuden

PD: Yo intente sacar todo lo que no me sirve de este Plugin el problema es que despues al compilar tira error por todos lados y no entiendo mucho. Por eso quiero que lo vean ustedes y ver si pueden hacer lo mismo que quice hacer yo o crear 1 nuevo :)


gracias

salu2

tony256
07-14-2009, 08:39
mira amigo aca te dejo el plug de coderiz es un semiclip simple los vez transparentes a tus teammates
suerte :)