- 
                
Posts
353 - 
                
Joined
 - 
                
Last visited
 - 
                
Days Won
3 
Everything posted by LoPollo
- 
	I don't understand Don't you already have???
 - 
	--If no map is set as next -- insert into the poll some map --/ --If a map is running do something... -- if it hasn't reached the max play times -- let's do the poll -- if there's a nextmap kept as data -- add that map to the poll -- add to the poll the "play again" since the current map can be played again -- otherwise, if the map is at max plays number, -- we must start a map, regardeless of the poll -- so if there's a next map kept, -- start it -- otherwise -- start a random map -- / -- / --/ Is this logic right?
 - 
	So you fixed the problem of "importing" the map in the votemanager? contrats! EDIT: deleted part of the post, stupid things were said there... So you want to reset the keepnextmap data when the race specified in keepnextmap is played and finished (not when a (general) race is finished) Off topic: But are you sure keepnextmap will not get overwritten? on topic: What's printed outputting the values you get getting the element data?
 - 
	Yes some elements trigger the event: i used this to make
 - 
	Lol reading my reply i noticed i did not mentioned the event itself, sorry. But OnColshapeHit is better than getElementsWithinColShape since with the event you get when a vehicle enters or gets created inside it. What do you mean with "without setElementPosition"? I can't get what do you want with the last reply. Yes you deleted the MoneyZone colshape (line 57 right?) but the colshapes are created using the "radararea" elements' positions and sizes. I also don't get what you want to do when a vehicle enters these colshapes. " I would have to insert the cooardinates where the players can not spawn any vehicles." what do you mean? arent's these the radarareas?
 - 
	I'm not an expert in SQL (never used it) but till someone reply you can try executeSQLQuery doing a group by on the team id (owner) counting the IDs Something like Select owner, Count(id) as turfsCount From turfs Group By owner; Edit: also dbQuery... it's up to you
 - 
	#1 your argument hitPlayer (first argument passed from onMarkerHit) is not always a player. It's an element. If you want to do stuff when the player enters then check if that elements is a player (getElementType) #2 I'm not sure about what you want to achieve: you spawn a veh when the "player" enters... and want to destroy the vehicle when THAT vehicle enters again the marker right? If that's correct, then use a table to stores all the possibles vehicles (more players in Clan1 are able to hit the markers i guess). Then check when the marker is hit if the hitElement is one of these vehicles, then destory it. Not tested and i'm tired, but even it something may be missing the general "plan" is this if i understood the problem
 - 
	I guess that script uses a colshape to limit the greenzone (i'm lazy to check) If a vehicle enters (or gets created) inside that colshape then you can do whatever you want with that vehicle. Edit the script knowing this. If you need further help (for example the script is compiled, uses other ways to greenzone an area, or you are not able to script) ask here
 - 
	If the player is near enough to the point AND he has the money the code from and including line 3 to line 13 will be executed. In fact the end at line 14 closes the if at line 2. The code after the end will be executed regardeless if the above code gets executed. To make the notification appear only if the above code got executed you have to use the "else" statement, as you may know local someCondition = true if someCondition then --code gets executed if someCondition is true else --this code will be executed if someCondition is NOT a true-value (i.e. false or nil) end BUT If the player is not near enough the code block will also be skipped. So we must split the split (or, not recommended, recheck the value) function rentCarFuntion ( player ) if getDistanceBetweenPoints3D ( -1981.5, 128.5, 27.6875, getElementPosition(player) ) < 2 then --the player is near if getPlayerMoney >=25 then --he has the money rentCar[player] = createVehicle( 462, -1982.959, 122.84863, 27.6875, 0, 0, 90, "Rent" ) warpPedIntoVehicle( player, rentCar[player] ) takePlayerMoney(player, 25) outputChatBox ( "You rent car!", getRootElement(), 0, 255, 0, true ) setTimer( function () destroyElement(rentCar[player]) outputChatBox ( "Transport's rent over", getRootElement(), 255, 0, 0, true ) end, 600000, 1 ) else --he does not have the money outputChatBox( "Not enough money! Cost is: 25", root, 255, 0, 0, true ) end end end addEvent( "rentroller", true ) addEventHandler( "rentroller", getRootElement(),rentCarFuntion ) addCommandHandler("rentroller",rentCarFuntion )
 - 
	is getPlayerMoney what you are searching for? add an if checking if the player has more (or equal) than 25 cash --somewhere in your code function rentCarFuntion ( player ) if getDistanceBetweenPoints3D ( -1981.5, 128.5, 27.6875, getElementPosition(player) ) <2 and getPlayerMoney(player) >= 25 then rentCar[player] = createVehicle( 462, -1982.959, 122.84863, 27.6875, 0, 0, 90, "Rent" )
 - 
	@Simple01 Just my opinion, but i think that a server side timer is still better than a trigger every 7 seconds. For the rest, i agree. PS: still i hate timers
 - 
	If it's possible then assing an ID to each table value. Instead of inserting in the table the value, insert (in the table) a new table containing value and ID When sorting a table notice that you must use the value that is now in a sub-table. However i'm not experienced with sorting functions, so i can't help you with that.
 - 
	as @Gourmet. said, are there errors? I can't test since i'm alone now but the code seems correct... when a player dies due headshot the attacker will see in the chat "test wasted" PS not sure about this: getElementType returns false if the given value is false, so lines 3 and 9 can be omitted. That's not true if passing false generate a warning, in which case your code is ok
 - 
	Loading something in render means that the load happens about 36 times (default fps cap), in one minute there will be 2.160 elements loaded. Loading them when switching means that probably the shaders will get loaded 0-4 times per GAME... but if you get crazy and spam the switch, how many objects will be loaded? While in a case like the render one it's critical, in you case is more like a "right" thing to do After spamming a bit, how many elements are owned by your resource (in performanceBrowser)? EDIT: i also noticed that you are destroying in unloadTile the vars tile.shader and tile.texture... but i can't find where they are created. Also you are not destroying the shaders in the shaders table. Is it possible that the problem was partially caused by that?
 - 
	Nice, but do you free up the memory? I mean continuing loading the shaders without destroying them. Check performanceBrowser (if running) in the web server of you MTA server after switching on/off some times.
 - 
	I see you don't call createPlayerVehicle after setting the data (at least... in this block). Make sure that createFreeSpawner is called BEFORE the function createPlayerVehicle is called, so the data does exist
 - 
	_outputChatBox = outputChatBox function outputChatBox( text, visibleTo, r, g, b, colorCoded ) _outputChatBox("Robot: "..text, visibleTo, r, g, b, colorCoded) end outputChatBox( "test" ) I always thought it would have thrown an error, thank you!
 - 
	The arg? If the returned value is still false, then the problem is the same. Can you post the blocks where you set SpawnCoordinate?
 - 
	Yes it is, but i don't want him to edit the meta... But i thought that someElement:someMethod() is not OOP well i learn also by making error i hope
 - 
	Line 11: yes that's blank space if you mean line 8 it's because the data you retrieve from the source does not exists. i.e. getElementData ( source, "SpawnCoordinates" ) returns false
 - 
	ops You are right, i thought that you were @External sorry. I got worried since the code should (and do) work, but since i though that was the code @External was using, i had no idea where the error was. That's why i stated what's below: Sorry
 - 
	I don't think it's possible to overwrite a MTA func, i can exports functions but then the scripts should call that instead. Honestly the script is already completed since i only wanted to detect vehicles, and with the above script i'm able to detect players, vehicles and peds. Much more than i was aiming for. But it was intresting to see if there were ways to detect the elements i said, with an "invisible" script. That's also why i didn't want timers (still i don't like timers ) and looping potentially big tables. Because the script must do its job in an "invisible" way. I was interested in more ways that achieve the job in these conditions However if it's possible to "overwrite" mta functions... well explain, i'm interested
 - 
	even if the write position is at the end it writes from start???? that's weird... try getting result of the setPos and get the pos after setting it. The values should be the same
 
