-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
Oh, I didn't notice you had a table, my bad. function isPlayerInColshape ( thePlayer ) local is = false for _, col in ipairs ( wcols ) do if isElement ( col ) then if isElementWithinColShape ( thePlayer, col ) then is = col break end end end return is end Then you can replace your isElementWithinColShape with isPlayerInColshape.
-
Any error in the debugscript?
-
To use a for-loop, you need a table, and you haven't got one.
-
Not yet possible. viewtopic.php?f=167&t=73773
-
You must add the resource to the ACL group "admin". https://wiki.multitheftauto.com/wiki/ACL
-
'k' es un ped o un jugador?
-
[Presentación SV]Blaine County Roleplay
Castillo replied to BlaineCountyRoleplay's topic in Servidores en donde jugar
Les pido que no vengan al foro a acusar sobre recursos robados y demas. -
Shariq, I don't know if that's a joke, but he just said that he can't access to the CIT forums, and you give him a link to it?
-
Sin el script no podemos ayudarte.
-
Podes poner en una tabla todos los insultos que quieras censurar, y usar el evento onPlayerChat para luego fijarte si alguno de esos insultos esta en el mensaje que envio.
-
Lo que podes cambiar es el estilo de caminar. Usa setPedWalkingStyle
-
You're welcome.
-
function weedhit ( element, matchingDimension ) if ( isElement ( element ) and matchingDimension and getElementType ( element ) == "player" ) then thePlayer = getPlayerName(element) if isPedInVehicle ( element ) then local vehicle = getPedOccupiedVehicle ( element ) local vehicleID = getElementModel ( vehicle ) local getHarvested = getElementData ( source, "isHarvested" ) if ( getHarvested == 1 ) then outputChatBox("Weed has already been harvested!", element) else if ( vehicleID == 532 ) then setElementData ( source, "isHarvested", 1 ) harvestWeed ( thePlayer ) else outputChatBox ( "You can't harvest with this vehicle!!", element ) end end else outputChatBox ( "/pickbud to pick the weed!", element ) end else outputChatBox("Error!! Contact an Admin, F2", element ) end end addEventHandler ( "onColShapeHit", getRootElement(), weedhit )
-
Are you setting the element data when it gets harvested? post "harvestWeed" function code.
-
Detecting the 'responsible resource' for an element?
Castillo replied to LonelyRoad's topic in Scripting
You're welcome. -
Detecting the 'responsible resource' for an element?
Castillo replied to LonelyRoad's topic in Scripting
function isValidVehicle ( vehicle ) if isElement ( vehicle ) then local parent = getElementParent ( vehicle ) if ( parent ) then local parent = getElementParent ( parent ) if ( parent ) then return ( parent == getResourceRootElement ( getResourceFromName ( "vehicle-system" ) ) ) else return false end else return false end else return false end end function EngineToggle ( src, key, state ) local occuVeh = getPedOccupiedVehicle ( src ) if ( occuVeh ~= false ) then if ( not isValidVehicle ( occuVeh ) ) then return end local vehOwner = tonumber ( getElementData ( occuVeh, "veh:owner" ) ) local charID = tonumber ( getElementData ( src, "character:id" ) ) if ( vehOwner == charID ) then local vehState = getVehicleEngineState ( occuVeh ) setVehicleEngineState ( occuVeh, not vehState ) setVehicleLocked ( occuVeh, not vehState ) else if ( getPedOccupiedVehicleSeat ( src ) == 0 ) then outputChatBox ( "This ain't your car!", src ) if isPedInVehicle ( src ) then local x, y, z = getElementPosition ( src ) removePedFromVehicle ( src ) setElementPosition ( src, x, y, z + 5 ) end end end end end Try it. -
Detecting the 'responsible resource' for an element?
Castillo replied to LonelyRoad's topic in Scripting
local vehicles = getElementsByType ( "vehicle", getResourceRootElement ( getResourceFromName ( "vehicle-system" ) ) ) for _, vehicle in ipairs ( vehicles ) do fixVehicle ( vehicle ) end That will fix all vehicles created by the "vehicle-system" resource. -
The "gps" resource has the vehicle nodes. Edit: I don't know if this is what you were looking for: https://www.dropbox.com/s/c29lcuhmsfkr54a/paths.lua
-
"element" is the player that hit the colshape, not the colshape.
-
You can use any method to store it, that's up to you.
-
He's talking about this forum. Here's Arran profile: memberlist.php?mode=viewprofile&u=53503 You can also ask someone that can use the CIT forum to contact Arran.
-
You can store the team in a table. But, you need to know when the team changes, since there is no event for that.
-
You're welcome.
-
I don't see what's the point of that, what's wrong with using a image?
-
I don't really get it, mind posting the full script?