-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
You can actually send the script to the client side using triggerClientEvent and then execute it.
-
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.
-
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.
-
I don't really see the point of this.
-
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".
-
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.
-
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.
-
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 )
-
It doesn't output to chat: "NO TEAM SAVED"?
-
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.
-
No, just copy my last code.
-
De nada.
-
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 )
-
And how do you know that?
-
It'll only save the team, it won't load it.
-
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 )
-
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 )
-
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.
-
What is "slot" there for? and there's no such function: "getPedTeamName", could you please think what you are doing?
-
Did you save them like you did with weapons or not?
-
What part you don't understand? ALL YOUR VARIABLES ARE UNDEFINED.
-
Example: setElementData ( thePlayerElementHere, "walkingStyle", theStyleHere ) Then: local walk = getElementData ( source, "walkingStyle" )
-
At "onPlayerSpawn" function all of the variables aren't defined.