Jump to content

Blueman

Members
  • Posts

    110
  • Joined

  • Last visited

Everything posted by Blueman

  1. Are you passably running another server on the same port or you may not have MS C++ redistributable.
  2. Good an honest mods yea right no one is good or honest.
  3. Ok and I made some last minute changes that you didn't catch. Works perfectly
  4. Ok my code is: function score () score2 = 0 score1 = 0 local score = textCreateDisplay() local csscore1 = textCreateTextItem ( "Terrorist: " .. score1 .. " |" , 0.5, 0.5 ) local csscore2 = textCreateTextItem ( "Resistance: " .. score2 .. " |" , 0.5, 0.5 ) textDisplayAddText ( score, csscore1 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), score ) function showscore() textDisplayAddObserver ( score, source ) end addEventHandler ( "onPlayerSpawn", getRootElement(), showscore ) It's not finished and I am aware that csscore 1 and 2 are overlapping. Images:
  5. Blueman

    Gui problem

    Sorry I fixed it myself and I was to busy to respond but thanks.
  6. I'm not sure what this is about but I get a bad argument error when using the following. textDisplayAddObserver ( score, source ) The text display score is added perfectly but showing it fails.
  7. Blueman

    Gui problem

    The point is to create a gui to set mili.pos in the users account to the specified value in the gui. But halfway in the scripting I had to find a way to allow a client side and a server side script to comunicate
  8. Blueman

    Gui problem

    Sure amd sorry about the double post addEvent ("Gen", true) addEvent ("Col", true) addEvent ("Rct", true) addEvent ("Pvt", true) addEvent ("Sgt", true) addEvent ("Dsgt", true) addEvent ("Ng", true) addEvent ("Mscr", true) addEvent ("Rem", true) local M1 = "Gen" local M2 = "Col" local M3 = "Rct" local M4 = "Pvt" local m5 = "Sgt" local m6 = "Dsgt" local M7 = "NG" local M8 = "Mscr" local M9 = "Banned" function start() MPlayeraccount = getPlayerAccount (source) MAccount = getAccountData ( MPlayeraccount, "mili.pos" ) end addEventHandler ("onClientResourceStart", getRootElement(), start) function Gen() setAccountData ( mtext, "mili.pos", M1 ) end addEventHandler ("Gen", getRootElement(), Gen) function Col() setAccountData ( mtext, "mili.pos", M2 ) end addEventHandler ("Col", getRootElement(), Col) function Rct() setAccountData ( mtext, "mili.pos", M3 ) end addEventHandler ("Rct", getRootElement(), Rct) function Pvt() setAccountData ( mtext, "mili.pos", M4 ) end addEventHandler ("Pvt", getRootElement(), Pvt) function Sgt() setAccountData ( mtext, "mili.pos", M5 ) end addEventHandler ("Sgt", getRootElement(), Sgt) function Dsgt() setAccountData ( mtext, "mili.pos", M6 ) end addEventHandler ("Dsgt", getRootElement(), Dsgt) function Ng() setAccountData ( mtext, "mili.pos", M7 ) end addEventHandler ("Ng", getRootElement(), Ng) function Mscr() setAccountData ( mtext, "mili.pos", M8 ) end addEventHandler ("Mscr", getRootElement(), Mscr) function Rem() setAccountData ( mtext, "mili.pos", m9 ) end addEventHandler ("Rem", getRootElement(), Rem )
  9. Blueman

    Gui problem

    Still nothing and my name happens to be meep I might try using runcode to set the mili.pos value in my account to Gen.
  10. Never thought of that thanks, I might use that in the future.
  11. Blueman

    Gui problem

    In the code below it happens that my gui won't show, I'm just wondering if i made a mistake in the code. I don't think it's the binds because I've tried using a command handler to open the gui and it fails as well. I receive no errors through the console though. function binds() //The variable MAccount is represented in another script CName = getPlayerName(getLocalPlayer()) if ( MAccount == "Gen" ) then bindKey ( CName, "I", "down", build_MainWindow ) else if ( CName == "meep" ) then bindKey ( CName, "I" "down", build_MainWindow ) else end end end addEventHandler ("onClientResourceStart", getRootElement(), binds) function build_MainWindow() local gui = {} gui._placeHolders = {} local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 251, 174 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 gui["_root"] = guiCreateWindow(left, top, windowWidth, windowHeight, "MainWindow", false) guiWindowSetSizable(gui["_root"], false) gui["lineEdit"] = guiCreateEdit(70, 125, 161, 20, "", false, gui["_root"]) guiEditSetMaxLength(gui["lineEdit"], 32767) gui["pushButton"] = guiCreateButton(0, 35, 75, 23, "General", false, gui["_root"]) if on_pushButton_clicked then addEventHandler("onClientGUIClick", gui["pushButton"], General, false) end gui["pushButton_2"] = guiCreateButton(80, 35, 75, 23, "Coloniel", false, gui["_root"]) if on_pushButton_2_clicked then addEventHandler("onClientGUIClick", gui["pushButton_2"], Coloniel, false) end gui["pushButton_3"] = guiCreateButton(0, 65, 75, 23, "Recruit", false, gui["_root"]) if on_pushButton_3_clicked then addEventHandler("onClientGUIClick", gui["pushButton_3"], Recruit, false) end gui["pushButton_4"] = guiCreateButton(80, 65, 75, 23, "Private", false, gui["_root"]) if on_pushButton_4_clicked then addEventHandler("onClientGUIClick", gui["pushButton_4"], Private, false) end gui["pushButton_5"] = guiCreateButton(160, 35, 75, 23, "Sargent", false, gui["_root"]) if on_pushButton_5_clicked then addEventHandler("onClientGUIClick", gui["pushButton_5"], Sargent, false) end gui["pushButton_6"] = guiCreateButton(160, 65, 75, 23, "DrillSargent", false, gui["_root"]) if on_pushButton_6_clicked then addEventHandler("onClientGUIClick", gui["pushButton_6"], DrillSargent, false) end gui["pushButton_7"] = guiCreateButton(0, 95, 75, 23, "NationalGaurd", false, gui["_root"]) if on_pushButton_7_clicked then addEventHandler("onClientGUIClick", gui["pushButton_7"], NationalGaurd, false) end gui["pushButton_8"] = guiCreateButton(80, 95, 75, 23, "MilitaryScripter", false, gui["_root"]) if on_pushButton_8_clicked then addEventHandler("onClientGUIClick", gui["pushButton_8"], MilitaryScripter, false) end gui["pushButton_9"] = guiCreateButton(160, 95, 75, 23, "Remove", false, gui["_root"]) if on_pushButton_9_clicked then addEventHandler("onClientGUIClick", gui["pushButton_9"], Remove, false) end gui["label"] = guiCreateLabel(0, 15, 46, 13, "Options:", false, gui["_root"]) guiLabelSetHorizontalAlign(gui["label"], "left", false) guiLabelSetVerticalAlign(gui["label"], "center") gui["label_2"] = guiCreateLabel(0, 125, 71, 16, "AccountName:", false, gui["_root"]) guiLabelSetHorizontalAlign(gui["label_2"], "left", false) guiLabelSetVerticalAlign(gui["label_2"], "center") return gui, windowWidth, windowHeight end function General() triggerServerEvent ("Gen", getLocalPlayer()) mtext = guiGetText ( editBoxgui["lineEdit"] ) function Coloniel() triggerServerEvent ("Col", getLocalPlayer()) mtext = guiGetText ( gui["lineEdit"] ) end function Recruit() triggerServerEvent ("Rct", getLocalPlayer()) mtext = guiGetText ( gui["lineEdit"] ) end function Private() triggerServerEvent ("Pvt", getLocalPlayer()) mtext = guiGetText ( gui["lineEdit"] ) end function Sargent() triggerServerEvent ("Sgt", getLocalPlayer()) mtext = guiGetText ( gui["lineEdit"] ) end function DrillSargent() triggerServerEvent ("Dsgt", getLocalPlayer()) mtext = guiGetText ( gui["lineEdit"] ) end function NationalGaurd() triggerServerEvent ("Ng", getLocalPlayer()) mtext = guiGetText ( gui["lineEdit"] ) end function MilitaryScripter() triggerServerEvent ("Mscr", getLocalPlayer()) mtext = guiGetText ( gui["lineEdit"] ) end function Remove() triggerServerEvent ("Rem", getLocalPlayer()) mtext = guiGetText ( gui["lineEdit"] ) end
  12. The MPlayer account is for the client side script but I see what I did wrong thanks.
  13. addEvent ("Gen", true) addEvent ("Col", true) addEvent ("Rct", true) addEvent ("Pvt", true) addEvent ("Sgt", true) addEvent ("Dsgt", true) addEvent ("Ng", true) addEvent ("Mscr", true) addEvent ("Rem", true) local M1 = "Gen" local M2 = "Col" local M3 = "Rct" local M4 = "Pvt" local m5 = "Sgt" local m6 = "Dsgt" local M7 = "NG" local M8 = "Mscr" local M9 = "Banned" MPlayeraccount = getPlayerAccount (source) MAccount = getAccountData ( MPlayeraccount, "mili.pos" ) function Gen() setAccountData ( mtext, "mili.pos", M1 ) end addEventHandler ("Gen", getRootElement(), Gen) function Col() setAccountData ( mtext, "mili.pos", M2 ) end addEventHandler ("Col", getRootElement(), Col) function Rct() setAccountData ( mtext, "mili.pos", M3 ) end addEventHandler ("Rct", getRootElement(), Rct) function Pvt() setAccountData ( mtext, "mili.pos", M4 ) end addEventHandler ("Pvt", getRootElement(), Pvt) function Sgt() setAccountData ( mtext, "mili.pos", M5 ) end addEventHandler ("Sgt", getRootElement(), Sgt) function Dsgt() setAccountData ( mtext, "mili.pos", M6 ) end addEventHandler ("Dsgt", getRootElement(), Dsgt) function Ng() setAccountData ( mtext, "mili.pos", M7 ) end addEventHandler ("Ng", getRootElement(), Ng) function Mscr() setAccountData ( mtext, "mili.pos", M8 ) end addEventHandler ("Mscr", getRootElement(), Mscr) function Rem() setAccountData ( mtext, "mili.pos", m9 ) end addEventHandler ("Rem", getRootElement(), Rem) A lil bit simple
  14. I was wondering if anyone can help me with this although I don't like asking for help alot. MPlayeraccount = getPlayerAccount (source) MAccount = getAccountData ( MPlayeraccount, "mili.pos" ) Uploaded with ImageShack.us If this helps the script contains 2 scripts A serversided script named milis.lua which is the one causing the error, and a client side script called milic.lua with no errors.
  15. I'm wanting some help touching up my script a bit to fix any possible errors I might have made. local x = 2026.935668953 local y = 1008.9664306641 local z = 14.663164138794 function spawn (prevA, curA, autoLogin) createTeam ( Owner, 255, 0, 0 ) createTeam ( Admin, 255, 0, 0 ) createTeam ( MegaDragon, 45, 150, 0 ) createTeam ( Regular, 0, 0, 150 ) spawnPlayer(source, x, y, z, spawnTeam) fadeCamera(source, true) setCameraTarget(source, source) giveWeapon(source, 22, 9000) outputChatBox("Please login to start playing", source) end addEventHandler("onPlayerLogin", getRootElement(), spawn) function playerDied(totalAmmo, killer, killerWeapon, bodypart) outputChatBox(getPlayerName(source).." died!") setTimer(spawnPlayer,1000,1,source, x, y, z) setTimer(fadeCamera,1000,1,source, true) setTimer(setCameraTarget,1000,1,source, source) giveWepon(source, 22, 9000) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart ) function playerDied(totalAmmo, killer, killerWeapon, bodypart) outputChatBox(getPlayerName(source).." died!") setTimer(spawnPlayer,1000,1,source, x, y, z) setTimer(fadeCamera,1000,1,source, true) setTimer(setCameraTarget,1000,1,source, source) end addEventHandler("onPlayerWasted",getRootElement(),playerDied) function OwnerAccount ( previous_account, current_account, auto-login ) if GetAccountName(current_account) == "Dragon" then setPlayerTeam" class="kw6">setPlayerTeam(soruce, Owner) setPlayerNametagText ( soruce, "Owner" ) else setPlayerTeam" class="kw6">setPlayerTeam(source, Regular) end end addEventHandler("onPlayerLogin",getRootElement(),OwnerAccount) So far I haven't found any errors but I'm pretty sure I could shrink this script. It's also been untested I'll be testing it while i'm waiting for a response.
  16. Thanks i'm using version1.0.4 I'll update The latest server version is 1.0.5 My gta sa version is 1.0 dose that make a difference.
  17. Thanks i'm using version1.0.4 I'll update
  18. A new error has come up it seems to be aqward it works every now and then then stops and gives errors.
  19. When testing a script I made I encountered the following error. Why this error pops up is unknown to me, Some help would be appriciated. My code Function NS() setTrafficLightState ( string green, string red ) Function EW() setTraffivLightState ( string red, string green ) end addCommandHandler ( "NSgreenlight", NS ) addCommandHandler ( "EWgreenlight", EW ) It's not my meta.xml so i'm not gonna post that unleass it's absolutely necesary I guess.
  20. This is an affect that seems to happen when you shoot rockets rapidly into the air. It apears to flash like a strobe, Test for yourself. image failed
  21. I wasn't lying but thanks, I probrably had something else running that might have to do with respawning.
×
×
  • Create New...