Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. try this, addEventHandler("onPlayerWasted", getRootElement(), function(ammo, killer) if getElementType(killer) == "player" then outputChatBox(getPlayerName(killer).." has just killed you!", source, 0, 255, 0) end end )
  2. hey, i've got a problem with a script of account data dunno why it keeps saying bad argument at triggerClientEvent and all seems fine, here is a piece of my code, function onLoginStuff() local acc = getPlayerAccount ( source ) local zombieKills = getAccountData(acc, "zombieKills") if (tonumber(getAccountData (acc,"level")) == 1) then killsTimer = setTimer (function ( ) local killsData = getAccountData(acc,"zombieKills") triggerClientEvent(source,"updateKills",source,killsData,100) end,1000,0) elseif (tonumber(getAccountData (acc,"level")) == 2) then killsTimer = setTimer (function ( ) local killsData = getAccountData(acc,"zombieKills") triggerClientEvent(source,"updateKills",source,killsData,200) end,1000,0) end end addEventHandler( "onPlayerLogin", getRootElement(), onLoginStuff)
  3. this is stolen do you understand me ?? i remade the GUI but now MTA crash i will not stole it .. he said Please post the server side part, since its already on community there is no problem of post it right?
  4. please don't steal my credits this userpanel its made by me (Castillo), i really hate those who steal the credits.
  5. use [lua][/lua] tags please, it makes the code more redeable.
  6. why you don't use onClientRender since the script its client side, player = getLocalPlayer() x,y,z = getElementPosition (player) function updateCamera () x,y,z = getElementPosition (player) setPedAimTarget (player,x,y+100,z) rx,ry,rz = getPedTargetEnd (player) setPedAimTarget (player,rx,ry+100,rz+0.7) setCameraMatrix (x+0.5,y-0.5,z+0.7,rx-0.1,ry,z+0.4) end addEventHandler("onClientRender",getRootElement(),updateCamera) for me i think its much better
  7. Castillo

    buy

    I guess what he wants its to be like a list of all maps from server (only race of course) and then when you click buy it will set to next map.
  8. Castillo

    nemesis

    i've got a big problem, i added 2 peds as shopers but that starts to mess with zombies resource from slothman, is this a bug or?
  9. well i guess if you wanted to make the HUD like GTA IV you must make it by yourself
  10. Castillo

    nemesis

    yea using "slothbot" was my first idea dunno why i leaved it, so well i will give it a try, thanks.
  11. Castillo

    nemesis

    hi, i've got a problem making a cool nemesis, i made it and imported his txd,dff files into a object and attached it to a ped i created but my problem is, how i can make the ped move around and this way nemesis object will move with him also, if someone can tell me i will appreciate it, Tanks in advance.
  12. that won't work if i'm right, i've made a fully race userpanel for a friend and added that also, here is the code function hunterAlert(mapInfo, pickupID, pickupType, vehicleModel) info = mapInfo.modename if info == "Destruction derby" then if pickupType == "vehiclechange" then if vehicleModel == 425 then outputChatBox("HUNTER ALERT: "..getPlayerName(source).." has a hunter!",getRootElement(),25,125,225) end end end end addEventHandler("onPlayerPickUpRacePickup",getRootElement(),hunterAlert)
  13. maybe would be better you to use a guiLabel, dunno its easier to use it
  14. Castillo

    Spawning gui

    this should do the job, spawnmenu = guiCreateWindow(573,383,220,213,"Spawn Menu",false) spawnmenugrid = guiCreateGridList(0.1273,0.1174,0.7545,0.6677,true,spawnmenu) guiGridListSetSelectionMode(spawnmenugrid,2) guiGridListAddColumn(spawnmenugrid,"Spawn Team",0.9) spawnmenubutton = guiCreateButton(0.1636,0.7887,0.7136,0.1174,"Spawn",true,spawnmenu) spawnmenumemo = guiCreateMemo(187,484,362,99,"",false) guiSetText ( spawnmenumemo, "Pick a team!!" ) guiMemoSetCaretIndex(spawnmenumemo,true) showCursor ( true ) spawnteams= {{"Mechanics"},{"Taxi"},{"Police"},{"Hippie"},{"Limo Driver"},{"Medic"},{"Maffia"},{"Truckers"}} for i,v in ipairs (spawnteams) do local row = guiGridListAddRow (spawnmenugrid) guiGridListSetItemText (spawnmenugrid, row, 1, v[1], false, true) guiGridListSetItemText (spawnmenugrid, row, 2, v[2], false, true) end function guiClick (button, state, absoluteX, absoluteY) if (source == spawnmenubutton) then if not (guiGridListGetSelectedItem (spawnmenugrid) == false) then local row,col = guiGridListGetSelectedItem (spawnmenugrid) local spawnteamname = guiGridListGetItemText (spawnmenugrid, row, 1) outputChatBox ( "." ..spawnteamname ) else outputChatBox ("First select your location please.", 255, 0, 0, true) end end end addEventHandler ("onClientGUIClick", getRootElement(), guiClick) function gridClick ( state, absoluteX, absoluteY) local campos = guiGridListGetItemText ( spawnmenugrid, guiGridListGetSelectedItem ( spawnmenugrid ), 1 ) if campos == "Hippie" then guiSetText ( spawnmenumemo, "baaaaaaarrrrskkkkkkk...") end if campos == "Police" then guiSetText ( spawnmenumemo, "Police will blablalbla") else outputChatBox ("...." ) end end addEventHandler ("onClientGUIClick", spawnmenugrid, gridClick)
  15. seriusly, i don't know i ever use getRootElement()
  16. Castillo

    How Do I start?

    when you are in-game do /debugscript 3 (first log in as admin of course)
  17. Hmmm, i think this function its only client side and that would mean that won't work at server side script.
  18. oh sorry, my bad i didn't saw it.
  19. setVehicleGravity dosn't exist, check wiki again for gravity functions.
  20. I need GM Role Play for MTA I recommend you to start learning at mta wiki and make it by yourself like all does.
  21. this is not a requesting forum, here you can ask for help at troubles while you make scripts not ask for scripts. here are some links for you to start learning, https://wiki.multitheftauto.com/wiki/Scripting_Introduction https://wiki.multitheftauto.com/wiki/Introduction_to_Scripting_the_GUI
  22. You could ever start to learn by yourself, its cool.
  23. I guess this code is stealed cause he only posted the client side part and that uses server too if i'm right.
  24. meta.xml: <meta> <script src="saveteam.lua" type="server" /> </meta> saveteam.lua: function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount (source))) then local playerTeam = getAccountData (theCurrentAccount, "team") setPlayerTeam(source,playerTeam) end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) function onQuit (quitType, reason, responsibleElement,thePreviousAccount) if not (isGuestAccount (getPlayerAccount (source))) then account = getPlayerAccount (source) if (account) then local team = getPlayerTeam(source) local teamName = getTeamName(team) setAccountData (account, "team", teamName) end end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit) this should work.
  25. read again what he asked please, you are giving a resource that detects acl groups not save his team into his account.
×
×
  • Create New...