Sleep System - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Sleep System (
/showthread.php?tid=431149)
Sleep System -
Zumba - 16.04.2013
I want to create Sleep system for samp with timer texdraw and command.
Timer: I want to create timer and to check every 2 hours and when time expire to send player message
Textdraw: I want to create some black textdraw that in on full screen(everything is black) when player use command
Command: I want to create command for sleeping and when type command to setplayer textdraw for 2-3 minutes, if player not type command to kill him.
How to make this ??
Re: Sleep System -
Zumba - 16.04.2013
Help Please
Re: Sleep System -
[XST]O_x - 16.04.2013
pawn Код:
new sTimer[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
sTimer[playerid] = SetTimerEx("SleepMessage", 2 * 60 * 60 * 1000, true, "i", playerid);
return 1;
}
forward SleepMessage(playerid);
public SleepMessage(playerid)
{
SendClientMessage(playerid, -1, "Message");
return 1;
}
Black screen:
pawn Код:
new Text: blackTD;
public OnGameModeInit()
{
blackTD = TextDrawCreate(-20.000000,2.000000,"|");
TextDrawUseBox(blackTD,1);
TextDrawBoxColor(blackTD,0x000000ff);
TextDrawTextSize(blackTD,660.000000,22.000000);
TextDrawAlignment(blackTD,0);
TextDrawBackgroundColor(blackTD,0x000000ff);
TextDrawFont(blackTD,3);
TextDrawLetterSize(blackTD,1.000000,52.200000);
TextDrawColor(blackTD,0x000000ff);
TextDrawSetOutline(blackTD,1);
TextDrawSetProportional(blackTD,1);
TextDrawSetShadow(blackTD,1);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/blackscreen"))
{
TextDrawShowForPlayer(playerid, blackTD);
return 1;
}
return 0;
}