Jump to content

micheal1230

Members
  • Posts

    390
  • Joined

  • Last visited

Everything posted by micheal1230

  1. Im Getting Bad Arg. At addPedClothes function cj(source, type, value) local type = (tonumber(value)) addPedClothes(source, type, value) outputChatBox("Clothes Changed",source) end addCommandHandler("cj",cj)
  2. Like for example you have seen my infopoints script? Right? But When The Resource Gets Restarted The Infopoint Blips Dont Load In From The MYSQL Database Off Topic: Also In The MYSQL Database It Only Saves the X Postition And It Doesnt Save The Y Or Z Position mysql = exports.mysql local pInfo = createPickup ( -206.5537109375, 1132.1015625, 19.7421875, 3, 1239 ); -- create marker addEventHandler ( "onResourceStart", resourceRoot, function ( ) addEventHandler ( "onPickupHit", pInfo, fnShow ); -- add handler of event 'onPickupHit' to fn 'fnShow' addCommandHandler ( "createinfo", fnCreateInfo ); -- add command 'createinfo' to fn 'fnCreateInfo' end ) function fnShow ( pPlayer ) outputChatBox ( "Welcome to Fort Carson Roleplay Server!", pPlayer ); -- output on chat some text cancelEvent(); end function fnCreateInfo ( pPlayer, chCommand, ... ) if ( ... ) then if ( exports['global']:isPlayerAdmin ( pPlayer ) ) then local nX, nY, nZ = getElementPosition ( pPlayer ); local chText = table.concat ( { ... }, " " ); pInfoPickup = createPickup ( nX, nY, nZ, 3, 1239, 0.1 ); setElementData ( pInfoPickup, "Message", chText ); setElementData ( pInfoPickup, "Pos", nX .. nY .. nZ ); addEventHandler ( "onPickupHit", pInfoPickup, infohit ); fnSaveInfo(); end else outputChatBox ( "SYNTAX: /" .. chCommand .. " [iNFO]", pPlayer, 255, 194, 14 ); end end function fnSaveInfo ( ) local message = getElementData ( pInfoPickup, "Message" ); local position = getElementData ( pInfoPickup, "Pos" ); exports['mysql']:query_free ( "INSERT INTO `infopoints` ( pos, message ) VALUES ( '" .. exports.mysql:escape_string(position) .. "', '" .. exports.mysql:escape_string(message) .. "' )" ); end function infohit(thePlayer) local message = getElementData( infopointpickup,"Message") outputChatBox("" .. message .."",thePlayer) end
  3. What Your Saying Is Nothing To Do With What Im Saying, The Script Works Fine Its JUst That I Dont Want To Make Tons Of Functions To Load Images So I Just Want To Load It All In One So i Can Type /drawimage troll.jpg or /drawimage nyancat.jpg
  4. Stan i mean like dxdrawimage for multiple images without making multiple functions like so i could do /drawimage troll.jpg or /drawimage nyancat.jpg Like that
  5. Well I Get A Unexpected .. Which i understand why its there because i put the .. image .. there ClientSide -- Image Drawing function drawimage(image) local screenWidth,screenHeight = guiGetScreenSize() dxDrawImage ( screenWidth/2 - 50, 50, 500, 500, ..image.. , 0, -120 ) end addEvent("drawImage", true) addEventHandler("drawImage" function () addEventHandler("onClientRender",root,drawimage) end ) addEvent("removeImage",true) addEventHandler("removeImage",root, function() removeEventHandler("onClientRender",root,drawimage) end ) Server Side -- Image Drawing CMDs addCommandHandler("drawimage", function(player) triggerClientEvent("drawImage",player) end ) addCommandHandler("removeimage", function(player) triggerClientEvent("removeImage",player) end )
  6. function maxpayne(thePlayer, command) if getGameSpeed() == 0.5 then setGameSpeed(1) outputChatBox("Max Payne Mode Off", thePlayer) else setGameSpeed(0.5) outputChatBox("Max Payne Mode On", thePlayer) end end addCommandHandler("maxpayne", maxpayne)
  7. Bad Argument at Line 5 @ setGameSpeed function maxpayne(thePlayer, command) if getGameSpeed == 1 then setGameSpeed(thePlayer, 0.5) outputChatBox("Max Payne Mode On", thePlayer) else setGameSpeed(thePlayer, 1) outputChatBox("Max Payne Mode Off", thePlayer) end end addCommandHandler("maxpayne", maxpayne)
  8. Lol nevermind but in the mysql database it only logs the X postion Not The Y Nor Z And how can i load things from mysql database?
  9. How do you load a table from MYSQL NOT SQLITE
  10. Thanks Draken But There Is A Error Aint Line 23 Because There Is No infohit function addEventHandler ( "onPickupHit", pInfoPickup, infohit );
  11. It Still Doesnt Export To The Database !!!!!!!!!!!!!!!!!!
  12. Well it doesnt save on the mysql database And I Get This Error mysql = exports.mysql infopoint = createPickup(-206.5537109375, 1132.1015625, 19.7421875, 3, 1239) -- ServerSide! function info (thePlayer) outputChatBox("Welcome To Fort Carson Roleplay Server",thePlayer) cancelEvent() end addEventHandler ( "onPickupHit", infopoint, info ) function createinfo(thePlayer, commandName, ...) if info then if (exports.global:isPlayerAdmin(thePlayer)) then local x,y,z = getElementPosition(thePlayer) local message = table.concat({...}, " ") infopointpickup = createPickup(x, y, z, 3, 1239, 0.1) setElementData( infopointpickup,"Message", message ) setElementData( infopointpickup,"Pos", x,y,z ) addEventHandler("onPickupHit", infopointpickup, infohit) end else outputChatBox("SYNTAX: /" .. commandName .. " [info]", thePlayer) end end addCommandHandler("createinfo", createinfo) function infohit(thePlayer) message = getElementData( infopointpickup,"Message") outputChatBox("" .. message .."",thePlayer) end function saveinfo() message = getElementData( infopointpickup,"Message") pos = getElementData( infopointpickup,"Pos") mysql:query_free('INSERT INTO infopoints (pos, message) VALUES ("' .. mysql:escape_string(pos) .. '", ' .. mysql:escape_string(message) .. ')') end
  13. Well i got some help making this script from blazy but i not 100% sure how to integrate it into MYSQL i think i have done it right but im not sure mysql = exports.mysql infopoint = createPickup(-206.5537109375, 1132.1015625, 19.7421875, 3, 1239) -- ServerSide! function info (thePlayer) outputChatBox("Welcome To Fort Carson Roleplay Server",thePlayer) cancelEvent() end addEventHandler ( "onPickupHit", infopoint, info ) function createinfo(thePlayer, commandName, ...) if info then if (exports.global:isPlayerAdmin(thePlayer)) then local x,y,z = getElementPosition(thePlayer) local message = table.concat({...}, " ") infopointpickup = createPickup(x, y, z, 3, 1239, 0.1) setElementData( infopointpickup,"Message", message ) addEventHandler("onPickupHit", infopointpickup, infohit) end else outputChatBox("SYNTAX: /" .. commandName .. " [info]", thePlayer) end end addCommandHandler("createinfo", createinfo) function infohit(thePlayer) message = getElementData( infopointpickup,"Message") outputChatBox("" .. message .."",thePlayer) end function saveinfo() message = getElementData( infopointpickup,"Message") mysql:query_free('INSERT INTO infopoints (pos, message) VALUES ("' .. mysql:escape_string(x, y, z) .. '", ' .. mysql:escape_string(message) .. ')') end
  14. Would This Work? infopoint = createPickup(-206.5537109375, 1132.1015625, 19.7421875, 3, 1239) -- ServerSide! function info (thePlayer) outputChatBox("Welcome To Fort Carson Roleplay Server",thePlayer) cancelEvent() end addEventHandler ( "onPickupHit", infopoint, info ) function createinfo(thePlayer, commandName, ...) if info then if (exports.global:isPlayerAdmin(thePlayer)) then local x,y,z = getElementPosition(thePlayer) local message = table.concat({...}, " ") infopointpickup = createPickup(x, y, z, 3, 1239, 0.1) setElementData( infopointpickup,"Message", message ) addEventHandler("onPickupHit", infopointpickup, infohit) end else outputChatBox("SYNTAX: /" .. commandName .. " [info]", thePlayer) end end addCommandHandler("createinfo", createinfo) function infohit(thePlayer) message = getElementData( infopointpickup,"Message") outputChatBox("" .. message .."",thePlayer) end function saveinfo() message = getElementData( infopointpickup,"Message") local checksaveinfo = fileCreate("infopoints.xml") if checksaveinfo then fileWrite(checksaveinfo,"Pos=" .. x, y, z .. "Msg=" .. message ..) end end
  15. Thanks Now I Must Find A Way So All The Infopoints I Create Dont Say The Same Text i Guess That Would Be Saving The Text Right? Would It Be Possible To Do it In A XML Instead Of MYSQL Because Im not The Best At MySQL Scripting, Could I Do it With Functions Like fileCreate, fileOpen And fileWrite
  16. Same Error As I Had Bad Argument Line 19 @ createPickup And The Pickup Doesnt Create, when you do /createinfo Hi but when you do /createinfo it makes the blip and you get unable to concatenate message a nil value because you havent set the message as i did /createinfo Thanks
  17. im trying to cancel the pickup from disappearing
  18. Yes I did know i had to save it but i wasnt quite sure how Any Idea's?
×
×
  • Create New...