AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Sleep Mod Editing. (https://forums.alliedmods.net/showthread.php?t=22448)

[SMC]Neiko 12-27-2005 02:43

Sleep Mod Editing.
 
Yea, I'm trying to change the sounds that the sleeper outputs while sleeping.

Sleep mod link

Ok, this was the original
Quote:

Originally Posted by Original
/* AMXMOD X script.
*
* Scripted by GHW.Chronic
*
* v1.0 - Initial Release
*
*/

#include <amxmodx>
#include <amxmisc>
#include <fun>

new bool:asleep[33]

public plugin_init()
{
register_plugin("SleepMOD","1.0","GHW_Chronic ")
register_clcmd("say /sleep","bsleep")
register_clcmd("say /wakeup","wakeup")
set_task(20.0,"advertise",0,"",0,"b")
}

public plugin_precache()
{
precache_sound("sleep.wav")
precache_sound("bagyawn.wav")
}

public client_connect(id)
{
asleep[id]=false
}

public client_disconnect(id)
{
asleep[id]=false
}

public wakeup(id)
{
if(!asleep[id])
{
client_print(id,print_chat,"You Are Already Awake")
}
else
{
asleep[id]=false
}
return PLUGIN_HANDLED
}

public bsleep(id)
{
if(asleep[id])
{
client_print(id,print_chat,"You Are Already Asleep")
return PLUGIN_HANDLED
}
if(!is_user_alive(id))
{
client_print(id,print_chat," You Cannot Sleep While Dead / In Spec ")
return PLUGIN_HANDLED
}
asleep[id]=true
set_task(0.1,"fadeout",id)
client_print(id,print_center," * You Begin to fall asleep * ^n")
client_print(id,print_chat,"Type /wakeup to wakeup.")
emit_sound(id, CHAN_VOICE, "sleep.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
return PLUGIN_HANDLED
}

public fadeout(id)
{
if(!asleep[id])
{
set_user_rendering(id,kRenderFxNone,0,0,0,kRe nderNormal,0)
set_user_maxspeed(id, 320.0)
emit_sound(id, CHAN_VOICE, "bagyawn.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
client_print(id,print_center,"Time To Wake Up")
client_cmd(id,"-duck")
message_begin(MSG_ONE,get_user_msgid("ScreenF ade"),{0,0,0},id);
write_short(~0);
write_short(~0);
write_short(1<<12);
write_byte(0);
write_byte(0);
write_byte(0);
write_byte(0);
message_end();
return PLUGIN_HANDLED
}
if(!is_user_alive(id))
{
asleep[id]=false
set_task(1.0,"fadeout",id)
return PLUGIN_HANDLED

}
new health = get_user_health(id)
if(health>=150)
{
asleep[id]=false
set_task(1.0,"fadeout",id)
return PLUGIN_HANDLED
}
client_cmd(id,"+duck")
set_user_rendering(id,kRenderFxGlowShell,0,25 5,0,kRenderTransAlpha,25)
message_begin(MSG_ONE,get_user_msgid("ScreenF ade"),{0,0,0},id);
write_short(~0);
write_short(~0);
write_short(1<<12);
write_byte(0);
write_byte(0);
write_byte(0);
write_byte(255);
message_end();
set_user_maxspeed(id, 1.0)
new newhealth = health + 1
set_user_health(id,newhealth)
set_task(1.0,"fadeout",id)
return PLUGIN_HANDLED
}

public advertise()
{
client_print(0,print_chat,"Type /Sleep To Sleep And Regain Health.")
return PLUGIN_HANDLED
}

And this is what my changed one. But it dosen't seem to work.
Quote:

Originally Posted by Modified
/* AMXMOD X script.
*
* Scripted by GHW.Chronic
*
* v1.0 - Initial Release
*
*/

#include <amxmodx>
#include <amxmisc>
#include <fun>

new bool:asleep[33]

public plugin_init()
{
register_plugin("SleepMOD","1.0","GHW_Chronic ")
register_clcmd("say /sleep","bsleep")
register_clcmd("say /wakeup","wakeup")
set_task(20.0,"advertise",0,"",0,"b")
}

public plugin_precache()
{
precache_sound("bubbly.wav")
precache_sound("burp2.wav")
}

public client_connect(id)
{
asleep[id]=false
}

public client_disconnect(id)
{
asleep[id]=false
}

public wakeup(id)
{
if(!asleep[id])
{
client_print(id,print_chat,"You Are Already Awake")
}
else
{
asleep[id]=false
}
return PLUGIN_HANDLED
}

public bsleep(id)
{
if(asleep[id])
{
client_print(id,print_chat,"You Are Already Asleep")
return PLUGIN_HANDLED
}
if(!is_user_alive(id))
{
client_print(id,print_chat," You Cannot Sleep While Dead / In Spec ")
return PLUGIN_HANDLED
}
asleep[id]=true
set_task(0.1,"fadeout",id)
client_print(id,print_center," * You Begin to fall asleep * ^n")
client_print(id,print_chat,"Type /wakeup to wakeup.")
emit_sound(id, CHAN_VOICE, "bubbly.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
return PLUGIN_HANDLED
}

public fadeout(id)
{
if(!asleep[id])
{
set_user_rendering(id,kRenderFxNone,0,0,0,kRe nderNormal,0)
set_user_maxspeed(id, 320.0)
emit_sound(id, CHAN_VOICE, "burp2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
client_print(id,print_center,"Time To Wake Up")
client_cmd(id,"-duck")
message_begin(MSG_ONE,get_user_msgid("ScreenF ade"),{0,0,0},id);
write_short(~0);
write_short(~0);
write_short(1<<12);
write_byte(0);
write_byte(0);
write_byte(0);
write_byte(0);
message_end();
return PLUGIN_HANDLED
}
if(!is_user_alive(id))
{
asleep[id]=false
set_task(1.0,"fadeout",id)
return PLUGIN_HANDLED

}
new health = get_user_health(id)
if(health>=150)
{
asleep[id]=false
set_task(1.0,"fadeout",id)
return PLUGIN_HANDLED
}
client_cmd(id,"+duck")
set_user_rendering(id,kRenderFxGlowShell,0,25 5,0,kRenderTransAlpha,25)
message_begin(MSG_ONE,get_user_msgid("ScreenF ade"),{0,0,0},id);
write_short(~0);
write_short(~0);
write_short(1<<12);
write_byte(0);
write_byte(0);
write_byte(0);
write_byte(255);
message_end();
set_user_maxspeed(id, 1.0)
new newhealth = health + 1
set_user_health(id,newhealth)
set_task(1.0,"fadeout",id)
return PLUGIN_HANDLED
}

public advertise()
{
client_print(0,print_chat,"Type /Sleep To Sleep And Regain Health.")
return PLUGIN_HANDLED
}

What is wrong? I have the files on my sv_downloadurl server and they dl. But they don't play. :?


All times are GMT -4. The time now is 16:12.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.