Trying to kill the smoke puff, obviously what i'm doing now won't work..
Code:
#include <amxmodx>
#include <amxmisc>
public plugin_init()
{
register_plugin("TS Message Experimentation","0.1","DahVid")
register_clcmd("puff","puff")
register_clcmd("pass","pass")
}
new blunt=0
new bool:puffy=false
new kill=0
new smoke
public plugin_precache()
{
precache_sound("player/breathe1.wav")
precache_sound("scientist/yees.wav")
smoke=precache_model("sprites/smoke.spr")
}
public puff(id)
{
if(is_user_connected(id) && is_user_alive(id)) {
if(puffy==false) {
client_print(id,print_chat,"WTF U SMOKIN IT NOW FAGGOTASS MOTHAFUCKA NIGGAAA!")
}
puffy=true
client_print(id,print_chat,"You have the blunt, type in console pass <UserName> to pass it!")
emit_sound(0,1,"player/breathe1.wav",1.0,ATTN_NORM,0,PITCH_NORM)
set_task(0.1,"message",id,_,_,"b")
if(blunt==0) {
return PLUGIN_HANDLED
}
kill=1
set_task(20.0,"killpuff")
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
public pass(id)
{
if(blunt==0) {
client_print(id,print_chat,"WTF YOU AINT GOT NO CHEEBAH BITCH")
return PLUGIN_HANDLED
}
killpuff(id)
blunt=0
kill=0
puffy=false
new targname[33]
read_argv(1,targname,32)
new target=cmd_target(id,targname,9)
if(strlen(targname) < 1) {
client_print(id,print_console,"WTF TELL ME WHICH BRUTHA TO PASS IT TO BIZITCH!")
return PLUGIN_HANDLED
}
if(strlen(targname) > 12) {
client_print(id,print_console,"YO HE GOT A FUCKED UP NAME YOOO!!")
}
client_print(id,print_chat,"Yo, thanks fo passin brotha %s da cheebuh.",target)
emit_sound(0,1,"scientist/yees.wav",1.0,ATTN_NORM,0,PITCH_NORM)
set_task(0.1,"puff",target,_,_,"b")
return PLUGIN_CONTINUE
}
public message(id)
{
new beginorigin[3]
get_user_origin(id,beginorigin,1)
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(5)
write_coord(beginorigin[0])
write_coord(beginorigin[1])
write_coord(beginorigin[2])
write_short(smoke)
write_byte(10)
write_byte(30)
message_end()
}
public killpuff(id)
{
puffy=false
if(kill==1) {
client_print(id,print_chat,"BITCH YOU DUN SMOKE DAT WHOLE CHEEBAH!!")
}
new beginorigin[3]
get_user_origin(id,beginorigin,1)
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(5)
write_coord(beginorigin[0])
write_coord(beginorigin[1])
write_coord(beginorigin[2])
write_short(1)
write_byte(10)
write_byte(30)
message_end()
}