SA-MP Forums Archive
Need help with "worldTime" - 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: Need help with "worldTime" (/showthread.php?tid=155766)



Need help with "worldTime" - HAYTXA - 19.06.2010

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{

  if(pickupid == mover && worldTime == 12) return SetPlayerPos(playerid,1453.9908447266,3375.7922363281,3.3724265098572);
	else if(worldTime == 24)return SetPlayerPos(playerid,1426.2017822266,3337.44140625,4.3413867950439);
  	SendClientMessage( playerid, COLOR_RED, "You escaped the prison,now your in tube,try to find your way out." );
  	SetPlayerHealth(playerid,50.0);
  	SetPlayerWantedLevel(playerid,22);
  	SendClientMessage( playerid, COLOR_RED, "You are now wanted,cops will start searching you soon." );
  return 1;
}
I want to make it work like when player pickups the pickup and time is 12:00 he gets teleported to the prison back but if time is 24:00 he escapes.

Now when time is 12:00,24:00 or something else he gets back to prison. If you know how,please help.


Re: Need help with "worldTime" - Antonio [G-RP] - 19.06.2010

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{

  if(pickupid == mover && worldTime == 12) return SetPlayerPos(playerid,1453.9908447266,3375.7922363281,3.3724265098572);
    else if(pickupid == moved && worldTime == 24)return SetPlayerPos(playerid,1426.2017822266,3337.44140625,4.3413867950439);
    SendClientMessage( playerid, COLOR_RED, "You escaped the prison,now your in tube,try to find your way out." );
    SetPlayerHealth(playerid,50.0);
    SetPlayerWantedLevel(playerid,22);
    SendClientMessage( playerid, COLOR_RED, "You are now wanted,cops will start searching you soon." );
  return 1;
}
Should it be that?


Re: Need help with "worldTime" - DJDhan - 19.06.2010

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	new hours,minutes,seconds;
	GetTime(hours,minutes,seconds);
	if(pickupid == mover && hours == 12) return SetPlayerPos(playerid,1453.9908447266,3375.7922363281,3.3724265098572);
	else if(pickupid == mover && hours == 24) return SetPlayerPos(playerid,1426.2017822266,3337.44140625,4.3413867950439);
	
	SendClientMessage( playerid, COLOR_RED, "You escaped the prison,now your in tube,try to find your way out." );
	SetPlayerHealth(playerid,50.0);
	SetPlayerWantedLevel(playerid,6); //6 is max
	SendClientMessage( playerid, COLOR_RED, "You are now wanted,cops will start searching you soon." );
	return 1;
}



Re: Need help with "worldTime" - HAYTXA - 19.06.2010

C:\Documents and Settings\Don\Desktop\Test Server\filterscripts\Map.pwn(169) : error 017: undefined symbol "Gettime"
C:\Documents and Settings\Don\Desktop\Test Server\filterscripts\Map.pwn(167) : warning 203: symbol is never used: "seconds"
C:\Documents and Settings\Don\Desktop\Test Server\filterscripts\Map.pwn(167) : warning 203: symbol is never used: "minutes"
C:\Documents and Settings\Don\Desktop\Test Server\filterscripts\Map.pwn(161) : warning 204: symbol is assigned a value that is never used: "worldTime"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Now i get those errors .



Re: Need help with "worldTime" - DJDhan - 19.06.2010

It's
Код:
GetTime(........);
and not
Код:
Gettime(......);
And for the "unused symbol" warnings, ignore them.


Re: Need help with "worldTime" - Antonio [G-RP] - 19.06.2010

There annoying, haha.

pawn Код:
#pragma unused seconds
#pragma unused minutes



Re: Need help with "worldTime" - HAYTXA - 19.06.2010

Actually its gettime,when i changed Gettime to gettime i now don't get errors but it wont teleport me to my locations.



Re: Need help with "worldTime" - DJDhan - 19.06.2010

Ofcourse it won't! You know what Arg!

Quote:
Originally Posted by DJDhan
It's
Код:
GetTime(........);
and not
Код:
Gettime(......);



Re: Need help with "worldTime" - HAYTXA - 19.06.2010

Quote:
Originally Posted by ♂ Antonio [G-RP
]
There annoying, haha.

pawn Код:
#pragma unused seconds
#pragma unused minutes
Explain


Re: Need help with "worldTime" - DowNlOaD_ - 19.06.2010

Quote:
Originally Posted by Don_(GH)
Quote:
Originally Posted by ♂ Antonio [G-RP
]
There annoying, haha.

pawn Код:
#pragma unused seconds
#pragma unused minutes
Explain
it's just a simple way to get rid of warning that some variable is unused/never used