TrapLord Studios™ Posted July 13, 2013 Share Posted July 13, 2013 Can someone please help me in making an command , where when it is used, the syntax would be like [text]> , and when you use it, the "Info" Icon/Object is spawned infront of the player who uses the command, and the text would be dx drawn, right above the "Info" Icon/Object. Link to comment
Moderators IIYAMA Posted July 13, 2013 Moderators Share Posted July 13, 2013 first code, then help... Link to comment
TrapLord Studios™ Posted July 13, 2013 Author Share Posted July 13, 2013 Thats it I dont Know what to start with Link to comment
iMr.3a[Z]eF Posted July 13, 2013 Share Posted July 13, 2013 So, give him the codes to use -,- addCommandHandler createObject setElementPosition dxDrawText And the rest codes for the above the object someone will help you i forget them. Link to comment
TrapLord Studios™ Posted July 13, 2013 Author Share Posted July 13, 2013 mysql = exports.mysql local getPlayerName_ = getPlayerName getPlayerName = function( ... ) s = getPlayerName_( ... ) return s and s:gsub( "_", " " ) or s end --/MINFO function adminUncuff(thePlayer, commandName, targetPlayer) if (exports.global:isPlayerAdmin(thePlayer)) then if not (targetPlayer) then outputChatBox("SYNTAX: /" .. commandName .. " [info Text]", thePlayer, 255, 194, 14) end addCommandHandler("minfo", adminminfo, false, false) (Alright I dont know what to do from here ) Link to comment
iMr.3a[Z]eF Posted July 13, 2013 Share Posted July 13, 2013 wtf try this local x,y,z = getElementPosition( source ) addCommandHandler( "info", function (thePlayer, commandName, id) if (tonumber(id)) then createObject(id, y, x, z - 1) end end ) Link to comment
iPrestege Posted July 13, 2013 Share Posted July 13, 2013 wtf try this local x,y,z = getElementPosition( source ) addCommandHandler( "info", function (thePlayer, commandName, id) if (tonumber(id)) then createObject(id, y, x, z - 1) end end ) source is not defined . Link to comment
iMr.3a[Z]eF Posted July 13, 2013 Share Posted July 13, 2013 wtf try this local x,y,z = getElementPosition( source ) addCommandHandler( "info", function (thePlayer, commandName, id) if (tonumber(id)) then createObject(id, y, x, z - 1) end end ) source is not defined . Thanks for warn, but are the rest right? local x,y,z = getElementPosition( thePlayer ) addCommandHandler( "info", function (thePlayer, commandName, id) if getElementType(thePlayer) == "player" then if (tonumber(id)) then createObject(id, y, x, z - 1) end end end ) Link to comment
iPrestege Posted July 13, 2013 Share Posted July 13, 2013 wtf try this local x,y,z = getElementPosition( source ) addCommandHandler( "info", function (thePlayer, commandName, id) if (tonumber(id)) then createObject(id, y, x, z - 1) end end ) source is not defined . Thanks for warn, but are the rest right? local x,y,z = getElementPosition( thePlayer ) addCommandHandler( "info", function (thePlayer, commandName, id) if getElementType(thePlayer) == "player" then if (tonumber(id)) then createObject(id, y, x, z - 1) end end end ) No it's not . Link to comment
TrapLord Studios™ Posted July 22, 2013 Author Share Posted July 22, 2013 Whats wrong with this? function createinfop(thePlayer, commandName, id) if not dep then outputChatBox("SYNTAX: /" .. commandName .. " [TEXT]", thePlayer, 255, 194, 14) else if (exports.global:isPlayerLeadAdmin(thePlayer)) or exports.global:isPlayerScripter(thePlayer) then local dimension = getElementDimension(thePlayer) local interior = getElementInterior(thePlayer) local x, y, z = getElementPosition(thePlayer) local rotation = getPedRotation(thePlayer) local id = tonumber(id) z = z - 0.3 local id = mysql:query_insert_free("INSERT INTO infopoints SET x='" .. mysql:escape_string(x) .. "', y='" .. mysql:escape_string(y) .. "', z='" .. mysql:escape_string(z) .. "', dimension='" .. mysql:escape_string(dimension) .. "', interior='" .. mysql:escape_string(interior) .. "', rotation='" .. mysql:escape_string(rotation) .. "', `id`='" .. mysql:escape_string(limit) .."'") local x,y,z = getElementPosition( source ) addCommandHandler( "info", function (thePlayer, commandName, id) if (tonumber(id)) then createObject(id, y, x, z - 1) end end ) Link to comment
Jaysds1 Posted July 22, 2013 Share Posted July 22, 2013 Things that's wrong or unknown to us: Variable "dep" isn't defined (Line 2) Variable "id" is already defined you can't localize it (Line 11 and Line 14) "source" isn't defined (Line 16) "id" needs to be converted into a number (Line 19) BTW, What are you trying to do in this script? Link to comment
TrapLord Studios™ Posted July 29, 2013 Author Share Posted July 29, 2013 When you use the command, It would spawn the Info Icon infront the player, with dxdrawn text above it Link to comment
TrapLord Studios™ Posted July 29, 2013 Author Share Posted July 29, 2013 Note the text above each info icon spawned would be different, as the script would enable the user to input the desired text. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now