Need help with "worldTime"
#1

Код:
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.
Reply
#2

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?
Reply
#3

Код:
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;
}
Reply
#4

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 .
Reply
#5

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

There annoying, haha.

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

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

Ofcourse it won't! You know what Arg!

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

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

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)