Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. You can actually send the script to the client side using triggerClientEvent and then execute it.
  2. You can use this online tool made by dzek to replace skins and vehicles: Skins: http://mta.dzek.eu/peds/ Vehicles: http://mta.dzek.eu/vehicle/ Or you can also use the "modloader" resource which is on the MTA community.
  3. Castillo

    MTA Market

    I've recently changed on how the screenshots are seen, made it look a bit "cooler". I have also added some more scripts for sale in the past months.
  4. I don't really see the point of this.
  5. That could be because you have a script error on the file you are trying to compile, or it could also be that your script encoding is set to "UTF-8".
  6. I just tested it and it works as it should, so you either did something wrong or your server has an script which is conflicting with this one.
  7. addEventHandler ( "onPlayerWasted", root, function ( ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then for slot = 1, 12 do setAccountData ( account, "save-wep".. slot, getPedWeapon ( source, slot ) ) setAccountData ( account, "save-ammo".. slot, getPedTotalAmmo ( source, slot ) ) end local team = getPlayerTeam ( source ) if ( team ) then setAccountData ( account, "save-team", getTeamName ( team ) ) end end end ) addEventHandler ( "onPlayerSpawn", root, function ( ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then local team = getTeamFromName ( getAccountData ( account, "save-team" ) ) if ( team ) then setPlayerTeam ( source, team ) else outputChatBox ( "NO TEAM SAVED", source ) end for slot = 1, 12 do local wep = getAccountData ( account, "save-wep".. slot ) local ammo = getAccountData ( account, "save-ammo".. slot ) giveWeapon ( source, wep, ammo ) end end end ) Try it.
  8. function autonTila ( ) if isPedInVehicle ( localPlayer ) then local sx, sy, sz = getElementVelocity ( getPedOccupiedVehicle ( localPlayer ) ) speed = math.floor ( ( ( sx ^ 2 + sy ^ 2 + sz ^ 2 ) ^ ( 0.5 ) ) * 180 ) dxDrawText ( "Speed: ".. tostring ( speed ) .."KM/h", 1493, 839, 1550, 856, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, true, false, false ) end end function onEnterOrExit ( thePlayer, seat ) if ( thePlayer == localPlayer and seat == 0 ) then if ( eventName == "onClientVehicleEnter" ) then addEventHandler ( "onClientRender", root, autonTila ) else removeEventHandler ( "onClientRender", root, autonTila ) end end end addEventHandler ( "onClientVehicleEnter", root, onEnterOrExit ) addEventHandler ( "onClientVehicleExit", root, onEnterOrExit )
  9. It doesn't output to chat: "NO TEAM SAVED"?
  10. addEventHandler ( "onPlayerWasted", root, function ( ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then for slot = 1, 12 do setAccountData ( account, "save-wep".. slot, getPedWeapon ( source, slot ) ) setAccountData ( account, "save-ammo".. slot, getPedTotalAmmo ( source, slot ) ) end local team = getPlayerTeam ( source ) if ( team ) then setAccountData ( account, "save-team", getTeamName ( team ) ) end end end ) addEventHandler ( "onPlayerSpawn", root, function ( ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then setElementData ( source, "Role", role ) spawnPlayer ( source, x, y, z, interior, dimension ) setElementHealth ( source, health ) setElementModel ( source, skin ) local team = getTeamFromName ( getAccountData ( account, "save-team" ) ) if ( team ) then setPlayerTeam ( source, team ) else outputChatBox ( "NO TEAM SAVED", source ) end setPlayerMoney ( source, money ) setPedArmor ( source, armor ) for slot = 1, 12 do local wep = getAccountData ( account, "save-wep".. slot ) local ammo = getAccountData ( account, "save-ammo".. slot ) giveWeapon ( source, wep, ammo ) end end end ) See if it outputs something to chat.
  11. Castillo

    zombie

    You're welcome.
  12. No, just copy my last code.
  13. Seems like you don't read what I told you, I said that it just SAVES the team, it doesn't LOAD it. With this it'll load it aswell: addEventHandler ( "onPlayerWasted", root, function ( ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then for slot = 1, 12 do setAccountData ( account, "save-wep".. slot, getPedWeapon ( source, slot ) ) setAccountData ( account, "save-ammo".. slot, getPedTotalAmmo ( source, slot ) ) end local team = getPlayerTeam ( source ) if ( team ) then setAccountData ( account, "save-team", getTeamName ( team ) ) end end end ) addEventHandler ( "onPlayerSpawn", root, function ( ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then setElementData ( source, "Role", role ) spawnPlayer ( source, x, y, z, interior, dimension ) setElementHealth ( source, health ) setElementModel ( source, skin ) local team = getTeamFromName ( getAccountData ( account, "save-team" ) ) if ( team ) then setPlayerTeam ( source, team ) end setPlayerMoney ( source, money ) setPedArmor ( source, armor ) for slot = 1, 12 do local wep = getAccountData ( account, "save-wep".. slot ) local ammo = getAccountData ( account, "save-ammo".. slot ) giveWeapon ( source, wep, ammo ) end end end )
  14. And how do you know that?
  15. It'll only save the team, it won't load it.
  16. object = createObject ( 17029, 244.89999389648, 2916.3000488281, 27.39999961853, 90, 0, 0 ) state = false addCommandHandler ( "puerta", function ( source ) if ( state == true ) then moveObject ( object, 17029, 244.89999389648, 2916.3000488281, 0 ) state = false else moveObject ( object, 17029, 244.89999389648, 2916.3000488281, 27.39999961853 ) state = true end end )
  17. addEventHandler ( "onPlayerWasted", root, function ( ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then for slot = 1, 12 do setAccountData ( account, "save-wep".. slot, getPedWeapon ( source, slot ) ) setAccountData ( account, "save-ammo".. slot, getPedTotalAmmo ( source, slot ) ) end local team = getPlayerTeam ( source ) if ( team ) then setAccountData ( account, "save-team", getTeamName ( team ) ) end end end ) addEventHandler ( "onPlayerSpawn", root, function ( ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then setElementData ( source, "Role", role ) spawnPlayer ( source, x, y, z, interior, dimension ) setElementHealth ( source, health ) setElementModel ( source, skin ) setPlayerTeam ( source, getTeamFromName(team) ) setPlayerMoney ( source, money ) setPedArmor ( source, armor ) for slot = 1, 12 do local wep = getAccountData ( account, "save-wep".. slot ) local ammo = getAccountData ( account, "save-ammo".. slot ) giveWeapon ( source, wep, ammo ) end end end )
  18. To get the team name use the following functions: getPlayerTeam -- Gets the team element from a player. getTeamName -- Gets the team name from a team element.
  19. What is "slot" there for? and there's no such function: "getPedTeamName", could you please think what you are doing?
  20. Did you save them like you did with weapons or not?
  21. What part you don't understand? ALL YOUR VARIABLES ARE UNDEFINED.
  22. Example: setElementData ( thePlayerElementHere, "walkingStyle", theStyleHere ) Then: local walk = getElementData ( source, "walkingStyle" )
  23. At "onPlayerSpawn" function all of the variables aren't defined.
×
×
  • Create New...