13.04.2016, 11:18
(
Last edited by UltraScripter; 13/04/2016 at 03:29 PM.
)
Hi all this include sets game time for players like 1:00 2:00 3:00 ....
And it sets days, night, morning... depends what time
types
commdans:
tutorial for game time(wich is for all players):
tutorial for player time:
pastebin: http://pastebin.com/jmvRdMq6
full package: https://www.solidfiles.com/v/ZBnvQmz3qQjGY
And it sets days, night, morning... depends what time
types
Code:
//TIMES_GAME_TIME - counts 1 minute in 6 seconds //TIMES_REAL_TIME - counts 1 minute in 60 seconds //TIMES_WEEKS - counts 7 days on 8th day reset back to 1st day so you can make script like sunday monday tuesday ... //TIMES_DAYS - counts days
PHP Code:
//game time wich is same for all players
SetDays(days) //set game days
SetHours(hours) //set game hours
SetMinutes(minutes) //set game minutes
SetSeconds(seconds) //set game seconds
GetDays() //gets game days
GetHours() //gets game hours
GetMinutes() //gets game minutes
GetSeconds() //gets game seconds
StartTime(type, week_type) //start to count game time
EndTime() //ends count game time / can be used to pause too
ResetTime() //reset game time to 0
SetRealTime(playerid) //changing the game day, night, morning depends what time
//player time wich each player has it own time
SetPlayerDays(playerid, days) //set player days
SetPlayerHours(playerid, hours) //set player hours
SetPlayerMinutes(playerid, minutes) //set player minutes
SetPlayerSeconds(playerid, seconds) //set player seconds
GetPlayerDays(playerid) //gets player days
GetPlayerHours(playerid) //gets player hours
GetPlayerMinutes(playerid) //gets player minutes
GetPlayerSeconds(playerid) //gets player seconds
StartPlayerTime(playerid, type, week_type) //start to count player time
EndPlayerTime(playerid) //ends player time count / can used to pause too
ResetPlayerTime(playerid) //reset player time to 0
SetPlayerRealTime(playerid) //changing the player day, night, morning depends what time
/////////////types/////////////////////////////////
TIMES_GAME_TIME - counts 1 minute in 6 seconds
TIMES_REAL_TIME - counts 1 minute in 60 seconds
TIMES_WEEKS - counts 7 days on 8th day reset back to 1st day so you can make script like sunday monday tuesday ...
TIMES_DAYS - counts days
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
PHP Code:
#include <a_samp>
#include <Times>
#include <zcmd>
#if defined FILTERSCRIPT
#endif
//TIMES_GAME_TIME - counts 1 minute in 6 seconds
//TIMES_REAL_TIME - counts 1 minute in 60 seconds
//TIMES_WEEKS - counts 7 days on 8th day reset back to 1st day so you can make script like sunday monday tuesday ...
//TIMES_DAYS - counts days
public OnFilterScriptInit()
{
StartTime(TIMES_GAME_TIME, TIMES_WEEKS); //start game to count time
SetDays(3); //set days to 3
SetHours(12); //set hours to 12 if you want to set to 12 am: SetHours(24);
SetMinutes(30); //set minutes to 30
SetSeconds(15); //set seconds tp 15
SetRealTime(); //SetRealTime is changing the (day, night, morning depends what time)
return 1;
}
public OnFilterScriptExit()
{
EndTime(); //end count
return 1;
}
public OnGameModeInit()
{
StartTime(TIMES_REAL_TIME, TIMES_DAYS);
return 1;
}
public OnGameModeExit()
{
EndTime();
return 1;
}
CMD:gett(playerid, params[])
{
new Str[64];
if(GetHours() <= 23 || GetHours() >= 1)
{
format(Str, sizeof(Str), "%02d:%02d:%02d:%02d", GetDays(), GetHours(), GetMinutes(), GetSeconds());
SendClientMessage(playerid, 0x00FF00FF, Str);
}
if(GetHours() == 24) //if 12 am display as 00.
{
format(Str, sizeof(Str), "%02d:00:%02d:%02d", GetDays(), GetMinutes(), GetSeconds());
SendClientMessage(playerid, 0x00FF00FF, Str);
}
return 1;
}
CMD:later(playerid, params[])
{
SetDays(GetDays()+1); //set next day.
SetHours(GetHours()+1); //set next hour.
SetMinutes(GetMinutes()+1); //set next minute.
SetSeconds(GetSeconds()+1); //set next second.
return 1;
}
CMD:resett(playerid, params[])
{
ResetTime();
SetDays(1); //if weeks
return 1;
}
CMD:pauset(playerid, params[])
{
EndTime(); //ends also pause time
return 1;
}
CMD:resume(playerid, params[])
{
StartTime(TIMES_GAME_TIME, TIMES_WEEKS); //starts time // if stoped can call it resume
return 1;
}
PHP Code:
#include <a_samp>
#include <Times>
#include <zcmd>
#if defined FILTERSCRIPT
#endif
//TIMES_GAME_TIME - counts 1 minute in 6 seconds
//TIMES_REAL_TIME - counts 1 minute in 60 seconds
//TIMES_WEEKS - counts 7 days on 8th day reset back to 1st day so you can make script like sunday monday tuesday ...
//TIMES_DAYS - counts days
public OnPlayerConnect(playerid)
{
StartPlayerTime(playerid, TIMES_GAME_TIME, TIMES_WEEKS); //start player time to count
SetPlayerDays(playerid, 3); //set player days to 3
SetPlayerHours(playerid, 12); //set player hours to 12 if you want to set to 12 am: SetHours(24);
SetPlayerMinutes(playerid, 30); //set player minutes to 30
SetPlayerSeconds(playerid, 15); //set player seconds t 15
SetPlayerRealTime(playerid); //SetPlayerRealTime is changing the (day, night, morning depends what time) for player
return 1;
}
public OnPlayerDisconnect(playerid)
{
EndPlayerTime(playerid); //end player count
return 1;
}
CMD:getmyt(playerid, params[])
{
new Str[64];
if(GetPlayerHours(playerid) <= 23 || GetPlayerHours(playerid) >= 1)
{
format(Str, sizeof(Str), "%02d:%02d:%02d:%02d", GetPlayerDays(playerid), GetPlayerHours(playerid), GetPlayerMinutes(playerid), GetPlayerSeconds(playerid));
SendClientMessage(playerid, 0x00FF00FF, Str);
}
if(GetPlayerHours(playerid) == 24) //if 12 am display as 00.
{
format(Str, sizeof(Str), "%02d:00:%02d:%02d", GetPlayerDays(playerid), GetPlayerMinutes(playerid), GetPlayerSeconds(playerid));
SendClientMessage(playerid, 0x00FF00FF, Str);
}
return 1;
}
CMD:laterp(playerid, params[])
{
SetPlayerDays(playerid, GetPlayerDays(playerid)+1); //set player next day.
SetPlayerHours(playerid, GetPlayerHours(playerid)+1); //set player next hour.
SetPlayerMinutes(playerid, GetPlayerMinutes(playerid)+1); //set player next minute.
SetPlayerSeconds(playerid, GetPlayerSeconds(playerid)+1); //set player next second.
return 1;
}
CMD:pauset(playerid, params[])
{
EndPlayerTime(playerid); //ends player time also pause player time
return 1;
}
CMD:resettp(playerid, params[])
{
ResetPlayerTime(playerid);
SetPlayerDays(playerid, 1); //if weeks
return 1;
}
CMD:resume(playerid, params[])
{
StartPlayerTime(playerid, TIMES_GAME_TIME, TIMES_WEEKS); //starts player time // if stoped can call it resumes player time
return 1;
}
full package: https://www.solidfiles.com/v/ZBnvQmz3qQjGY
[ame]http://m.youtube.com/watch?v=-l7pPx6KTDg[/ame]