Jump to content

Alen141

Members
  • Posts

    105
  • Joined

  • Last visited

Everything posted by Alen141

  1. 20 Views no answer
  2. Hey guys,I'm stuck again so here is my acl car lock for my pony car but i want to lock it for Team but i got lost in team functions: Hunter = createVehicle ( 425, 362.26513671875, 1997.4976806641, 21.543445587158, 0, 0, 91.75 ) function lockArmy(player, seat, jacked) if source == Hunter then local accountname = getAccountName (getPlayerAccount(player)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Army" ) ) then return end cancelEvent() outputChatBox ( "Only Army is allowed to use this vehicle!", player, 255, 0, 0, true ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), lockArmy )
  3. thanks it works!
  4. line 7 : g_root = getRootElement( ); classGroups = { }; addEvent( "spawn_clientRequestSpawn", true ); addEventHandler( "spawn_clientRequestSpawn", g_root, local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) ---- HERE IS ERROR if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then function( categoryIndex, classIndex, skinIndex, password ) if skinIndex then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then local class = classGroups[ categoryIndex ].classes[ classIndex ]; if class.password then if not password or password == "" then triggerClientEvent( client, "spawn_requestPassword", root, class.name ); return; elseif password ~= class.password then outputChatBox( "The password you typed in is incorrect! Try again or cancel to choose different class.", client, 200, 50, 50 ); triggerClientEvent( client, "spawn_requestPassword", root, class.name ); return; end end local skin = class.skinMngr.skins[ skinIndex ]; local spawn = true; local spawned; --[[if not classGroups[ cetegoryIndex ].owner then -- if there is NO owner of the clan/gang spawn player spawn = true; else -- if there IS owner of the clan/gang then check if he's member of the clan/gang end]] if spawn then if not class.team then class.team = createTeam( class.name, class.color.red, class.color.green, class.color.blue ); end local plrTeam = getPlayerTeam( client ); if ( ( plrTeam ) and ( plrTeam ~= class.team ) and ( countPlayersInTeam( plrTeam ) == 1 ) ) then destroyElement( plrTeam ); end spawned = spawnPlayer( client, skin.spawnLoc.x, skin.spawnLoc.y, skin.spawnLoc.z, skin.spawnLoc.rot, skin.modelId, 0, 0, class.team ); end if spawned then setElementData( client, "team", class.name ) setElementData( client, "skin", skin.name ) fadeCamera( client, true ); setCameraTarget( client, client ); setTimer( setCameraTarget, 200, 1, client, client ); triggerClientEvent( client, "spawn_SpawnedSuccessfully", client ); --setPlayerMoney( client, 500 ); for _, weapon in ipairs( class.weaponMngr.weapons ) do giveWeapon( client, weapon.id, weapon.ammo, false ); end createBlipAttachedTo( client, 0, 2, class.color.red, class.color.green, class.color.blue ) else triggerClientEvent( client, "spawn_FailedToSpawn", client ); if countPlayersInTeam( class.team ) == 0 then destroyElement( class.team ); class.team = nil; end end end end ); addEvent( "spawn_receivePassword", true ); addEventHandler( "spawn_receivePassword", g_root, function( ) end ); addEventHandler( "onPlayerSpawn", g_root, function ( ) end ); addEventHandler( "onPlayerWasted", g_root, function( ) fadeCamera( source, false, 4 ); setTimer( requestMenu, 5000, 1, source ); deleteAllPlayerBlips( source ) end ); function requestMenu( player ) callClientFunc( player, "showSpawnMenu", true, true ); callClientFunc( player, "classSelected" ); end addCommandHandler( "kill", function( plr ) killPed( plr ); end ) function preloadClassesInfo( ) local groups = getElementsByType( "category" ); for _, group in ipairs( groups ) do table.insert( classGroups, Group:New( group ) ); end end addEventHandler( "onResourceStart", getResourceRootElement(), preloadClassesInfo ) function deleteAllPlayerBlips(player) local elements = getAttachedElements(player) if (elements) then for i, element in ipairs(elements) do if (getElementType(element) == "blip") then destroyElement(element) end end end print( "number of players in team: " .. tostring( countPlayersInTeam( getPlayerTeam( player ) ) ) ); end addEventHandler( "onPlayerQuit", g_root, function() deleteAllPlayerBlips(source) end ); ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ function callClientFunc( player, funcName, ... ) if #{ ... } ~= 0 then triggerClientEvent( player, "_clientCallFunction", root, funcName, ... ) else triggerClientEvent( player, "_clientCallFunction", root, funcName ) end end addEvent( "_serverCallFunction", true ) addEventHandler( "_serverCallFunction", root, function( funcName, ... ) _G[ funcName ](...) end )
  5. Hey guys i wanted to edit this spawn script https://community.multitheftauto.com/index.php?p=resources&s=details&id=1152.I want to make it based on ACL Function if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then ..... but this doesn't work! it says unexpected symbol near local : addEvent( "spawn_clientRequestSpawn", true ); addEventHandler( "spawn_clientRequestSpawn", g_root, local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then function( categoryIndex, classIndex, skinIndex, password ) if skinIndex then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then local class = classGroups[ categoryIndex ].classes[ classIndex ]; if class.password then if not password or password == "" then triggerClientEvent( client, "spawn_requestPassword", root, class.name ); return; elseif password ~= class.password then outputChatBox( "The password you typed in is incorrect! Try again or cancel to choose different class.", client, 200, 50, 50 ); triggerClientEvent( client, "spawn_requestPassword", root, class.name ); return; end end
×
×
  • Create New...