Help SLEEP script
#7

Ok i am a step closer, but still no animation the code below work okay

you type /sleep

and the screen fades out then for 10 seconds you cant control. you then wake up feeling refreshed!

just no anim






Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/sleep", cmdtext, true, 10) == 0)
{
if(SleepLevel[playerid] != 0)
{
TogglePlayerControllable(playerid, 0);
TextDrawShowForPlayer(playerid, SleepScreanTD);
TogglePlayerControllable(playerid, 0);
ApplyAnimation(playerid,"CRACK","crckdeth2",4.0, 1, 0, 0, 0, 0);
GameTextForPlayer(playerid, "~w~Sleeping z Z z Z z Z", 5000, 180000);
Sleeping[playerid] = 1;
SetTimerEx("Sleep2", 10000, false, "i", playerid);
}
else
{
SendClientMessage(playerid, 0xFFFFFF, "{FF0000}[{FFFFFF}SleepSystem{FF0000}]{808080} You have no desire to sleep!");
return 1;
}
return 1;
}
return 0;




Quote:

}

public Sleep2(playerid)
{
TextDrawHideForPlayer(playerid, SleepScreanTD);
SleepLevel[playerid] = 0;
SetProgressBarValue(SleepBar[playerid], SleepLevel[playerid]);
UpdateProgressBar(SleepBar[playerid], playerid);
TogglePlayerControllable(playerid, 1);
Sleeping[playerid] = 0;
SendClientMessage(playerid, 0xFFFFFF, "{00FF00}[{FFFFFF}SleepSystem{00FF00}]{808080} You just woke up, Is like you are born again!");
return 1;
}

Reply


Messages In This Thread
Help SLEEP script - by DukeVega - 30.01.2015, 17:51
Re: Help SLEEP script - by CalvinC - 30.01.2015, 17:56
Re: Help SLEEP script - by DukeVega - 30.01.2015, 18:01
Re: Help SLEEP script - by CalvinC - 30.01.2015, 18:16
Re: Help SLEEP script - by DukeVega - 30.01.2015, 18:21
Re: Help SLEEP script - by CalvinC - 30.01.2015, 18:35
Re: Help SLEEP script - by DukeVega - 30.01.2015, 18:53
Re: Help SLEEP script - by CalvinC - 30.01.2015, 18:58

Forum Jump:


Users browsing this thread: 3 Guest(s)