Jump to content

proracer

Members
  • Posts

    499
  • Joined

  • Last visited

Everything posted by proracer

  1. Are you sure that png file is in the same folder as script and everything is correct? Check it again, as I see no error so far.
  2. proracer

    Need Help

    You don't need it if you are not remaking the whole model (eg. new spoilers, body rims, kits etc...).You just need 2 txd files.
  3. proracer

    Need Help

    So in your folder you must have , meta.xml, your map name, hunter.txd, infernus.txd. You can have either folder or rar/zip file. (sorry if I said wrong never tested rar but zip works for sure.) If you have any questions for script for skins just ask.
  4. It should work, any errors? ( Use '/debugscript 3' )
  5. addEventHandler("onPlayerWasted", getRootElement(), spawnToHospital) function spawnToHospital() local x,y,z = 1000, 1000, 0 -- enter hospital co-ordinates here spawnPlayer(source, x, y, z) end Try this.
  6. What are you trying to do? I have tested in my local server and no errors.
  7. You can try for a custom freeroam as its the easiest and it is has a very wide variety of what you can script in it.
  8. Sorry, I wanted to express the other way around. It should be vice-versa.First it should output message ' 2 + 2 = ? ' and if you type '4' it should say 'Correct!' EDIT: I have fixed it. -- Easy maths mathTableEasy = {} mathTableEasy[1] = "2 + 2 = ?" mathTableEasy[2] = "5 * 5 = ?" mathTableEasy[3] = "8 / 2 = ?" mathTableEasy[4] = "10 - 5 = ?" mathTableEasy[5] = "19 + 10 = ?" mathTableEasy[6] = "24 * 5 = ?" mathTableEasy[7] = "120 / 5 = ?" mathTableEasy[8] = "127 - 69 = ?" mathTableEasy[9] = "11 * 11 = ?" mathTableEasy[10] = "108 / 9 = ?" -- Mediocre maths mathTableMedium = {} mathTableMedium[1] = "39 + 28 = ?" mathTableMedium[2] = "43 - 52 = ?" mathTableMedium[3] = "29 * 6 = ?" mathTableMedium[4] = "240 / 15 = ?" mathTableMedium[5] = "Pi = ?" mathTableMedium[6] = "2 ^ 8 = ?" mathTableMedium[7] = "3 ^ 4 = ?" mathTableMedium[8] = "582 - 334 = ?" mathTableMedium[9] = "392 + 382 = ?" mathTableMedium[10] = "125 * 3 = ?" -- Hard maths mathTableHard = {} mathTableHard[1] = "3921 + 192 = ?" mathTableHard[2] ="2912 - 585 = ?" mathTableHard[3] = "273 * 4 = ?" mathTableHard[4] = "384 / 4 = ?" mathTableHard[5] = "Square root of 625 = ?" mathTableHard[6] = "Square root of 121 = ?" mathTableHard[7] = "Square root of 196 = ?" mathTableHard[8] = "Square root of 289 = ?" mathTableHard[9] = "100 ^ 3 = ?" mathTableHard[10] = "19295 + (-123 * 4) = ?" function mathQuestion() outputChatBox(tostring(mathTableEasy[1]), getRootElement(), 0, 91, 255) end function mathAnswer(message, messageType) if messageType == 0 and message == "4" then outputChatBox("Correct!") else outputChatBox("Incorrect!") end end addEventHandler("onPlayerChat", getRootElement(), mathAnswer) addEventHandler("onResourceStart", getRootElement(), mathQuestion) P.S. Really stupid
  9. -- Easy maths mathTableEasy = {} mathTableEasy[1] = "2 + 2 = ?" mathTableEasy[2] = "5 * 5 = ?" mathTableEasy[3] = "8 / 2 = ?" mathTableEasy[4] = "10 - 5 = ?" mathTableEasy[5] = "19 + 10 = ?" mathTableEasy[6] = "24 * 5 = ?" mathTableEasy[7] = "120 / 5 = ?" mathTableEasy[8] = "127 - 69 = ?" mathTableEasy[9] = "11 * 11 = ?" mathTableEasy[10] = "108 / 9 = ?" -- Mediocre maths mathTableMedium = {} mathTableMedium[1] = "39 + 28 = ?" mathTableMedium[2] = "43 - 52 = ?" mathTableMedium[3] = "29 * 6 = ?" mathTableMedium[4] = "240 / 15 = ?" mathTableMedium[5] = "Pi = ?" mathTableMedium[6] = "2 ^ 8 = ?" mathTableMedium[7] = "3 ^ 4 = ?" mathTableMedium[8] = "582 - 334 = ?" mathTableMedium[9] = "392 + 382 = ?" mathTableMedium[10] = "125 * 3 = ?" -- Hard maths mathTableHard = {} mathTableHard[1] = "3921 + 192 = ?" mathTableHard[2] ="2912 - 585 = ?" mathTableHard[3] = "273 * 4 = ?" mathTableHard[4] = "384 / 4 = ?" mathTableHard[5] = "Square root of 625 = ?" mathTableHard[6] = "Square root of 121 = ?" mathTableHard[7] = "Square root of 196 = ?" mathTableHard[8] = "Square root of 289 = ?" mathTableHard[9] = "100 ^ 3 = ?" mathTableHard[10] = "19295 + (-123 * 4) = ?" function mathQuestions(message, messageType) outputChatBox(tostring(mathTableEasy[1]), getRootElement(), 0, 91, 255) if messageType == 0 and message == "4" then outputChatBox("Correct!") else outputChatBox("Incorrect!") end end addEventHandler("onPlayerChat", getRootElement(), mathQuestions) It won't output message to the chatbox.
  10. You have to create a table first. alivePlayers = {} function Win(mapInfo) local alivePlayers = getAlivePlayers() info = mapInfo.modename if info == "Destruction derby" then if #alivePlayers == 1 then local playername = getPlayerName(alivePlayers[1]) local amount = math.random(1,9999) local money = getPlayerMoney ( source ) if ( money >= 0 ) then givePlayerMoney( source, amount ) outputChatBox(playername.." Win and give hem $"..amount.." !",getRootElement(),255,255,0) end end end addEventHandler("onPlayerWasted", getRootElement(), Win) Before you start the script, type ' /debugscript 3 ' and than start the script than tell us any errors found.
  11. I think you can first delete line 2 because it's unnenecesarry. Delete every "and's", you don't need it.
  12. Here it is an explanation what it is. http://en.wikipedia.org/wiki/Cuboid and MTASA function: https://wiki.multitheftauto.com/wiki/CreateColCuboid
  13. No, everything is made from scratch.Used MTA Wiki for little help of course
  14. lol, you really got him wrong.. i don't get how you can understand something like this when he actually wants to move a object o_O I thought by "opening doors" I instantly thought it's a vehicle.My bad then.
  15. I found how to use it on Wiki but not really clearly (not with SQL functions).I was trying to do it completely from scratch and changing played time from seconds to hours. I'm not really sure If it that is all correct but my main point is that I want to refresh join time every 5 seconds. Can I use a timer for it, because I'm not totally sure about messing with SQL functions. This will be created in the GUI. function createSQLTables() -- 1st table (Player Stats) executeSQLCreateTable( "PlayerStats", "HoursPlayed INT, PtsEarned INT, Rank INT, KmTraveledByFoot INT, KmTraveledByCar INT, KmTraveledByBike INT, KmTraveledByAircrafts INT, KmTraveledByBoat INT, serial STRING") -- 2nd table (Player Achievements) executeSQLCreateTable ( "PlayerAchievements", "EarnedAch INT, LeftAch INT, AchPts INT, serial STRING") -- 3rd table (Player Cash / Money) executeSQLCreateTable ( "PlayerCash", "EarnedCash INT, serial STRING") -- end of creating the tables end addEventHandler("onResourceStart", getResourceRootElement(), createSQLTables) function playerisReady(g_player) local serial = getPlayerSerial(g_player) local playername = getPlayerName(g_player) CheckPlayer = executeSQLSelect ("PlayerStats", "serial", "serial = '" ..serial.. "'") CheckPlayer2 = executeSQLSelect("PlayerAchievements", "serial", "serial = '" ..serial.. "'") CheckPlayer3 = executeSQLSelect("PlayerCash", "serial", "serial = '" ..serial.. "'") --- check the player now if (type(CheckPlayer) == "table" and #CheckPlayer == 0) or not CheckPlayer then executeSQLInsert ("PlayerStats", "'" ..serial.. "', '0', '0', '0', '0', '0', '0', '0', '0'") end if (type(CheckPlayer2) == "table" and #CheckPlayer2 == 0) or not CheckPlayer2 then executeSQLInsert ("PlayerAchievements", "'" ..serial.. "', '0', '0', '0'") end if (type(CheckPlayer3) == "table" and #CheckPlayer3 == 0) or not CheckPlayer3 then executeSQLInsert ("PlayerCash", "'" ..serial.. "', '0'") end end addEventHandler("onPlayerSpawn", getRootElement(), playerIsReady) --- #Hours Played -- saving element data function hoursPlayed() setElementData(source, "hoursPlayed", getTickCount()) end addEventHandler ("onPlayerSpawn", getRootElement(), hoursPlayed) -- main script function showHoursPlayed(source) local showHoursPlayed1 = executeSQLInsert ("PlayerStats", "HoursPlayed", "serial = '" ..serial.. "'") local timeOnline = (getTickCount() - getElementData(source, "hoursPlayed")) / 3600000 executeSQLUpdate("PlayerStats", "HoursPlayed = '" ..showHoursPlayed1.. "'", "serial = '" ..serial.. "'") end
  16. function openCarDoors() local createVeh = createVehicle(411, 1000, 1000, 1000) -- just thrown random coordinates --- setVehicleDoorState(createVeh, 2, 1) -- opens front left door --- end addEventHandler ("onResourceStart", getResourceRootElement(), openCarDoors) Not tested.
  17. The function "open door" does not exist unfornunately.
  18. proracer

    Math Money

    Could this work maybe function giveRandomMoney() local randomPlayer = getRandomPlayer() local randomMoney = math.random(1,1000) givePlayerMoney (randomPlayer, randomMoney) outputChatBox("*" ..randomPlayer.. "has won $" ..randomMoney.. "*", getRootElement(), 255,140,0) end addEventHandler("onResourceStart", getResourceRootElement, giveRandomMoney) setTimer(giveRandomMoney, 60000, 0)
  19. proracer

    Math Money

    I just gave him an example how it looks like.Because I don't know for what he wants to use 'givePlayerMoney' EDIT: I have a sense I have written a stupid non-explanatary code.
  20. I doubt you made this alone if you do not even know what is a debug script.
  21. proracer

    Math Money

    addEventHandler ("onPlayerJoin", getRootElement(), giveRandomMoney) function giveRandomMoney () local randomPlayer = getRandomPlayer ( ) randomMoney = math.random ( 1, 1000 ) givePlayerMoney ( randomPlayer, randomMoney ) outputChatBox ( '*' .. getPlayerName ( randomPlayer ) .. ' Has Won $' .. randomMoney .. ' !', getRootElement(), 255, 255, 0 ) end Just an a example for to give random money on every player who joins.I didn't tested so I'm not completely sure it's correct. But I think the main base is like that.
  22. Can you guys give me any hint that when player selects specific player and types in edit box and presses the 'send message' button it outputs message to him.I have tried searching some resources and looking into admin panel of how "shout" function works but it's too complicated for me.
  23. Oh jesus christ ^^ nice find thx it works now.I go sleep and later I'm gonna try that it outputs message to specific player
  24. Yeah lol... forgot it when I was changing something in code.The new code says that I have bad argument in the onClientGUIClick event. ---- Clientsided function cgui() local sWidth, sHeight = guiGetScreenSize() local Width,Height = 629,451 local X = (sWidth/2) - (Width/2) local Y = (sHeight/2) - (Height/2) GUIEditor_Button = {} GUIEditor_Edit = {} GUIEditor_Grid = {} showCursor(true,true) PM_Main_Window = guiCreateWindow(X,Y,Width,Height,"PM System by Pr0RaC3R v0.1 Alpha",false) guiWindowSetSizable(PM_Main_Window,false) GUIEditor_Grid[1] = guiCreateGridList(9,20,611,206,false,PM_Main_Window) GUIEditor_Edit[1] = guiCreateEdit(9,226,611,141,"",false,PM_Main_Window) guiEditSetMaxLength(GUIEditor_Edit[1],100) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) GUIEditor_Button[1] = guiCreateButton(181,379,240,56,"Send message",false,PM_Main_Window) local column = guiGridListAddColumn(GUIEditor_Grid[1],"Player Name",0.2) if (column) then for id,player in ipairs (getElementsByType("player")) do local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1],row,column,getPlayerName(player),false,false) addEventHandler("onClientGUIClick", GUIEditor_Button[1], playerPressButon) -- here is the event handler now end end end function playerPressButton (button,state,AbsoluteX,AbsoluteY) if (source == GUIEditor_Button[1]) then local text = guiGetText (GUIEditor_Edit[1]) outputChatBox(tostring(text)) end end addCommandHandler("pm",cgui)
×
×
  • Create New...