-
Posts
467 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Gravestone
-
I don't think you can use resourceRoot as an element?
-
I guess using it with dxDrawImage would be better.
-
That means the blips would be only be visible to the client pressing the 'i' key.
-
You can do that by inserting the timer attached to player in a table. local timers = {} local gambling = createMarker ( 2322.7568359375, 2088.5502929688, 34.055694580078, "checkpoint", 1, 255, 0, 0, 255 ) addEventHandler("onMarkerHit",gambling, function(player) if getElementType(player) == "player" then if not timers[player] then if getPlayerMoney(player) >= 5000 then if math.random() < 1/2 then outputChatBox ("#0000ffWelcome to the Dragon Gambling House Dice! Would you like to play?",player, r, g, b, true) outputChatBox ("#ffffff*The dealer rolls the dice*",player, r, g, b, true) outputChatBox ("#00ff00Congratulations! You have won 5000$!",player, r, g, b, true) givePlayerMoney(player,5000) table.insert(timers, player) setTimer(table.remove, 30000, 1, player) else outputChatBox ("#ff0000Welcome to the Dragon Gambling House Dice! Would you like to play?",player, r, g, b, true) outputChatBox ("#ffffff*The dealer rolls the dice*",player, r, g, b, true) outputChatBox ("#00ff00Aww, too bad! You have lost 6000$!",player, r, g, b, true) takePlayerMoney(player,6000) table.insert(timers, player) setTimer(table.remove, 30000, 1, player) end else outputChatBox("#0000ffYou do not have enough money.",player) end else outputChatBox("#0000ffYou must wait 30 seconds before gambling again", player) end end end )
-
Is this code client sided? If so, make it server sided or you can use setElementVisibleTo and loop through all the players setting the blip visible to each.
-
Post the full function
-
Try function Gravity () setPedGravity(source, 0.0001) player = source setTimer(function() setPedGravity(player, 0.0008) end, 5000, 1) end addEvent("Gravity-5s",true) addEventHandler("Gravity-5s",getRootElement(),Gravity)
-
it works perfect. Thanks for taking out time!
-
Yeah, you're right. I'm not pretty used to the XML functions, could you set an example please?
-
setvehicleenginestate [HELP] setVehicleEngineState problem!
Gravestone replied to griff316's topic in Scripting
You must provide us with the code you're using. -
In the code above ^ you're checking if the client pressed 'i' key, if so, the blips would show. Else if the state of the key is 'up' or 'released' then it would destroy those blips. Also, by replacing green house blip with yellow house blip, it will only change the blip for you, not for other players. Adding a blip won't work unless you make your own radar.
-
function addTurf( player, cmd, width, height ) if ( exports.NGAdministration:isPlayerStaff ( player ) and exports.NGAdministration:getPlayerStaffLevel ( player, 'int' ) >= 4 ) then if ( not width ) then return exports.NGMessages:sendClientMessage ( "Missing width argument, correct syntax: /addturf width height", player, 225, 0, 0) end if ( not height ) then return exports.NGMessages:sendClientMessage ( "Missing height argument, correct syntax: /addturf width height", player, 225, 0, 0) end if ( type ( width ) == 'number' and type ( height ) == 'number' ) then local x, y, z = getElementPosition ( player ) createTurf ( x, y, z, width, height, "server", id ) exports.NGSQL:db_query ( "INSERT INTO turfs(`id`, `owner`, `x`, `y`, `z`, `width`, `height`) VALUES (?, ?, ?, ?, ?, ?, ?)", id, 'server', math.floor(x), math.floor(y), math.floor(z), tonumber(width), tonumber(height)) exports.NGMessages:sendClientMessage( "NGTurf: A new turf was added successfully", player, 0, 255, 0 ) else exports.NGMessages:sendClientMessage( "NGTurf: Expected numbers for width and/or height", player, 0, 255, 0 ) end end end addCommandHandler( "addturf", addTurf ) The 2nd line is using an export function from the resource called NGAdministration, isPlayerStaff probably checks if the player is a staff member, don't know about getPlayerStaffLevel. Check if the statements are returning true.
-
This is what I want to do, taken from default freeroam resource.
-
table.insert(peds,{ped[i] = createPed(t.pedID,t.x,t.y+1,t.z,270),marker[i] = createMarker(t.x,t.y,t.z,"cylinder",0.7,t.r,t.g,t.b,255)}) I don't see any table named as 'ped' and 'marker'. Do they exist?
-
Use onElementDataChange and check if the play time data was changed. For example: function checkPlayTime(dataName, oldValue) if getElementType(source) == "player" then if dataName == "playingHours" then -- check if the "playingHours" data changed you can change the data name tho if oldValue < getElementData(source, "playingHours") -- if the old value is less than new one givePlayerMoney(source, money) end end end end addEventHandler("onElementDataChange", root, checkPlayTime)
-
Firstly, double posting is not allowed. Secondly, if you think that the locking of your previous topic was a mistake or for invalid reason, you may pm one of the moderators.
-
Post the part of the code in which you think you're having error or which is related to the problem you're facing (same thing tho but still). Can't read your 1000 lines code above ^
-
Increase the width and height of the image.
-
Use fileGetSize?
-
Thanks. I still don't get you man ._.
-
function output() for _, name in ipairs(playerName) do outputChatBox(name) outputDebugString( "Working" ) end end addCommandHandler("table2", output)
-
Use onClientClick to check if the player's mouse button was clicked and the last parameter of this event is the world's element that was clicked.
-
getTime is an MTA function, you can't use it as a variable.
-
What do you mean? I don't understand.
-
Okay, here's what I came up with: function deleteVehicle(thePlayer, commandName, id) if (exports.vice_core:isSysAdmin(thePlayer)) then local dbid = tonumber(id) if tonumber(dbid) then for _, v in ipairs(getElementsByType("vehicle")) do local vehicleDBID = getElementData(v, "dbid") if tonumber(vehicleDBID) == tonumber(dbid) then destroyElement(v) exports.vice_notification:addNotification(thePlayer, "Vehicle successfully deleted", "success") else exports.vice_notification:addNotification(thePlayer, "There is no existing vehicle with this ID", "error") end end else outputChatBox("[USAGE]:#FFFFFF /"..commandName.." [vehicle ID]", thePlayer, 0, 180, 255,true) end end end addCommandHandler("delveh", deleteVehicle, false, false)