Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Will This Work? For Certain Teams ONLY! Client: --Team Skin Select Start---------------------------------------------------------------------------------------------------------------------------------------- local theplayerteam = getPlayerTeam ( source ) local number = 1 function ballaskinselectnext ( ) if ( theplayerteam == "Ballas" ) then number = ( number + 1 ) local skin = bskins [ number ] if ( skin ) then setElementModel ( localPlayer, skin ) end end end addEventHandler ( "onClientGUIClick", skin_Button[2], ballaskinselectnext, false ) function ballaskinselectback ( ) if ( theplayerteam == "Ballas" ) then number = ( number - 1 ) local skin = bskins [ number ] if ( skin ) then setElementModel ( localPlayer, skin ) end end end addEventHandler ( "onClientGUIClick", skin_Button[1], ballaskinselectback, false ) function groveskinselectnext ( ) if ( theplayerteam == "Grove" ) then number = ( number + 1 ) local skin = gskins [ number ] if ( skin ) then setElementModel ( localPlayer, skin ) end end end addEventHandler ( "onClientGUIClick", skin_Button[2], groveskinselectnext, false ) function groveskinselectback ( ) if ( theplayerteam == "Grove" ) then number = ( number - 1 ) local skin = gskins [ number ] if ( skin ) then setElementModel ( localPlayer, skin ) end end end addEventHandler ( "onClientGUIClick", skin_Button[1], groveskinselectback, false ) function policeskinselectnext ( ) if ( theplayerteam == "Police" ) then number = ( number + 1 ) local skin = pskins [ number ] if ( skin ) then setElementModel ( localPlayer, skin ) end end end addEventHandler ( "onClientGUIClick", skin_Button[2], policeskinselectnext, false ) function policeskinselectback ( ) if ( theplayerteam == "Police" ) then number = ( number - 1 ) local skin = pskins [ number ] if ( skin ) then setElementModel ( localPlayer, skin ) end end end addEventHandler ( "onClientGUIClick", skin_Button[1], policeskinselectback, false ) --Team Skin Select End---------------------------------------------------------------------------------------------------------------------------------------- 1: You should get the current team inside the function. 2: getPlayerTeam returns a team element, not a name. 3: Start testing your scripts before ask for help.
  2. local number = 1 function ballaskinselectnext ( ) number = ( number + 1 ) local skin = bskins [ number ] if ( skin ) then setElementModel ( localPlayer, skin ) end end addEventHandler ( "onClientGUIClick", skin_Button[2], ballaskinselectnext, false ) function ballaskinselectback ( ) number = ( number - 1 ) local skin = bskins [ number ] if ( skin ) then setElementModel ( localPlayer, skin ) end end addEventHandler ( "onClientGUIClick", skin_Button[1], ballaskinselectback, false )
  3. number = 1 number = number + 1 skin = bskins [ number ]
  4. Make a table with the skins, then increase the index of a variable and get the skin of that index.
  5. Castillo

    DarArma

    Eso es porque no le pusiste que le de las balas tambien. addCommandHandler ( "dararma", function ( player, commandName, otherPlayer ) local weapon = getPedWeapon ( player ) local ammo = getPedTotalAmmo ( player ) if ( otherPlayer and weapon and weapon > 1 ) then local other, name = exports.players:getFromName ( player, otherPlayer ) if ( other ) then if ( player ~= other ) then local x, y, z = getElementPosition ( player ) if ( getDistanceBetweenPoints3D ( x, y, z, getElementPosition ( other ) ) < 5 ) then giveWeapon ( other, weapon, ammo, true ) takeWeapon ( player, weapon ) outputChatBox ( "Le diste " .. name .. " tu " .. weapon .. ".", player, 0, 255, 0 ) outputChatBox ( getPlayerName ( player ):gsub ( "_", " " ) .. " te dio un " .. weapon .. ".", other, 0, 255, 0 ) else outputChatBox ( "Estas lejos de " .. name .. ".", player, 255, 0, 0 ) end else outputChatBox ( "No puedes darte arma a ti mismo.", player, 255, 0, 0 ) end end else outputChatBox ( "Syntax: /" .. commandName .. " [player] [weapon]", player, 255, 255, 255 ) end end )
  6. Castillo

    DarArma

    addCommandHandler ( "dararma", function ( player, commandName, otherPlayer ) local weapon = getPedWeapon ( player ) if ( otherPlayer and weapon and weapon > 1 ) then local other, name = exports.players:getFromName ( player, otherPlayer ) if ( other ) then if ( player ~= other ) then local x, y, z = getElementPosition ( player ) if ( getDistanceBetweenPoints3D ( x, y, z, getElementPosition ( other ) ) < 5 ) then giveWeapon ( other, weapon ) takeWeapon ( player, weapon ) outputChatBox ( "Le diste " .. name .. " tu " .. weapon .. ".", player, 0, 255, 0 ) outputChatBox ( getPlayerName ( player ):gsub ( "_", " " ) .. " te dio un " .. weapon .. ".", other, 0, 255, 0 ) else outputChatBox ( "Estas lejos de " .. name .. ".", player, 255, 0, 0 ) end else outputChatBox ( "No puedes darte arma a ti mismo.", player, 255, 0, 0 ) end end else outputChatBox ( "Syntax: /" .. commandName .. " [player] [weapon]", player, 255, 255, 255 ) end end ) Eso?
  7. -- Resource 1: addEvent ( "test", true ) addEventHandler ( "test", root, function ( ) end ) -- Resource 2: triggerServerEvent ( "test", localPlayer ) That?
  8. En el meta.xml, le pones: download = "false" o download = "no".
  9. Castillo

    Variables

    No as far as I know.
  10. Castillo

    Variables

    Events are attached to the function given, I seriously don't get your point.
  11. Castillo

    Variables

    I don't understand what do you mean.
  12. Castillo

    Variables

    Variables aren't shared within resources.
  13. I've just tested your resource and it's amazing, good job .
  14. function onClientPlayerWeaponFireFunc ( weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) local pX, pY, pZ = getElementPosition ( localPlayer ) createExplosion ( pX, pY, pZ, 6 ) end addEventHandler ( "onClientPlayerWeaponFire", localPlayer, onClientPlayerWeaponFireFunc )
  15. You must set the interior where your garage is.
  16. setCameraInterior(200) Interior 200?! that doesn't exist?
  17. function spawn(player) if not isElement(player) then return end repeat until spawnPlayer ( player, -1964+math.random(0,0), 136+math.random(5,9), 28, 90, math.random(9,288) ) fadeCamera(player, true) setCameraTarget(player, player) end addEventHandler("onPlayerJoin", root, function() spawn(source) end ) That is server side as well.
  18. I already posted the code.
  19. That's because you didn't add the event handler to set the game type. function resourceStart() setGameType("Race World") setMapName("RR 1.0") setRuleValue("Author", "Shape") end addEventHandler ( "onResourceStart", resourceRoot, resourceStart ) function passwordHandler(player, oldpassword, newpassword) local account = getPlayerAccount(player) if (account) then if (isGuestAccount(account)) then outputChatBox("Musisz być zalogowany by zmienić swoje hasło.", player) return end local playerName = getPlayerName(player) local password_check = getAccount(playerName, oldpassword) if (password_check ~= false) then if (string.len(newpassword) >= 5) then setAccountPassword(account, newpassword) triggerClientEvent(player, "hidePasswordWindow", getRootElement()) else outputChatBox("Hasło musi zawierać przynajmniej 5 liter!", player) end else outputChatBox("Bledne stare haslo.", player) end end end function loginHandler(player, username, password) local account = getAccount(username, password) if (account ~= false) then if (logIn(player, account, password) == true) then outputChatBox("Jesli chcesz zmienic haslo wpisz /changepw", player) triggerClientEvent (player, "hideLoginWindow", getRootElement()) else triggerClientEvent (player, "unknownError", getRootElement()) end else triggerClientEvent (player, "loginWrong", getRootElement()) end end function registerHandler(player, username, password) local account = getAccount(username, password) if (account ~= false) then triggerClientEvent(player, "registerTaken", getRootElement()) else account = addAccount(username, password) if (logIn(player, account, password) == true) then outputChatBox("If you want to change your password, use /changepw", player) triggerClientEvent(player, "hideLoginWindow", getRootElement()) else triggerClientEvent(player, "unknownError", getRootElement()) end end end addEvent("submitChangepw", true) addEvent("submitLogin", true) addEvent("submitRegister", true) addEventHandler("submitChangepw", root, passwordHandler) addEventHandler("submitLogin", root, loginHandler) addEventHandler("submitRegister", root, registerHandler)
×
×
  • Create New...