04.05.2014, 21:07
Ok, So I want the time to change only for a certain player if he goes above a certain height. Otherwise I want to stay to the servers scripted time.
How do I Achieve this?
How do I Achieve this?
I don't think thats possible since the time is like gravity, for all players same. You can anyway put a textdraw over the time and just set the time that way.
|
forward heighttime();
public heighttime()
{
new
Float: heightchange = 100.00, //----------------This is the height at which the time change happens
Float: pX,
Float: pY,
Float: pZ;
for(new i = 0; i < MAX_PLAYERS; i++)
{
GetPlayerPos(i, pX, pY, pZ);
if(pZ >= heightchange){
SetPlayerTime(i, 24, 00); //--------------This is the time for if they are above the height line.
} else {
//get server time
new
cHour,
cMinute;
gettime(cHour, cMinute);
SetPlayerTime(i, cHour, cMinute); //------------Set's player time to server time
}
}
}
public OnGameModeInit()
{
SetTimer("heighttime", 5000, true); // Set a timer of 5000 miliseconds (5 seconds)
}