-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
The problem is resolved, thank you 50p.
-
'source' is the player that entered the vehicle, you must use the first argument instead of 'source' at getVehicleName.
-
You should make a table of the buses, then destroy old one.
-
Your problem is at the client side, here: triggerServerEvent("StartBusJob", getRootElement()) It should be: triggerServerEvent("StartBusJob", localPlayer)
-
killPed is a server side function.
-
getElementByType It's: getElementsByType
-
function saveColours ( playerSource ) local playerAccount = getPlayerAccount ( playerSource ) local playerVehicle = getPlayerOccupiedVehicle ( playerSource ) if ( playerAccount ) and not isGuestAccount ( playerAccount ) then local color1, color2, color3, color4 = getVehicleColor ( playerVehicle ) local r, g, b = getVehicleHeadLightColor ( playerVehicle ) setAccountData ( playerAccount, "idd.ccolor1", colour1 ) setAccountData ( playerAccount, "idd.ccolor2", colour2 ) setAccountData ( playerAccount, "idd.ccolor3", colour3 ) setAccountData ( playerAccount, "idd.ccolor4", colour4 ) setAccountData ( playerAccount, "idd.cchcr", r) setAccountData ( playerAccount, "idd.cchcg", g) setAccountData ( playerAccount, "idd.cchcb", b) end end addCommandHandler("saveColours", saveColours) function setCarColours(_, playerAccount) local playerVehicle = getPlayerOccupiedVehicle ( source ) local color1 = getAccountData ( playerAccount, "idd.ccolor1") local color2 = getAccountData ( playerAccount, "idd.ccolor2") local color3 = getAccountData ( playerAccount, "idd.ccolor3") local color4 = getAccountData ( playerAccount, "idd.ccolor4") local r = getAccountData ( playerAccount, "idd.cchcr" ) local g = getAccountData ( playerAccount, "idd.cchcg" ) local b = getAccountData ( playerAccount, "idd.cchcb" ) setVehicleColor ( playerVehicle, color1, color2, color3, color4 ) getVehicleHeadLightColor ( playerVehicle, r,g,b) end addEventHandler("onPlayerLogin",getRootElement(),setCarColours)
-
https://wiki.multitheftauto.com/wiki/Get ... LightColor
-
Of course you can. You're welcome.
-
You can use the account data functions, that would be easier for you. getAccountData setAccountData
-
I tried using the coords given, instead of what the script gives and it doesn't work either, is not on the right place.
-
Remove the player from the vehicle, then set position?
-
You could move him to another dimension.
-
x = 1440.0651855469; y = -1725.3817138672; x2 = 1524.0031738281; y2 = -1600.7269287109; width = math.abs( x2 - x ); -- width = 1524 - 1440 = 84 height = math.abs( y2 - y ); -- height = -1600 - (-1725) = -1600 + 1725 = 125 createRadarArea( x, y, width, height ); I replaced these coordinates with ones from the Pyramid at Las Venturas and now it doesn't even appear. My coords: x = 2255.3669433594; y = 1344.3487548828; x2 = 2255.3669433594; y2 = 1219.9694824219; width = math.abs( x2 - x ); height = math.abs( y2 - y ); createRadarArea( x, y, width, height );
-
http://i.imgur.com/berRt.jpg The created manually by your code works, but I can also create on that place without problems.
-
We don't accept requests here, go learn to do it.
-
I'm creating it like you say, but still bugged. Current code: if ( x2 > x ) then local tempx = x2 x2 = x x = tempx end if ( y2 > y ) then local tempy = y2 y2 = y y = tempy end width = math.abs( x2 - x ) height = math.abs( y2 - y ) local x = ( x - width ) Screenshot: http://i.imgur.com/Fc2Ec.jpg
-
I copied it exactly like the script output, this makes it the same: local x = ( x - width ) Area 1: x = 1524.0031738281 x2 = 1440.0651855469 y = -1725.3817138672 y2 = -1600.7269287109 Area 2: x = 2389.6433105469 x2 = 2256.5837402344 y = 1347.0687255859 y2 = 1219.8205566406
-
Area 1: x = 2257.3439941406 x2 = 2257.3439941406 y = 1347.7255859375 y2 = 1219.62890625 Area 2: x = 1434.8157958984 x2 = 1434.8157958984 y = -1724.2453613281 y2 = -1601.0743408203 The second area is bugged.
-
, coronaMarker Eso esta de mas.
-
I don't understand what do you mean.
-
With this the result is the following: http://i.imgur.com/rmH12.jpg Edit: With this: if math.abs(x2) > math.abs(x) then local tempx = x2 x2 = x x = tempx end if math.abs(y2) > math.abs(y) then local tempy = y2 y2 = y y = tempy end local width, height = math.abs ( x2 - x ), math.abs ( y2 - y ) x = x - width In Los Santos it works fine, but then in other places like Las Venturas it bugs like this: http://i.imgur.com/Gfc0x.jpg
-
Same problem. Edit: Check the screenshot again, I had uploaded wrong one.
-
Hi everyone. I'm having issues with calculations for a radar area, for some reason is not creating it where it should: My code: local width, height = math.abs ( x2 - x ), math.abs ( y2 - y ) if ( x2 < x ) then local tempx = x2 x2 = x x = tempx end if ( y2 < y ) then local tempy = y2 y2 = y y = tempy end And the screenshot of the problem: http://i.imgur.com/pNEwh.jpg The RED rectangle is the radar area created by script, and the GREEN is where the radar area should be. I hope someone can help me with this issue. Thanks in advance.