Jump to content

Smart.

Members
  • Posts

    340
  • Joined

  • Last visited

Everything posted by Smart.

  1. Its probably because you haven't calculated the position of the dxtext/images. Are you guys on the same resolution? (OBS! I haven't tested/looked through the whole code as I'm too lazy, monkey )
  2. https://wiki.multitheftauto.com/wiki/OnClientPedWasted should do it..
  3. Erm, use: https://wiki.multitheftauto.com/wiki/OnClientPedDamage
  4. Smart.

    Problem Staff

    why not using the script below? but as the guy above said, none of these functions causes it. function joinStaff ( incAdmin ) local accname = getAccountName ( getPlayerAccount ( incAdmin ) ) if isObjectInACLGroup ( "user." ..acname, aclGetGroup ( ( "SuperModerator" ) ) then setElementData ( incAdmin, "Occupation", "Admin Staff" ) setElementModel ( incAdmin, 217 ) elseif isObjectInAclGroup ( "user." ..accname, aclGetGroup ( "Admin" ) ) then setElementData ( incAdmin, "Occupation", "Head Staff" ) setElementModel ( incAdmin, 217 ) end end addCommandHandler ( "admin", joinStaff )
  5. try: function whatever ( ) if ( source == yourGridVariable ) then row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then local playername = guiGridListGetItemText ( source, row, col ) local thePlayer = getPlayerFromName ( playername ) if ( thePlayer ) then --whatever end end end end addEventHandler ( "onClientGUIClick", root, whatever )
  6. setPlayerWantedLevel getDistanceBetweenPoints3D getPlayerTeam
  7. Smart.

    trucker error

    I uploaded a complete resource, why would you need to edit it..? createHouseEvent isn't added. The destination is never created seeing as the event is never added hence no marker to attach the blip = big fail.
  8. if getElementData ( hitElement, "Occupation" ) == "Medic" then
  9. Yet again, you forgot to define the player..
  10. Do you type the command Linerunner ?
  11. Lua is case sensitive so the createmarker has to be with a capital. Here, try this: teamtrucker = createTeam ( "Camioneros", 0, 200, 0 ) marcador = createMarker ( 168.55726623535, -15.098962783813, 1.578125, "cylinder", 2, 155, 155, 105, 90 ) -- you had createmarker, it has to be with a capital as I said. function camionero ( hitPlayer ) setPlayerNametagColor ( hitPlayer, 0, 200, 0) setElementModel ( hitPlayer, 161 ) setPlayerTeam ( hitPlayer, teamtrucker ) end addEventHandler ( "onMarkerHit", marcador, camionero ) function crearlinerunner ( thePlayer ) local x, y, z = getElementPosition ( thePlayer ) linerunner = createVehicle ( 609, x, y, z) setTimer ( warpPedIntoVehicle, 1000, 1, thePlayer, linerunner ) end addCommandHandler ( "Linerunner", crearlinerunner )
  12. Read my comments, also a tip: when testing scripts and they don't work use /debugscript 3 Genius, your code is wrong. marcador = createMarker ( 0, 0, 0, "cylinder", 2, 155, 155, 105, 90 ) function camionero (hitElement) setPlayerNametagColor (hitElement, 0, 200, 0) setElementModel (hitElement, 161 ) setPlayerTeam (hitElement, teamtrucker )-- teamtrucker is never created ? -- Spawn linerunner -- function crearlinerunner () -- two functions inside one? local jugador = getLocalPlayer() -- getLocalPlayer is client-sided. local x, y, z = getElementPosition (jugador) -- wont work as the variable jugador is client-sided while warpPed is server same as setPlayerTeam linerunner = createVehicle ( 609, x, y, z) warpPedIntoVehicle (linerunner) end end addCommandHandler ( "Linerunner", crearlinerunner ) addEventHandler( "onClientMarkerHit", marcador, camionero ) You can trigger server events using the triggerServerEvent
  13. Ehm, not sure I get what you mean, but you could use the draw image function dxDrawImage --or guiCreateStaticImage
  14. Smart.

    Netrac RPG.

    Updated the whole main-post, but short said; we're giving this "project" a second chance and we got a forum up at: http://www.netrac-mta.com
  15. Smart.

    random skin

    Oh shit, I never saw the specified part, my mistake
  16. Just because StanleySathler corrected him about "whant" I'm gonna correct you all with saying that it isn't "LUA" it's "Lua" And what I could see you never checked the vehicle model? But as StanleySathler said, I've seen several topics from this "Joker" guy where he requests us to script, he doesn't even try himself.
  17. I just tried this one and it works as it should. Try to lower the timer and see if it works E.G: function chat () outputChatBox ("#FFff00~@ #00bbccTyp #000000[ #ff0000/zombie #000000] #00bbccTo connect to The#000000: #ff0000Zombie #00bbccServer #ffff00 @~", root, 255, 255, 255, true ) end setTimer ( chat, 500, 0) -- we lowered the timer from 60000 to 500 to see if it actually works, if it works then increase it again.
  18. Smart.

    random skin

    StanleySathler: There is an easier way to do this. We'll still use math.random but we wont take ID's from a table we'll just pick a random ID from 1 - 288 setElementModel ( yourElement, math.random ( 1, 288 ) )
  19. Here you go: https://forum.multitheftauto.com/viewtop ... fd#p438112
  20. Smart.

    robber error

    maybe, cba thinking atm: client: --[[ Developer: Sebastian 'seb' Cronberg Rights: All rights reserved by the developer (c) 2012 File: robber_client.lua ]] local robberHouses = { { 1231, 123, 123 }; -- change to your values. } function unpackRobberHouses () return unpack ( robberHouses [ math.random ( #robberHouses ) ] ) end addEvent ( "createHouseEvent", true ) function createHouses () x, y, z = unpackRobberHouses () robhouseMarker = createMarker ( x, y, z, "cylinder", 3, 255, 51, 102, 85, localPlayer ) robhouseBlip = createBlipAttachedTo ( robhouseMarker, 32, localPlayer ) end addEventHandler ( "createHouseEvent", root, createHouses ) addEventHandler ( "onClientMarkerHit", root, function ( hitElement ) if ( source == robhouseMarker and not isPedInVehicle ( localPlayer ) and hitElement == localPlayer ) then triggerServerEvent ( "givePlayerPay", localPlayer ) destroyElement ( robhouseMarker ) destroyElement ( robhouseBlip ) triggerEvent ( "createHouseEvent", localPlayer ) playSound ( "files/cash.mp3", false ) end end ) function triggerServer () triggerEvent ( "createHouseEvent", localPlayer ) triggerServerEvent ( "robberJobAccepted", localPlayer ) end addCommandHandler ( "criminal", triggerServer ) server: --[[ Developer: Sebastian 'seb' Cronberg Rights: All rights reserved by the developer (c) 2012 File: ronbber_server.lua ]] function createRobberTeam () robberTeam = createTeam ( "Robber", 250, 0, 0 ) end addEventHandler ( "onResourceStart", resourceRoot, createRobberTeam ) addEvent ( "robberJobAccepted", true ) function givePlayerJob ( ) setPlayerTeam ( source, robberTeam ) end addEventHandler ( "robberJobAccepted", root, givePlayerJob ) addEvent ( "givePlayerPay", true ) function givePlayerRobPay () money = math.random ( 350, 1020 ) givePlayerMoney ( source, money ) outputChatBox ( "You succesfully robbed the house and made $" ..money, source ) fadeCamera ( source, false, 1, 0, 0, 0 ) setTimer ( fadeCamera, 1000, 1, source, true, 1 ) end addEventHandler ( "givePlayerPay", root, givePlayerRobPay )
  21. Smart.

    robber error

    It feels like I'm getting ignored. The code will never work as the function unpackRobberHouses isn't generated anywhere. and just out of curiosity how did you manage to get parts of the code but not the whole script? Anyhow: https://community.multitheftauto.com/index.php?p= ... ls&id=4780
  22. Smart.

    robber error

    wont work as you never made the unpackRobberHouses function. You better use the whole script I made or learn what you're doing.
×
×
  • Create New...