Wrong time? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Wrong time? (
/showthread.php?tid=72489)
Wrong time? -
Justsmile - 08.04.2009
Hello,
I want to open Casino 1 Hour but whats wrong?
if(PlayerToPoint(20, i,2015.4500,1017.0900,996.8750))
{//Four Dragons
new Hour;
gettime(Hour);
if(Hour == 23) //Hour >= 2)
{
GameTextForPlayer(i, "~r~open", 5000, 1);/*open the casino*/
}
else if(Hour <= 0 && Hour > 23)
{ /*close the casino*/
SetPlayerPos(i,1022.599975,-1123.699951,23.799999);
GameTextForPlayer(i, "~r~close", 5000, 1);/*open the casino*/
}
}
Re: Wrong time? -
Nero_3D - 08.04.2009
look your else if, that would be the same as if(all numbers below zero AND all numbers over 23), just do else
and use pawn tags
[pawn][/pawn]
pawn Код:
if(PlayerToPoint(20, i,2015.4500,1017.0900,996.8750)) //Four Dragons
{
new Hour;
gettime(Hour);
if(Hour == 23)
{ // open the casino
GameTextForPlayer(i, "~r~open", 5000, 1);
}
else
{ // close the casino
SetPlayerPos(i,1022.599975,-1123.699951,23.799999);
GameTextForPlayer(i, "~r~close", 5000, 1);
}
}
... doesnt it gets called when a shop is opened oder closed, opened and closed ?
Re: Wrong time? -
Justsmile - 08.04.2009
I will try. But thanks.
Re: Wrong time? -
Justsmile - 08.04.2009
Tanks. It works.