How do I change default ToD
#1

How to i change the default Time of day?? So I start with 8 instead of 1
Reply
#2

Put this in OnGameModeInit
pawn Код:
SendRconCommand("worldtime [time u liek]");
Reply
#3

You will need to come up with a time system. Use this https://sampwiki.blast.hk/wiki/SetWorldTime
Reply
#4

use timers and setworld time function
pawn Код:
SetTimer("time", 60000, 0);
pawn Код:
public time()
{
  SetWorldTime(12);
  SetTimer("time2", 60000, 0);
  return 1;
}
you get the idea, there is no getworldtime function i don't think
Reply
#5

Код:
Add this to OnPlayerCommandText, any error/Warnings post them and ill post what you need.

 	if(strcmp(cmd, "/tod", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[USAGE:] /tod [timeofday] (0-23)");
				return 1;
			}
			new hour;
			hour = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 20)
			{
	      SetWorldTime(hour);
			}
			else
			{
				SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] Your not an administrator/correct level.");
			}
		}
		return 1;
	}
EDIT: You can change weather IG
Reply
#6

got confused because to set time is SetWorldTime(0); but to get is getTime(); but that is real life time is there a way to getworldtime?
Reply
#7

Another question while we are at it Everytime someone dies it show on your chat saying "Doc your medical bil.." How do i fix that?
Reply
#8

what do you have on onplayerdeath?
Reply
#9

Код:
	GetWeaponName(reason, deathreason, 20);
	format(dmessage, sizeof(dmessage), "You Got Pwned");
	if (strlen(deathreason) == 0)
	{
		format(deathreason, sizeof(deathreason), "Fists");
	}
	if (reason == 41)
	{
		format(deathreason, sizeof(deathreason), "Pepper Spray");
	}
	if (gPlayerCheckpointStatus[playerid] == CHECKPOINT_DROPOFF)
	{
		if (gdebug){print("DEBUG test6");}
		DisablePlayerCheckpoint(playerid);
		gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
		new check;
		check = gPlayerCheckpointStatus[playerid];
		if (gdebug){printf("DEBUG check %d" ,check);}
		OnPlayerDropCashBox(playerid);
	}
	if (gPlayerCheckpointStatus[playerid] > 4 && gPlayerCheckpointStatus[playerid] < 11)
	{
		DisablePlayerCheckpoint(playerid);
		gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
		LapCount[playerid] = 0;
	}
	/*
	if((PlayerInfo[playerid][pPhousekey]+1 != gLastCar[playerid] && gLastCar[playerid] != 0) || HireCar[playerid] != gLastCar[playerid] && gLastCar[playerid] != 0)
	{
		printf("DEBUG PlayerInfo[playerid][pPhousekey](%d) gLastCar[playerid]-1(%d) HireCar[playerid](%d)", PlayerInfo[playerid][pPhousekey],gLastCar[playerid]-1,HireCar[playerid]);
		UnLockCar(gLastCar[playerid]);
		gCarLock[gLastCar[playerid]] = 0;
		gLastDriver[gLastCar[playerid]] = 300;
		gLastCar[playerid] = 0;
	}
	*/
	new caller = Mobile[playerid];
	if(caller != 255)
	{
		if(caller < 255)
		{
			SendClientMessage(caller, COLOR_GRAD2, "  The line just went dead....");
			CellTime[caller] = 0;
			CellTime[playerid] = 0;
			Mobile[caller] = 255;
		}
		Mobile[playerid] = 255;
		CellTime[playerid] = 0;
	}
	ClearCrime(playerid);
	if (killerid == INVALID_PLAYER_ID)
	{
		for(new i = 0; i <= MAX_PLAYERS; i++)
		{
			if(IsPlayerConnected(i) && gTeam[i] != gTeam[playerid] && CrimInRange(20.0, playerid,i) && GetPlayerState(i) != 2)
			{
				killerid = i;
				format(deathreason, sizeof(deathreason), "Intimidation");
			}
		}
	}
	if (killerid == INVALID_PLAYER_ID)
	{
		if ((gTeam[playerid]) == 0){return 1;}
Reply
#10

Quote:
Originally Posted by Seif_
Quote:
Originally Posted by brett7
use timers and setworld time function
pawn Код:
SetTimer("time", 60000, 0);
pawn Код:
public time()
{
 SetWorldTime(12);
 SetTimer("time2", 60000, 0);
 return 1;
}
you get the idea, there is no getworldtime function i don't think
Uhm, yes there is. It's called "gettime".
gettime gets the Server Machine time, Not the IG time
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)