Jump to content

GanJaRuleZ

Members
  • Posts

    298
  • Joined

  • Last visited

Everything posted by GanJaRuleZ

  1. This is client side.. function Columns() exports.scoreboard:scoreboardAddColumn("TimePlayed") setElementData(localPlayer,"TimePlayed",0) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), Columns) serverside function start () executeSQLCreateTable("TimePlayed", "serial STRING, TimePlayed INT") end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), start) function addASecond() local serial = getPlayerSerial(player) local oldData = executeSQLSelect( "TimePlayed", "TimePlayed","serial = '" .. serial .. "'") newData = tonumber(oldData[1]["TimePlayed"]) + 1 setElementData(alivePlayers[1],"TimePlayed",tonumber(getElementData(player,"TimePlayed"))+1) executeSQLUpdate ( "TimePlayed", "TimePlayed = '"..newData.."'","serial = '" .. serial .. "'") end end end setTimer ( addASecond, 1000, 9999999 ) @EDIT : It isnt tested
  2. You mean to add time played in the scoreboard?
  3. WTF are unban request of a arabic server doing in a mta scripting section o.0 Bazoookaaa , go to their forum not here ! This section is for scripting-only
  4. Hi allz , again.. , I have a problem with the gui from RaceUserPanel script : Window = {} TabPanel = {} Tab = {} Label = {} userPanelWindow = guiCreateWindow(98,223,436,291,"@@@@@@ UserPanel",false) TabPanel = guiCreateTabPanel(9,21,263,29,false,userPanelWindow) tab1 = guiCreateTab("User",TabPanel) tab2 = guiCreateTab("Crew",TabPanel) tab3 = guiCreateTab("Map",TabPanel) tab4 = guiCreateTab("@@@@@",TabPanel) tab5 = guiCreateTab("Credits",TabPanel) image1 = guiCreateStaticImage(224,56,201,197,"images/title.png",false,tab1) label1 = guiCreateLabel(11,69,189,17,"Name :",true,tab1) label2 = guiCreateLabel(10,95,167,17,"Total Wins :",true,tab1) label3 = guiCreateLabel(8,120,209,21,"Total Loses :",true,tab1) label4 = guiCreateLabel(10,256,418,17,"Serial :",true,tab1) label5 = guiCreateLabel(17,67,101,16,"@@@@@",true,tab2) label6 = guiCreateLabel(23,105,90,15,"@@@@@",true,tab2) label7 = guiCreateLabel(23,126,80,14,"@@@@@",true,tab2) label8 = guiCreateLabel(23,146,101,17,"@@@@@",true,tab2) label9 = guiCreateLabel(23,168,107,15,"@@@@@",true,tab2) label10 = guiCreateLabel(23,191,80,14,"@@@@@",true,tab2) label11 = guiCreateLabel(23,213,80,14,"@@@@@",true,tab2) label12 = guiCreateLabel(22,234,80,14,"@@@@@",true,tab2) label13 = guiCreateLabel(22,258,80,14,"@@@@",true,tab2) label14 = guiCreateLabel(177,69,82,16,"@@@@@",true,tab2) label15 = guiCreateLabel(170,99,85,17,"@@@@@",true,tab2) label16 = guiCreateLabel(328,71,93,17,"@@@@",true,tab2) label17 = guiCreateLabel(325,100,108,18,"@@@@@",true,tab2) label18 = guiCreateLabel(323,123,109,17,"@@@@@",true,tab2) function onresourceStart () bindKey ("F7", "down", showUserPanel) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) function showUserPanel () getVisible = guiGetVisible (userPanelWindow) if (getVisible == true) then guiSetVisible (userPanelWindow, false) showCursor (false) end if (getVisible == false) then guiSetVisible (userPanelWindow, true) showCursor (true) local serial = getPlayerSerial(source) local wins = getElementData(source, "RaceWins") local loses = getElementData(source, "RaceLoses") local playerName = getPlayerName(source) if loses and wins then guiSetText ( label1, "Name: " .. playerName .. " " ) guiSetText ( label2, "Total Wins:" .. wins .. " " ) guiSetText ( label3, "Total Loses: " .. loses .. " " ) guiSetText ( label4, "Serial : " .. serial .. " " ) else guiSetText ( label2, "Total Wins: 0 " ) guiSetText ( label3, "Total Loses: 0 " ) end end end The errors are : WARNING: userpanel\client.lua:82: Bad Argument @ 'getElementData' [ Expected element at argument 1 , got nil] WARNING: userpanel\client.lua:83: Bad Argument @ 'getElementData' [ Expected element at argument 1 , got nil] WARNING: userpanel\client.lua:84: Bad Argument @ 'getPlayerName' [ Expected player at argument 1 , got nil] and The labels arent visibile Can anyone help me ? Thanks in advance
  5. Hi all I just want to know , if there exist a function , that says if a player ( registered ) is online.. Thank you in advance
  6. setAccountData actually uses database to store stuff.. So it won't get lost It should be the same database where registered accounts are stored As i said , sorry if im wrong , im just new in scripting
  7. No problem Congratz one more time
  8. Nice ! Continue working but i have a suggestion.. I see that the smoke goes just in 2 direction , make it in more directions . (If im not wrong the directions are NW - Nord-West)
  9. Ye just that you'll need , but if you want to restart the server , all the data will be losed , so i strongly recommend to save them into a db (database) . (Sorry if I'm wrong , but as far i know , the Data will be losed when the server will be restarted )
  10. Hi , maybe i can help The function to get the time spent on the server is getTickCount This function returns amount of time that your system has been running in milliseconds If you want to save it , you'll need the following functions executeSQLCreateTable("NAME", "STRING, INT") --INT is what is contains--> executeSQLSelect ( string tableName, string fields, [ string conditions, int limit ] ) --Here you will select the db executeSQLUpdate ( string tableName, string set, [ string conditions ] ) --It updates the current table If you will need an example , just announce me Good Luck with the scripting @Edit: if you want to get he's time , from when he logins in , until he quit (or he logged out) use onPlayerLogin --and onPlayerQuit --For until he quit onPlayerLogout --for until he loggout I hope i helped you
  11. Can you give me a example? Im pretty new in scripting Thank you... @EDIT : yeap , i made it working , i remove all the scripts , cuz i dont want someone to steal it until the final version P.S: The final version will be released as public resource in community tab! Thanks all , i will put special thanks , with ur names guys , thank you once more!
  12. Hai , thank you but it give me the following error : ERROR: userpnael/Stats.lua:22: attempt to concatenate local 'loses; < a boolean value > (here the line is 21 ) This error gives in the following script --Removed! Thanks in advance
  13. Where its 'lua'? And yes thats the whole script
  14. STATS.LUA: --Removed! SERVER.LUA --Removed!
  15. Finally i got it run but it gives the following errors : ERROR: userpanel\stats.lua:22: attempt to concatenate local 'lua' ERROR:userpanel\server.lua:19: attempt to perform arithmetic on a nil value PS: Don't get mad on me , please I'm new in scripting
  16. Heh , yeah i got it now Thanks
  17. Last problem : I edited it and it gives the following thing : ERROR:userpanel/server.lua:16: attemp to call global 'rootElement' at the same script thanks you both in advance
  18. Thanks you both I've got the problem..
  19. heh , thanks im just a beginer in scripting As i said , im just a begginer in scripting , so sorry for these noob questions @got the problem
  20. Hai allz I have a problem with the following script - When i start it , it gives the following error : SCRIPT ERROR: userpanel/Stats.lua:35: 'end' expected near Can anybody help?
  21. It happens every time a player gets hunter I want it to say just one time , not hundred times..
  22. Hey all , i'm a new scripter... I've got a script originaly made by fdc-invincible This script is called hunter_alert But there it's a problem... When some one got hunter it says once , when the second got the hunter , then it says again and so on. It causes a very big spam. Can anyone to make it say just one time? Here its the script! function someoneReachedHunter(number, sort, model) if sort == "vehiclechange" and model == 425 then outputChatBox ( getPlayerName(source).." #FF6464has gotten the hunter! Run!", getRootElement(), 255, 255, 255, true ) end end addEvent("onPlayerPickUpRacePickup",true) addEventHandler("onPlayerPickUpRacePickup",getRootElement(),someoneReachedHunter) --end Thanks to everyone who helps me
×
×
  • Create New...