Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. You want to save the skin the player had before die and load it when he spawns again?
  2. Lo que pasa es que habia creado el tema en otra seccion, yo lo movi aca.
  3. Lo que decis es que ambas PC's tienen el mismo serial? estas seguro?
  4. Update it how? do you have any suggestions?
  5. Skin mod: https://community.multitheftauto.com/ind ... ls&id=5329 DONE
  6. Yes, you should wait for him and ask permission to use it.
  7. Because he made a function to get them. function aclGetAccountGroups ( account ) local acc = getAccountName ( account ) if ( not acc ) then return false end local res = {} acc = "user."..acc local all = "user.*" for ig, group in ipairs ( aclGroupList() ) do for io, object in ipairs ( aclGroupListObjects ( group ) ) do if ( ( acc == object ) or ( all == object ) ) then table.insert ( res, aclGroupGetName ( group ) ) break end end end return res end You should ask him before use it though.
  8. There's no function to get all player ACL groups.
  9. The database is already on the server.
  10. That won't work Jaysd, you didn't define the pickup variable anywhere. function createPick ( thePlayer ) --thePlayer wasn't defined and please don't use the mta function as a function for your script, unless you want to add something with the createPickup local x, y, z = getElementPosition ( thePlayer ) local pickup = createPickup ( x + 2 , y + 2 , z + 0, 2, 2, 10000, 100 ) --the words and the semi-brackets were not needed. if ( pickup ) then outputChatBox ( "Successful", thePlayer ) else outputChatBox ( "Unsuccessful!", thePlayer ) end end addCommandHandler ( "pickupWeapon", createPick ) -- Please not that when you create a command, there should be no space as the system would think it's an arguement
  11. Castillo

    Good??

    1: The money should be given server side, as if you give it client side it won't make any effect. 2: By a projectile you mean a rocket fired to your vehicle? if so, then this won't work.
  12. Yo para todos mis diseños con DirectX/GUI uso el "guieditor".
  13. Todo lo relacionado con DirectX ( dxDrawText etc ) no son elementos, no podes destruirlos, tenes que remover el evento de "onClientRender". function dxLogo ( ) logo = dxDrawText("[PGS]BaseMode Server",632.0,7.0,765.0,22.0,tocolor(13,227,184,190),1.0,"default-bold","left","top",false,false,true) dxDrawRectangle(624.0,6.0,151.0,19.0,tocolor(0,0,0,170),false) setElementData(getLocalPlayer(),"text","logo") end function dxWebSite() website = dxDrawText("http://website.com",632.0,7.0,765.0,22.0,tocolor(13,227,184,190),1.0,"default-bold","left","top",false,false,true) dxDrawRectangle(624.0,6.0,151.0,19.0,tocolor(0,0,0,170),false) setElementData(getLocalPlayer(),"text","website") end function destruirLogo ( ) removeEventHandler ( "onClientRender", root, dxLogo ) end function destruirWebSite ( ) removeEventHandler ( "onClientRender", root, dxWebSite ) end function condiciones ( ) if ( getElementData ( getLocalPlayer(), "text" ) == "logo" ) then setTimer ( destruirLogo, 60000, 1 ) addEventHandler ( "onClientRender", root,dxLogo ) removeEventHandler ( "onClientRender", root, dxWebSite ) elseif ( getElementData ( getLocalPlayer(), "text" ) == "website" ) then setTimer ( destruirWebsite, 60000, 1 ) addEventHandler ( "onClientRender", root, dxWebSite ) removeEventHandler ( "onClientRender", root, dxLogo ) end end
  14. Castillo

    Variables

    Queres decir esto: zombiesMatados = 0 function restartear ( ) if ( isElementWithinColShape ( source, colshape ) ) then zombiesMatados = 0 end end addEvent ( "onBotWasted", true ) addEventHandler ( "onBotWasted",getRootElement(), restartear )
  15. Did you replace your code with the one I posted above? if so, then it has to output some data.
  16. There isn't as far as I know, to get the model ID you must go to Map Editor and select the world object.
  17. That has nothing to do with your problem, do what I said above.
  18. By debugging I meant adding outputs to see what it returns, do what I said in my latest post.
  19. Ok, let's try debugging and see what it outputs: g_root = getRootElement( ); classGroups = { }; addEvent( "spawn_clientRequestSpawn", true ); addEventHandler( "spawn_clientRequestSpawn", g_root, function( categoryIndex, classIndex, skinIndex ) if skinIndex then local class = classGroups[ categoryIndex ].classes[ classIndex ]; 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]] outputChatBox ( "model id: ".. skin.modelId ) outputChatBox ( "in acl: ".. tostring ( isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(client)), aclGetGroup ( "SoS" ) ) ) ) if skin.modelId == 29 and not isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(client)), aclGetGroup ( "SoS" ) ) then spawn = false 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 ) 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 ); 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 ) Use that and post here what it outputs to chat box.
  20. Are you sure that: "skin.modelId" value is "29"?
  21. Topic moved to "Scripting" section. Maybe if you would tell us what is the exact problem.
×
×
  • Create New...