SA-MP Forums Archive
Compare heigths doesn't work - 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: Compare heigths doesn't work (/showthread.php?tid=169425)



Compare heigths doesn't work - Nameless303 - 19.08.2010

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


Re: Compare heigths doesn't work - FUNExtreme - 19.08.2010

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]);]


Re: Compare heigths doesn't work - Nameless303 - 19.08.2010

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");



Re: Compare heigths doesn't work - FUNExtreme - 19.08.2010

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


Re: Compare heigths doesn't work - Nameless303 - 19.08.2010

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;
}



Re: Compare heigths doesn't work - Cameltoe - 19.08.2010

did u do like this?:

enum Games
{
Float:minimumHeight,
}

FLOAT.


Re: Compare heigths doesn't work - FUNExtreme - 19.08.2010

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


Re: Compare heigths doesn't work - Nameless303 - 19.08.2010

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...


Re: Compare heigths doesn't work - Nameless303 - 19.08.2010

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.


Re: Compare heigths doesn't work - Nameless303 - 20.08.2010

Help, anyone?