[HELP] TooglePlayerClock
#1

in my gamemode the clock exists and it makes the time change and too quick, the light is over and its night.
its VERY annoying because its a DM gamemode.
i wanted to cancel the clock, and i found the funcion : TooglePlayerClock(playerid,toogle) - toogle = 1 or 0
and made it like this:
public OnGameModeInit bla bla
bla bla

TooglePlayerClock(playerid,0)
BLA BLA BLA ETC.

and it made me an error: undefined symbol "playerid"
so i puted it in public OnPlayerConnect, and it didn't work.
(SORRY FOR POOR ENGLISH!)
can you help me?
Reply
#2

i had that problem befor... make a timer with 1 sec interval and two varss (for server hour and minutes). then min+1 for everyone when the timer event strikes. so the clocks synced
Reply
#3

I don't really know how to do that, i think i'm asleep
can you send me the code?
Reply
#4

Код:
new chour;
new cminutes;

//ongminit()
SetTimer("Clock",1000,true);

//somewhere
forward Clock();
public clock()
{
	cminutes++;
	if(cminutes == 60) {    cminutes=0; chour++;	if(chour == 24) {	chour=0;	}     }
	SetWorldTime(chour);
	for(new i;i<MAX_PLAYERS;i++)
	{
	    SetPlayerTime(i,chour,cminutes);
	}
	return 1;
}
Reply
#5

try to use that under onpalyerstreamin..
Reply
#6

Quote:
Originally Posted by [CrC]reinixx
Посмотреть сообщение
try to use that under onpalyerstreamin..
it wouldnt sync the players clock...
Reply
#7

THE_KNOWN: its the same, clock's moving.
reinixx: i dont have that public, can you write me exactly the name of it (not onPalyer i think )

i DONT want the clock to move
Reply
#8

so yuo dont want the clock? then untoggle the playerclock and set all players time to someting you want
Reply
#9

You can use TogglePlayerClock(playerid,0); under OnPlayerConnect

And SetWorldTime(12); under OnGameModeInit

TogglePlayerClock would only return an undefined playerid if you used it where playerid is not defined, so use it where you're meant to use it and it will be fine.

Quote:
Originally Posted by [CrC]reinixx
Посмотреть сообщение
try to use that under onpalyerstreamin..
stfu.
Reply
#10

BMUK: THANK YOU! IT WORKS! YOU ARE A KING MAN!
OT whats stfu?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)