Raised This Month: $ Target: $400
 0% 

Stamina Goes crazy!!?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Bone
Member
Join Date: Mar 2005
Location: Under your bed
Old 04-04-2005 , 20:59   Stamina Goes crazy!!?
Reply With Quote #1

I need some help again i Made a command so you can type /sleep and it makes it go to sleep how ever the thing is after like you "wake up" instead of like stamina stayign normal instead it stays at 100 for like a minute then ti goes crazy like goes to 7% and then 50% and makes me slow to a crawl and everything.. if someone can please see what i did in code PLEASE help.

Code:
 ////////////////////////////////////////////////////////////////////
 // Sleep
 //////////////////////////////////////////////////////////////////
public sleepmenu(id) {
	if(sleeping[id] > 0) {
	client_print(id, print_chat, "[TSRP] Your already sleeping.")
	return PLUGIN_HANDLED;
	}
	client_print(id, print_chat, "[TSRP] You sleep as your stamina regains.")
	set_user_maxspeed(id, 1.0)
	sleeping[id] += 1
	message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{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();  
        return PLUGIN_HANDLED;
	}

	public sleepcheck2(id) {
	if(is_user_connected(id) == 0) {
 	return PLUGIN_HANDLED;
	}
	if(stamina[id] > 99) {
	stamina[id] = 100
	set_task(0.1, "sleepcheck2", id)
	return PLUGIN_HANDLED;
	}
	set_task(0.1, "sleepcheck2", id)
	return PLUGIN_HANDLED;
	}
	
	public wakeup(id) {
	if(sleeping[id] < 1) {
	client_print(id, print_chat, "[TSRP] Your not sleeping.")
	return PLUGIN_HANDLED;
	}
	client_print(id, print_chat, "[TSRP] You wakeup, You healed some stamina.")
	set_user_maxspeed(id, 320.0)
	sleeping[id] -= 1
	message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},id);
	write_short(~0); 
	write_short(~0); 
	write_short(1<<12); 
	write_byte(255); 
	write_byte(255);
	write_byte(255); 
	write_byte(0);
	message_end();
	return PLUGIN_HANDLED;
	}

	public sleepcheck(id) {
	if(is_user_connected(id) == 0) {
 	return PLUGIN_HANDLED;
	}
	if(sleeping[id] > 0) {
	set_task(0.1, "gainstamina", id)
	set_task(1.0, "sleepcheck", id)
	return PLUGIN_HANDLED;
	}
	set_task(1.0, "sleepcheck", id)
	return PLUGIN_HANDLED;
	}

	public gainstamina(id) {
	stamina[id] = 100
        set_task(50.0, "loopstamina2", id);
	}

	public sleeploop(id) {
	if(is_user_connected(id) == 0) {
 	return PLUGIN_HANDLED;
	}
	set_task(0.1, "sleepcheck", id)
	set_task(2.0, "sleeploop", id)
 	return PLUGIN_HANDLED;
	}
__________________
the shirt covered her face, she screamed and clawed, so billy stomped on the bitch until he broke in her jaw.
Bone is offline
Send a message via MSN to Bone
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:57.


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