Compare heigths doesn't work
#1

Hi,
I'm trying to make a code to detect if a player has fallen under a stunt.
This is what I've got now;
Код:
public OnPlayerUpdate(playerid)
{
	new Float:x;
	new Float:y;
	new Float:z;
	GetPlayerPos(playerid,x,y,z);
	printf("lolmao %f",z);
	if(z < Games[currentGame][minimumHeight])SendMsg(playerid,"CHCK"); 
	return 1;
}
Thanks
Reply
#2

How about printing Games[currentGame][minimumHeight] aswell?
If you did that, post the log here.

Note: Use proper messages [printf("z: %f, minHeight: %f", z, Games[currentGame][minimumHeight]);]
Reply
#3

Quote:
Originally Posted by FUNExtreme
Посмотреть сообщение
How about printing Games[currentGame][minimumHeight] aswell?
If you did that, post the log here.

Note: Use proper messages [printf("z: %f, minHeight: %f", z, Games[currentGame][minimumHeight]);]
Код:
enum game_info
{
	name[128],
	time,
	level,
	vehicles, // 1 = cars // 2 = Bikes // 3 = planes // 4 = boats
	filterscript[128],
	Float:minimumHeight,
	Float:xFinish,
	Float:yFinish,
	Float:zFinish
}

new Games[MAX_GAMES][game_info];

//OnGameModeInit	
	format(Games[0][name],128,"Big Jump");
	Games[0][time] = 1000*60*1;
	Games[0][xFinish] = 371.1416;
	Games[0][yFinish] = -1620.9182;
	Games[0][zFinish] = 50.2109;
	Games[0][minimumHeight] = 166.1960;
	Games[0][level] = 2; // 1 to 5 (how hard the stunt is)
	Games[0][vehicles] = 1; // 2 = bikes // 1 = cars // 3 = planes // 4 = boats
	format(Games[0][filterscript],128,"bigjump");
Reply
#4

No, with printing I mean like you do with the z variable

pawn Код:
printf("z: %f, minHeight: %f", z, Games[currentGame][minimumHeight]);
Thats what I mean
Reply
#5

Quote:
Originally Posted by FUNExtreme
Посмотреть сообщение
No, with printing I mean like you do with the z variable

pawn Код:
printf("z: %f, minHeight: %f", z, Games[currentGame][minimumHeight]);
Thats what I mean
This doesn't output anything ;s
Код:
public OnPlayerUpdate(playerid)
{
	new Float:x;
	new Float:y;
	new Float:z;
	GetPlayerPos(playerid,x,y,z);
	printf("z: %f, minHeight: %f", z, Games[currentGame][minimumHeight]);
	if(z < Games[currentGame][minimumHeight])SendMsg(playerid,"CHCK");
	return 1;
}
Reply
#6

did u do like this?:

enum Games
{
Float:minimumHeight,
}

FLOAT.
Reply
#7

Quote:
Originally Posted by Nameless303
Посмотреть сообщение
This doesn't output anything ;s
You didn't look in your log, did you?
Reply
#8

Quote:
Originally Posted by FUNExtreme
Посмотреть сообщение
You didn't look in your log, did you?
I looked in the console output and in the console log...
Reply
#9

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
did u do like this?:

enum Games
{
Float:minimumHeight,
}

FLOAT.
Yes I did;
Код:
enum game_info
{
	name[128],
	time,
	level,
	vehicles, // 1 = cars // 2 = Bikes // 3 = planes // 4 = boats
	filterscript[128],
	Float:minimumHeight,
	Float:xFinish,
	Float:yFinish,
	Float:zFinish
}


new Games[MAX_GAMES][game_info];
EDIT: I also defined MAX_GAMES ofc.
Reply
#10

Help, anyone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)