AlvareZ_ Posted December 31, 2012 Share Posted December 31, 2012 Bueno lo siguiente es quisiera ponerlo el spawn con el spawn de 50p q tu al darle al team diga No Perteneces a Este clan q funciones debo usar o q? solo diganme q debo usar y yo lo saco Gracias Link to comment
Castillo Posted December 31, 2012 Share Posted December 31, 2012 No son solo funciones, es experiencia, necesitas saber como funciona el script de spawn para poder editarlo. Link to comment
AlvareZ_ Posted December 31, 2012 Author Share Posted December 31, 2012 Ok, pero me podrian ayudar a como hacerlo POR LO MENOS yo me fijo del spawn solo nesecito saber q usar Link to comment
Castillo Posted December 31, 2012 Share Posted December 31, 2012 El script tiene una funcion, donde crea las clases que obtiene del archivo spawn_locations.map, ahi tendrias que agregar otro valor que seria la gang, luego al intentar spawnear, verificas ese valor con la gang del jugador que la obtenes con: getElementData ( client, "gang" ) Link to comment
AlvareZ_ Posted December 31, 2012 Author Share Posted December 31, 2012 a ver como vamos ESto fue agregado a s_main: g_root = getRootElement( ); classGroups = { }; addEvent( "spawn_clientRequestSpawn", true ); addEventHandler( "spawn_clientRequestSpawn", g_root, function( categoryIndex, classIndex, skinIndex, gang ) if skinIndex then local class = classGroups[ categoryIndex ].classes[ classIndex ]; if getElementData(client, "gang") == "" then triggerClientEvent( client, "spawn_requestGang", root, class.name ); return; 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 ) 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_receiveGang", true ); addEventHandler( "spawn_receiveGang", g_root, function( ) end ); y esto lo agrege a el c_main: addEvent( "spawn_FailedToSpawn", true ); addEventHandler( "spawn_FailedToSpawn", g_root, function( gang ) if not restricted then fadeCamera(true) outputChatBox( "You failed to spawn. Try different skin.", 200, 40, 0 ); else fadeCamera(true) outputChatBox("Tu no perteneces a ".. gang .." !",255,0,0) end end ) --[[================================================================================]]-- --[[================================================================================]]-- --[[================================================================================]]-- function callServerFunc( funcName, ... ) triggerServerEvent( "_serverCallFunction", root, funcName, ... ) end addEvent( "_clientCallFunction", true ) addEventHandler( "_clientCallFunction", root, function( funcName, ... ) _G[ funcName ](...) end ) y por ejemplo se le agregaria a el localitation_map.xml gang="gangaqui" como voy y q me faltaria ? Link to comment
Castillo Posted December 31, 2012 Share Posted December 31, 2012 Que agregaste a s_main? Link to comment
AlvareZ_ Posted December 31, 2012 Author Share Posted December 31, 2012 hm no ya listo Link to comment
Recommended Posts