Deepu Posted February 25, 2014 Share Posted February 25, 2014 guyz you know the big farm in mta? ----->-1195, -1063.5, 129.19999694824 can u make a colRectangle there? It should cover the whole farm Please I need it Link to comment
Karuzo Posted February 25, 2014 Share Posted February 25, 2014 https://wiki.multitheftauto.com/wiki/CreateColRectangle Link to comment
manve1 Posted February 25, 2014 Share Posted February 25, 2014 You have 58% progress of 'lua' in your signature, i am pretty sure you should know mcuh about maths in it by then, plus you should know the basics which include col shape making and for last, we are not here to make you free scripts/script parts. Link to comment
Deepu Posted February 25, 2014 Author Share Posted February 25, 2014 yeah I did the maths theorem of lines difference and pythagorean theorem still the height and width are correct but the script dont work Link to comment
Karuzo Posted February 25, 2014 Share Posted February 25, 2014 Then show us your script. Link to comment
Deepu Posted February 25, 2014 Author Share Posted February 25, 2014 local x1 = -1195 local y1 = -1063.5 local x2 = -1003.200012207 local y2 = -1065.5999755859 width, height = ( x2 - x1 ), ( y2 - y1 ) bigCol = createColRectangle(x1, y1, x2, y2, width, height) fappa = createBlipAttachedTo(bigCol, 55) function theThing (hitElement) if hitElement == localPlayer then outputChatBox("yeah! this is the col shape", thePlayer, 255, 2, 0, false) end end addEventHandler("onClientColShapeHit", bigCol, theThing) Link to comment
Karuzo Posted February 25, 2014 Share Posted February 25, 2014 ( float fX, float fY, float fWidth, float fHeight) Why do you add x1, y1,x2,y2 ? Link to comment
Deepu Posted February 25, 2014 Author Share Posted February 25, 2014 to find the distance between x1 and y1 and x2 and y2 which is width and height respectively. Link to comment
Karuzo Posted February 25, 2014 Share Posted February 25, 2014 lol, there is no fx2 or smth like that. Did you even read the wiki ? fX: The X position of the collision rectangle's west side fY: The Y position of the collision rectangle's south side delete the x2 and y2, and the width height for e.g.: 100,10 ... Link to comment
Deepu Posted February 25, 2014 Author Share Posted February 25, 2014 you know what? check out this post viewtopic.php?f=91&t=52822 and see castillo's posts Link to comment
Karuzo Posted February 25, 2014 Share Posted February 25, 2014 I guess you don't want to do what I said, so, you just set the height and width to what you want, until it fits what you need. Could you please read the wiki ? Link to comment
Deepu Posted February 25, 2014 Author Share Posted February 25, 2014 you think I absent mindedly come here? No son, I read wiki and got confused PS: if you can help please help me by making the colshape or fixing error and if you want +1 post please dont post Link to comment
Karuzo Posted February 25, 2014 Share Posted February 25, 2014 LOL What do you think am i doin' at this moment ? You just don't want to understand me. there is no parameter like x2 or y2. you should delete them and just set x1 = ... y1 = ... bigCol = createColRectangle(x1, y1,100, 100) Link to comment
Deepu Posted February 25, 2014 Author Share Posted February 25, 2014 100? You mean 100s gonna cure the problem? I just want the whole farm to be colshaped....... k I will try my steps and if dont work then I do something MYSELF ! **** Link to comment
Karuzo Posted February 25, 2014 Share Posted February 25, 2014 First, i didn't said that you should use 100. it was just an EXAMPLE. I don't know how big the farm is . Link to comment
Deepu Posted February 25, 2014 Author Share Posted February 25, 2014 Hahahahaha you might feel I am an idiot and cant make a simple col shape but look this.... I made it x1 and y1 and the col shape spawns like in 1 point Maybe smaller than 1m (ingame) Link to comment
Karuzo Posted February 25, 2014 Share Posted February 25, 2014 Hahahahaha you might feel I am an idiot and cant make a simple col shape but look this....I made it x1 and y1 and the col shape spawns like in 1 point Maybe smaller than 1m (ingame) guyz you know the big farm in mta? ----->-1195, -1063.5, 129.19999694824can u make a colRectangle there? It should cover the whole farm Please I need it No, i know you can't do it. And i just want to help you. you could set yourself to developmode to see the colshape. Link to comment
Deepu Posted February 25, 2014 Author Share Posted February 25, 2014 I can't do it? Do what? Firstly, in wiki the height and width ain't clearly mentioned. Secondly, I can make anything unless and until its explained clearly. Thirdly, You ain't trying to help me btw whats develop mode 0_o never heard of it Link to comment
Karuzo Posted February 25, 2014 Share Posted February 25, 2014 Well something like wiki can't explain it better. And if you think i'm not helping you , ok. im off this. Link to comment
Deepu Posted February 25, 2014 Author Share Posted February 25, 2014 WELL GOOD NEWS I FIGURED IT OUT MYSELF I JUST CHANGED HEIGHT TO 100 AND WORKED THANK YOU FOR YOUR "DUMB" ANSWERS KRZO Link to comment
Moderators Citizen Posted February 25, 2014 Moderators Share Posted February 25, 2014 local x1 = -1195 local y1 = -1063.5 local x2 = -1003.200012207 local y2 = -1065.5999755859 width, height = ( x2 - x1 ), ( y2 - y1 ) bigCol = createColRectangle(x1, y1, x2, y2, width, height) fappa = createBlipAttachedTo(bigCol, 55) function theThing (hitElement) if hitElement == localPlayer then outputChatBox("yeah! this is the col shape", thePlayer, 255, 2, 0, false) end end addEventHandler("onClientColShapeHit", bigCol, theThing) I know you already solved the problem but you both didn't what was the problem and here it is: local y1 = -1063.5 local y2 = -1065.5999755859 As you can see, the y2 is too close from the y1 (only 2 meters, which is really small in GTA SA). Your code would work if you had the right position for y2 (or maybe y1 ?). Link to comment
Deepu Posted February 26, 2014 Author Share Posted February 26, 2014 nah that worked citizen.... Problem was that the height was wrong cuz I took y2-y1 as height where the lines become collinear also proven that by the distance formula AB = root(y2-y1whole square + x2-x1whole square) and y2-y1 aint the height as per mta sa axis Link to comment
Moderators Citizen Posted February 26, 2014 Moderators Share Posted February 26, 2014 nah that worked citizen....Problem was that the height was wrong cuz I took y2-y1 as height where the lines become collinear also proven that by the distance formula AB = root(y2-y1whole square + x2-x1whole square) and y2-y1 aint the height as per mta sa axis I didn't get what you said, but what I tried to say is that your original code would work with these values: local x1 = -1195 local y1 = -1063.5 local x2 = -1003.2 local y2 = -1163.5 Since it was a rectangle, there is nothing complicated, I dunno why you talked about a formula with roots in it. Link to comment
Dealman Posted February 26, 2014 Share Posted February 26, 2014 You could just get the ColShape Editor if you're having trouble with the calculations to get a visual feedback on the size of the ColShape. The ColShape Editor is however extremely awkward to use. Link to comment
Deepu Posted February 26, 2014 Author Share Posted February 26, 2014 Told you ! I already got it right -__________________________________- and I used the formula to get it correct Link to comment
Recommended Posts