Jump to content

micheal1230

Members
  • Posts

    390
  • Joined

  • Last visited

Everything posted by micheal1230

  1. What do you mean more info? and yes im trying to do what you said
  2. Why are you making a bleeding script, roleplay scripts already have it
  3. Would Be Better To Use -- ServerSide Script addEventHandler("onResourceStart",getRootElement(), function () local myTrain = createVehicle(537,1995,-1949,13) -- Create the train setTrainDirection(myTrain, true) -- Make the train drive clockwise setTrainSpeed(myTrain, 1) -- Speed up end )
  4. Mate Your Could Make The GUI With The guieditor resource from the MTA Community Website And Then All You Would Have To Do Is Script The Rest
  5. Well Im Trying To Set The Players Number As The Item Value Of The Phone But It Does'nt Work It Is In The Correct Column And It Fails To Give The Item elseif(shop_type == -- s8) --> then local phonenumber = getElementData(localPlayer, "cellnumber") item = { {"Ghettoblaster","A black ghettoblaster.", "250", 54, 1, 1, false,10}, {"Katana", "Your favourite Japanese sword.", "2500", 8, 1, 1,true,100}, {"Camera", "A small black analogue camera.", "75", 43, 25,1,true, 30}, {"Cellphone", "A stylish, slim cell phone.", "75", 2, phonenumber,1,false,50}, {"Radio", "A black radio.", "50", 6, 1,1,false,30}, {"Earpiece", "An earpiece that can be used with an radio.", "225", 88, 1,1,false,60}, {"Watch", "Telling the time was never so sexy!", "25", 17, 1, 1,false,10}, {"MP3 Player", "A white, sleek looking MP3 Player. The brand reads EyePod.", "120", 19, 1,1,false,7}, {"Chemistry Set", "A small chemistry set.", "2000", 44, 1,1,false,15}, {"Safe", "A Safe to store your items in.", "300", 60, 1,1,false,0}, {"Portable TV", "A portable TV to watch the TV.", "750", 104, 1, 1, false, 350}, {"Breathalizer","A small black breathalizer.", "350", 53, 1, 1, false,10}, {"Card Deck","A card deck to play some fun games.", "20", 77, 1, 1, false,10}, {"Glowstick","A green glowstick.", "70", 28, 1, 1, false,10}, {"PDA","A PDA you can use to browse the internet and check your emails.", "1000", 96, 1, 1, false,10}, {"Electric lock","An anti theft electric lock.", "5000", 119, 1, 1, false,2000}, {"GPS","Use it to help you get around.", "150", 67, 1, 1, false,10} }
  6. Oh so elseif is like the else for if?
  7. I Dont Understand Elseif Error: The Error Would Be A Line 52 This is Just A Snipit Of The Whole Script function globalOOC(thePlayer, commandName, ...) local logged = tonumber(getElementData(thePlayer, "loggedin")) if (logged==1) then if not (...) then outputChatBox("SYNTAX: /" .. commandName .. " [Message]", thePlayer, 255, 194, 14) else local oocEnabled = exports.global:getOOCState() message = table.concat({...}, " ") local muted = getElementData(thePlayer, "muted") if (oocEnabled==0) and not (exports.global:isPlayerAdmin(thePlayer)) then outputChatBox("OOC Chat is currently disabled.", thePlayer, 255, 0, 0) elseif (muted==1) then outputChatBox("You are currenty muted from the OOC Chat.", thePlayer, 255, 0, 0) else local players = exports.pool:getPoolElementsByType("player") local playerName = getPlayerName(thePlayer) local playerID = getElementData(thePlayer, "playerid") exports.logs:logMessage("[OOC: Global Chat] " .. playerName .. ": " .. message, 1) for k, arrayPlayer in ipairs(players) do local logged = tonumber(getElementData(arrayPlayer, "loggedin")) local targetOOCEnabled = getElementData(arrayPlayer, "globalooc") local adminlevel = exports.global:getPlayerAdminLevel(thePlayer) local gmlevel = exports.global:getPlayerGMLevel(thePlayer) title = exports.global:getPlayerAdminTitle(thePlayer) gmtitle = exports.global:getPlayerGMTitle(thePlayer) if adminlevel >= 4 then color = "#CC0000" else color = "#00ff00" end if gmlevel >= 4 then color1 = "#CC0000" else color1 = "#00ff00" end if adminlevel == 0 or getElementData(thePlayer,"hiddenadmin") == 1 then title = false end if exports.global:getPlayerDonatorLevel(thePlayer) > 0 and exports.global:getPlayerAdminLevel(thePlayer) == 0 and exports.global:getPlayerGMLevel(thePlayer) == 0 then color = "#CC9933" title = "Donator" end if (logged==1) and (targetOOCEnabled==1) then if title and color then outputChatBox("(( [GOOC] (" .. playerID .. ") ["..color.."" ..title.. "#ffe4c4] " .. playerName .. ": " .. message.." ))",arrayPlayer, 255,228,196,true) else outputChatBox("(( [GOOC] (" .. playerID .. ") " .. playerName .. ": " .. message.." ))", arrayPlayer, 255,228,196,true) elseif gmtitle and color1 then outputChatBox("(( [GOOC] (" .. playerID .. ") ["..color1.."" ..gmtitle.. "#ffe4c4] " .. playerName .. ": " .. message.." ))",arrayPlayer, 255,228,196,true) end end end end end end end addCommandHandler("o", globalOOC, false, false) addCommandHandler("GlobalOOC", globalOOC)
  8. There are lots of Rp scripts around you just gotta look i can give them to you for free Filip
  9. Lol forgot To Remove that thanks It Works Now
  10. [14:46:12] Callum Jones [CJDeltaHosting]: Mixxt and me. [14:46:14] Callum Jones [CJDeltaHosting]: Were jailed. [14:46:19] Callum Jones [CJDeltaHosting]: Becuase Pablo went /blowveh [14:46:28] Callum Jones [CJDeltaHosting]: Now, Your gonna loose users. [14:46:29] Harry Haws: You Where Gluing To Vehicles And Killing People [14:46:29] Callum Jones [CJDeltaHosting]: Not only that. [14:46:34] Callum Jones [CJDeltaHosting]: But MTA also know. [14:46:38] Callum Jones [CJDeltaHosting]: I sent in a report. [14:46:44] Callum Jones [CJDeltaHosting]: Now. [14:46:48] Callum Jones [CJDeltaHosting]: You have 2 options. [14:46:53] Callum Jones [CJDeltaHosting]: Either deal with abusers. [14:46:59] Callum Jones [CJDeltaHosting]: Or MTA will know. [14:47:04] Callum Jones [CJDeltaHosting]: and they will take ction. [14:47:04] Callum Jones [CJDeltaHosting]: Action. [14:47:12] Callum Jones [CJDeltaHosting]: Other RP servers are already into this., [14:47:18] Callum Jones [CJDeltaHosting]: I'm talking with them now.
  11. New Error: Client: local changenameped = createPed(57,359.1533203125, 172.3720703125, 1008.3828125) setElementData(changenameped, "talk", 1) setPedRotation(changenameped, 267) setElementDimension(changenameped, 2) setElementInterior(changenameped, 3) setElementData(changenameped, "name", "Joe Micheals") setElementFrozen(changenameped, true) GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Window1 = guiCreateWindow(589,254,211,117,"Change Name",false) GUIEditor_Label1 = guiCreateLabel(30,26,162,18,"Format: Firstname_Lastname",false,GUIEditor_Window1) guiLabelSetColor(GUIEditor_Label1,255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label1,"top") guiLabelSetHorizontalAlign(GUIEditor_Label1,"left",false) GUIEditor_Edit1 = guiCreateEdit(30,47,152,20,"",false,GUIEditor_Window1) GUIEditor_Button1 = guiCreateButton(27,78,82,27,"Change Name",false,GUIEditor_Window1) GUIEditor_Button2 = guiCreateButton(113,78,82,27,"Cancel",false,GUIEditor_Window1) function hidename() guiSetVisible(GUIEditor_Window1, false) guiSetVisible(GUIEditor_Label1, false) guiSetVisible(GUIEditor_Edit1, false) guiSetVisible(GUIEditor_Button1, false) guiSetVisible(GUIEditor_Button2, false) showCursor ( false ) end addEventHandler( "onClientResourceStart", getRootElement(), hidename) function hidename1() guiSetVisible(GUIEditor_Window1, false) guiSetVisible(GUIEditor_Label1, false) guiSetVisible(GUIEditor_Edit1, false) guiSetVisible(GUIEditor_Button1, false) guiSetVisible(GUIEditor_Button2, false) showCursor ( false ) end addEventHandler( "onClientGUIClick", GUIEditor_Button2, hidename1) function showchangename () guiSetVisible(GUIEditor_Window1, true) guiSetVisible(GUIEditor_Label1, true) guiSetVisible(GUIEditor_Edit1, true) guiSetVisible(GUIEditor_Button1, true) guiSetVisible(GUIEditor_Button2, true) --- Yes/No Window Toggle guiSetVisible(greetingWindow1, false) guiSetVisible(yes1, false) guiSetVisible(no1, false) showCursor ( true ) end function disappeargreet() guiSetVisible(greetingWindow1, false) guiSetVisible(yes1, false) guiSetVisible(no1, false) end addEventHandler('onClientGUIClick',GUIEditor_Button1, function() triggerServerEvent('anEvent',localPlayer,guiGetText(GUIEditor_Edit1)) end ) function cBeginGUI1() local lplayer = getLocalPlayer() triggerServerEvent("platePedTalk1", lplayer, 1) local width, height = 100, 50 local scrWidth, scrHeight = guiGetScreenSize() local x = scrWidth/2 - (width/2) local y = scrHeight/2 - (height/2) greetingWindow1 = guiCreateWindow(x, y, width, height, "Are You?", false) local width2, height2 = 10, 10 local x = scrWidth/2 - (width2/2) local y = scrHeight/2 - (height2/2) --Buttons yes1 = guiCreateButton(0.10, 0.50, 0.30, 0.50, "Yes", true, greetingWindow1) addEventHandler("onClientGUIClick", yes1, showchangename) --Buttons no1 = guiCreateButton(0.60, 0.50, 0.30, 0.50, "No", true, greetingWindow1) addEventHandler("onClientGUIClick", no1, disappeargreet) --Quick Settings guiWindowSetSizable(greetingWindow1, false) guiWindowSetMovable(greetingWindow1, true) guiSetVisible(greetingWindow1, true) showCursor(true) end addEvent("cBeginPlate1", true) addEventHandler("cBeginPlate1", getRootElement(), cBeginGUI1) Server: mysql = exports.mysql function pedTalk1(state) if (state == 1) then exports.global:sendLocalText(source, "Joe Micheals says: Welcome! Would You Like To Change Your Name Today?", nil, nil, nil, 10) exports.global:sendLocalText(source, "Joe Micheals says: It Will Cost 20,000$ To Change", nil, nil, nil, 10) end end addEvent("platePedTalk1", true) addEventHandler("platePedTalk1", getRootElement(), pedTalk1) addEvent('anEvent',true) function changename(text) local newName = table.concat({text}, "_") if newName == source then outputChatBox( "The player's name is already that.", source, 255, 0, 0) else local dbid = getElementData(getPlayerFromName(source), "dbid") local result = mysql:query("SELECT charactername FROM characters WHERE charactername='" .. mysql:escape_string(newName) .. "' AND id != " .. mysql:escape_string(dbid)) if (mysql:num_rows(result)>0) then outputChatBox("This name is already in use.", source, 255, 0, 0) else exports['anticheat-system']:changeProtectedElementDataEx(source, "legitnamechange", 1) local name = setPlayerName(source, tostring(newName)) if (name) then if getPlayerNametagText(source) ~= "Unknown Person" then setPlayerNametagText(source, tostring(newName):gsub("_", " ")) end exports['cache']:clearCharacterName( dbid ) mysql:query_free("UPDATE characters SET charactername='" .. mysql:escape_string(newName) .. "' WHERE id = " .. mysql:escape_string(dbid)) triggerClientEvent(source, "updateName", source, getElementData(source, "dbid")) exports.global:takeMoney(source, 20000) else outputChatBox("Failed to change name.", source, 255, 0, 0) end exports['anticheat-system']:changeProtectedElementDataEx(source, "legitnamechange", 0) end mysql:free_result(result) end end addEventHandler('anEvent',root,changename) addEvent("change",true) function Changename1(text) setPlayerNametagText(source, text) end addEventHandler('change',root,Changename1)
  12. myonlake This Is To Help People With There Script Not To Complain About vG Code Plus I typed Most Of It Myself Im Just using the vG part to export to the mysql and stuff cuz i have had problems with exporting data to the mysql before
  13. Anyone?? Not Even Soildsnake14
  14. Well Here Is The Error: Client: local changenameped = createPed(57,359.1533203125, 172.3720703125, 1008.3828125) setElementData(changenameped, "talk", 1) setPedRotation(changenameped, 267) setElementDimension(changenameped, 2) setElementInterior(changenameped, 3) setElementData(changenameped, "name", "Joe Micheals") setElementFrozen(changenameped, true) GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Window1 = guiCreateWindow(589,254,211,117,"Change Name",false) GUIEditor_Label1 = guiCreateLabel(30,26,162,18,"Format: Firstname_Lastname",false,GUIEditor_Window1) guiLabelSetColor(GUIEditor_Label1,255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label1,"top") guiLabelSetHorizontalAlign(GUIEditor_Label1,"left",false) GUIEditor_Edit1 = guiCreateEdit(30,47,152,20,"",false,GUIEditor_Window1) GUIEditor_Button1 = guiCreateButton(27,78,82,27,"Change Name",false,GUIEditor_Window1) GUIEditor_Button2 = guiCreateButton(113,78,82,27,"Cancel",false,GUIEditor_Window1) function hidename() guiSetVisible(GUIEditor_Window1, false) guiSetVisible(GUIEditor_Label1, false) guiSetVisible(GUIEditor_Edit1, false) guiSetVisible(GUIEditor_Button1, false) guiSetVisible(GUIEditor_Button2, false) showCursor ( false ) end addEventHandler( "onClientResourceStart", getRootElement(), hidename) function hidename1() guiSetVisible(GUIEditor_Window1, false) guiSetVisible(GUIEditor_Label1, false) guiSetVisible(GUIEditor_Edit1, false) guiSetVisible(GUIEditor_Button1, false) guiSetVisible(GUIEditor_Button2, false) showCursor ( false ) end addEventHandler( "onClientGUIClick", GUIEditor_Button2, hidename1) function showchangename () guiSetVisible(GUIEditor_Window1, true) guiSetVisible(GUIEditor_Label1, true) guiSetVisible(GUIEditor_Edit1, true) guiSetVisible(GUIEditor_Button1, true) guiSetVisible(GUIEditor_Button2, true) --- Yes/No Window Toggle guiSetVisible(greetingWindow1, false) guiSetVisible(yes1, false) guiSetVisible(no1, false) showCursor ( true ) end function disappeargreet() guiSetVisible(greetingWindow1, false) guiSetVisible(yes1, false) guiSetVisible(no1, false) end addEventHandler('onClientGUIClick',GUIEditor_Button1, function() triggerServerEvent('anEvent',localPlayer,guiGetText(GUIEditor_Edit1)) end ) function cBeginGUI1() local lplayer = getLocalPlayer() triggerServerEvent("platePedTalk1", lplayer, 1) local width, height = 100, 50 local scrWidth, scrHeight = guiGetScreenSize() local x = scrWidth/2 - (width/2) local y = scrHeight/2 - (height/2) greetingWindow1 = guiCreateWindow(x, y, width, height, "Are You?", false) local width2, height2 = 10, 10 local x = scrWidth/2 - (width2/2) local y = scrHeight/2 - (height2/2) --Buttons yes1 = guiCreateButton(0.10, 0.50, 0.30, 0.50, "Yes", true, greetingWindow1) addEventHandler("onClientGUIClick", yes1, showchangename) --Buttons no1 = guiCreateButton(0.60, 0.50, 0.30, 0.50, "No", true, greetingWindow1) addEventHandler("onClientGUIClick", no1, disappeargreet) --Quick Settings guiWindowSetSizable(greetingWindow1, false) guiWindowSetMovable(greetingWindow1, true) guiSetVisible(greetingWindow1, true) showCursor(true) end addEvent("cBeginPlate1", true) addEventHandler("cBeginPlate1", getRootElement(), cBeginGUI1) Server: mysql = exports.mysql function pedTalk1(state) if (state == 1) then exports.global:sendLocalText(source, "Joe Micheals says: Welcome! Would You Like To Change Your Name Today?", nil, nil, nil, 10) exports.global:sendLocalText(source, "Joe Micheals says: It Will Cost 20,000$ To Change", nil, nil, nil, 10) end end addEvent("platePedTalk1", true) addEventHandler("platePedTalk1", getRootElement(), pedTalk1) addEvent('anEvent',true) function changename(thePlayer, text) local newName = table.concat({text}, "_") if newName == thePlayer then outputChatBox( "The player's name is already that.", thePlayer, 255, 0, 0) else local dbid = getElementData(thePlayer, "dbid") local result = mysql:query("SELECT charactername FROM characters WHERE charactername='" .. mysql:escape_string(newName) .. "' AND id != " .. mysql:escape_string(dbid)) if (mysql:num_rows(result)>0) then outputChatBox("This name is already in use.", thePlayer, 255, 0, 0) else exports['anticheat-system']:changeProtectedElementDataEx(thePlayer, "legitnamechange", 1) local name = setPlayerName(thePlayer, tostring(newName)) if (name) then if getPlayerNametagText(thePlayer) ~= "Unknown Person" then setPlayerNametagText(thePlayer, tostring(newName):gsub("_", " ")) end exports['cache']:clearCharacterName( dbid ) mysql:query_free("UPDATE characters SET charactername='" .. mysql:escape_string(newName) .. "' WHERE id = " .. mysql:escape_string(dbid)) triggerClientEvent(thePlayer, "updateName", thePlayer, getElementData(thePlayer, "dbid")) exports.global:takeMoney(thePlayer, 20000) else outputChatBox("Failed to change name.", thePlayer, 255, 0, 0) end exports['anticheat-system']:changeProtectedElementDataEx(thePlayer, "legitnamechange", 0) end mysql:free_result(result) end end addEventHandler('anEvent',root,changename)
  15. Nevermind im just stupid and didnt put server.lua in the meta
  16. Is It Possible To Get The Text Inside The GUI From Clientside For A Serverside Function For Example Im Creating A Change Name Script Which Changes The Players Name When Types It Into A GUI Edit Box And Clicks Change Name, How Can I Get The Text From The GUI Element Edit Box And Take It To Serverside For A MYSQL Export??
  17. Teleport Guess I Will Have To Fix It Myself
  18. You Could Use setElementRotation
  19. WTF Lloyd You cant script Its Me Harry
×
×
  • Create New...