
micheal1230
Members-
Posts
390 -
Joined
-
Last visited
Everything posted by micheal1230
-
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)
-
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
-
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
-
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
-
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 )
-
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)
-
Mate that enables it for everyone
-
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)
-
Info Marker Script Doesnt Export To MYSQL Database
micheal1230 replied to micheal1230's topic in Scripting
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? -
How do you load a table from MYSQL NOT SQLITE
-
Info Marker Script Doesnt Export To MYSQL Database
micheal1230 replied to micheal1230's topic in Scripting
i Dont Understand -
Info Marker Script Doesnt Export To MYSQL Database
micheal1230 replied to micheal1230's topic in Scripting
Thanks Draken But There Is A Error Aint Line 23 Because There Is No infohit function addEventHandler ( "onPickupHit", pInfoPickup, infohit ); -
Info Marker Script Doesnt Export To MYSQL Database
micheal1230 replied to micheal1230's topic in Scripting
How do i do that? -
Info Marker Script Doesnt Export To MYSQL Database
micheal1230 replied to micheal1230's topic in Scripting
It Still Doesnt Export To The Database !!!!!!!!!!!!!!!!!! -
Info Marker Script Doesnt Export To MYSQL Database
micheal1230 replied to micheal1230's topic in Scripting
please give a example -
Info Marker Script Doesnt Export To MYSQL Database
micheal1230 replied to micheal1230's topic in Scripting
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 -
Info Marker Script Doesnt Export To MYSQL Database
micheal1230 replied to micheal1230's topic in Scripting
Lol vG -
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
-
I Guess Ill Use MYSQL
-
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
-
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
-
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
-
im trying to cancel the pickup from disappearing
-
Yes I did know i had to save it but i wasnt quite sure how Any Idea's?