hmmm.. how to put a float in a variable?
#1

hi i'm busy with my house system :P
but i am creating a command that could place a house cut in need to put a float
in a variable but it won't work here are some parts:
the errors
Код:
C:\DOCUME~1\*****\BUREAU~1\Server\GAMEMO~1\***.pwn(151) : warning 213: tag mismatch
C:\DOCUME~1\*****\BUREAU~1\Server\GAMEMO~1\***.pwn(152) : warning 213: tag mismatch
C:\DOCUME~1\*****\BUREAU~1\Server\GAMEMO~1\***.pwn(153) : warning 213: tag mismatch
C:\DOCUME~1\*****\BUREAU~1\Server\GAMEMO~1\***.pwn(154) : warning 213: tag mismatch
C:\DOCUME~1\*****\BUREAU~1\Server\GAMEMO~1\***.pwn(155) : warning 213: tag mismatch
C:\DOCUME~1\*****\BUREAU~1\Server\GAMEMO~1\***.pwn(156) : warning 213: tag mismatch
lines 151, 152, 153...
Код:
HouseInfo[id][hEntX] = x
HouseInfo[id][hEntY] = y
HouseInfo[id][hEntZ] = z
HouseInfo[id][hExtX] = 1272.9116
HouseInfo[id][hExtY] = -768.9028
HouseInfo[id][hExtZ] = 1090.5097
id variavble
Код:
new id = housecount+1;
the Coordinates x,y,z defines
Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x,y,z);
i tried things like : floatstr but i didn't work
Reply
#2

Try adding a
pawn Код:
;
after the lines
Reply
#3

you made the error in your enum

Код:
enum YourHouseEnum
{
  [...]

  Float: hEntX,
  Float: hEntY,
  Float: hEntZ,
  Float: hExtX,
  Float: hExtY,
  Float: hExtZ,

  [...]
}
Reply
#4

oh yeah thanks rav!
Reply
#5

Why an enum if they are all floats ?

Doing this:

pawn Код:
enum eHouse
{
  Float:x,
  Float:y,
  Float:z
}

new
  gHouse[ eHouse ];
Is stupid when you can just use:

pawn Код:
new
  Float:gHouse[ 3 ];
Reply
#6

because an enum leaves easy room for expansion, maybe he wants a car that goes with the house, you'll need to define an interior ID, or maybe guns that are stored..
Reply
#7

Quote:
Originally Posted by Rav
because an enum leaves easy room for expansion, maybe he wants a car that goes with the house, you'll need to define an interior ID, or maybe guns that are stored..
I'm not talking about that, I'm talking about why waste code time and effort.
Reply
#8

it aren't all floats

take a look at the orignal :S

Код:
enum hInfo
{
	hOwner[16],
	hCost,
	hSale,
	hDesc[256],
	Float:hEntX,
	Float:hEntY,
	Float:hEntZ,
	Float:hExtX,
	Float:hExtY,
	Float:hExtZ,
	hInt,
	hID
};

new HouseInfo[2000][hInfo];
Reply
#9

small tip: if you're making that much houses (2000?) you'll need to use virtual worlds
Reply
#10

Well excuse me all over the place

No but do you see my point dude, sometimes people over complicate things for no reason. Like in the example I showed, there is no point in using an enum when a standard array will do. Some people would use the enum just to make it look like they are more advanced when really there is no need to use the enum.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)