SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 27/01/2012, 05:17 PM   #1
sabretur
Huge Clucker
 
sabretur's Avatar
 
Join Date: Oct 2010
Location: Lithuania
Posts: 252
Reputation: 17
Default Sleep v1.0

Sleep v1.0
Description
This include freezes the script for some time.
Example
Example of script:
pawn Code:
#include <a_samp>
#include <sleep>

main()
{
    new count = GetTickCount();
    Sleep(5000);
    printf("Time expired in %d milliseconds",count);
}
Will print:
Code:
Time expired in 5000 milliseconds
Usage
Firstly, move sleep.inc file into your Pawno includes folder.
Then, add this at the top of your script:
pawn Code:
#include <sleep>
To make this function work, you must set expiry time in milliseconds (1 second = 1000 miliseconds).

I hope you find this useful.
Download
Solidfiles
Pastebin
__________________
My Releases:
[FilterScript] Simple Speedo + Fuel System
[FilterScript] Anti High-Ping
[Include] Sleep v1.0
sabretur is offline   Reply With Quote
Old 27/01/2012, 05:18 PM   #2
RyDeR`
High-roller
 
RyDeR`'s Avatar
 
Join Date: Feb 2009
Location: Belgium
Posts: 3,079
Reputation: 575
Default Re: Sleep v1.0

Nothing useful - will just freeze your server, no updates, nothing. You could have posted this in the Useful Snippet topic though.
__________________

Sup?
RyDeR` is offline   Reply With Quote
Old 27/01/2012, 05:33 PM   #3
steki.
High-roller
 
steki.'s Avatar
 
Join Date: Nov 2010
Location: São Paulo, Brasil
Posts: 2,557
Reputation: 230
Default Re: Sleep v1.0

There's already a sleep function.
__________________

NÃO FAZ UM ANO, SEUS VACILÕES xD

http://forum.rio-rpg.com.br
steki. is offline   Reply With Quote
Old 27/01/2012, 05:35 PM   #4
Universal
Huge Clucker
 
Universal's Avatar
 
Join Date: Jan 2010
Posts: 475
Reputation: 25
Default Re: Sleep v1.0

How can I use this? What for I mean...
__________________
Universal is online now   Reply With Quote
Old 27/01/2012, 07:16 PM   #5
Scott
Beta Tester
 
Join Date: Aug 2010
Location: Santa Barbara, CA
Posts: 141
Reputation: 133
Default Re: Sleep v1.0

http://forum.sa-mp.com/showthread.php?t=257660
Scott is offline   Reply With Quote
Old 28/01/2012, 01:43 AM   #6
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 5,413
Reputation: 766
Default Re: Sleep v1.0

Why would you even want to use this though? I can't see any use for it..
__________________
>> Click here for ALL of my releases
mGates - Create AUTOMATIC gates with ONE FUNCTION (+ restrictions i.e. team members only)
IEE (Interior Enter/Exits) - Create enex markers with one function
Cuffs - Cuff offsets for ALL SKINS!
vfunc - Vehicle functions. GetVehicleColor and synced random colors.
gBug - Prevent the 'G' bug (players being able to enter moving vehicles by pressing G then running after them).
MP2 is online now   Reply With Quote
Old 03/05/2012, 09:37 AM   #7
niels44
High-roller
 
niels44's Avatar
 
Join Date: Jul 2011
Location: in Holland, UltraStunting and StreetRodZ Racers
Posts: 1,127
Reputation: 39
Default Re: Sleep v1.0

yeah, i wouldnt use it either, anyways its good job of him, though its useless XD, anyways good job, but i dont think anyone will use it
__________________
IP: 145.53.175.244:7777

greets niels

www.filebin.tk
www.streetrodzracers.tk

Coming Soon:
nAdmin Administration FS // Vip System 4 levels, Admin System 10 levels
Or:
new Stunt/Drift Gamemode, nicer then Torettoracing(my previous one)

PM me which one i should make, i only make ONE!, most votes count
niels44 is offline   Reply With Quote
Old 03/05/2012, 09:46 AM   #8
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629
Posts: 13,671
Reputation: 1939
Default Re: Sleep v1.0

Quote:
Originally Posted by niels44 View Post
yeah, i wouldnt use it either, anyways its good job of him, though its useless XD, anyways good job, but i dont think anyone will use it
How is something useless a good job? I think we have very different definitions of the word "good"...

h02 already pointed you to the main topic on this, but I will point you to a specific post inside that topic that covers the theory behind a "sleep" function that could work:

http://forum.sa-mp.com/showpost.php?...8&postcount=22

I've never implemented it because I've never thought of a good way to implement returns nicely (although I have just come up with another idea for that using a special return value "cellmin"). Or I could attempt to save, unwind, and restore the ENTIRE stack.
__________________
Y_Less is offline   Reply With Quote
Reply

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sleep mode Chris White Server Support 1 28/12/2011 04:23 AM
sleep omer5198 Scripting Help 2 26/10/2011 03:43 PM
sleep function iJumbo Help Archive 5 23/10/2010 03:06 PM
sleep iJumbo Help Archive 1 02/10/2010 04:00 PM
sleep russiany Help Archive 9 26/05/2009 03:17 PM


All times are GMT. The time now is 02:20 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.