-
Posts
611 -
Joined
-
Last visited
Everything posted by AlvareZ_
-
Editastes o iso algo con el script?
-
Si xperia pero con solo eso no lo ara tiene q configurar el spawn
-
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 ?
-
Ok, pero me podrian ayudar a como hacerlo POR LO MENOS yo me fijo del spawn solo nesecito saber q usar
-
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
-
esta muy bien explicado lo q dijo yakuza, o q quieres el script?
-
Gracias otra vez Alexs, y a todos por ayudarme, Bueno cpoco a poco se aprende no ? Ya q estamos aqui me podrias decir para q sirve cancelEvent ? para aprender de una vez
-
exacto para eso debes usar lo q te dije
-
lo sigue agarrando cualquier skin :c
-
me da otro error cualquier skin la puede cojer
-
Cual es el error aqui ? lol = createPickup ( 1392, -1563, -12, 0, 8, 10000, 60 ) function MarkerHit( thePlayer ) if getElementModel( ThePlayer ) == 217 then end addEventHandler ( "onPickupHit", lol, MarkerHit )
-
lo q te dije anterior son los team y si quieres los interiors editas el script como dijo castillo o tambien podrias usarlos aparte createMarker getElementModel
-
Remplasa tu s_main por esto: g_root = getRootElement( ); classGroups = { }; addEvent( "spawn_clientRequestSpawn", true ); addEventHandler( "spawn_clientRequestSpawn", g_root, function( categoryIndex, classIndex, skinIndex, password ) if skinIndex 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 ); setTeamFriendlyFire ( class.team, false ) end local plrTeam = getPlayerTeam( client ); if ( ( plrTeam ) and ( plrTeam ~= class.team ) and ( countPlayersInTeam( plrTeam ) == 0 ) ) 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 ) se te guardaran los teams
-
Muchas gracias a los dos por ayudarme, Bueno solo me faltaria el cursor y la camara y q sea a el entrar el player pero de eso me encargo yo, si tengo otra duda posteo aca o nuevo post Gracias por ayudarme
-
pero esta bien lo q hice? solo deberia separar el gui con la function no ?
-
Lo cree pero hay algo malo q pasa? GUIEditor = { button = {}, window = {}, } GUIEditor.window[1] = guiCreateWindow(721, 115, 487, 460, "Spawn Windown", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(24, 60, 113, 67, "Police", false, GUIEditor.window[1]) function hola ( ) spawnPlayer ( source, 2294.6958007813, 2451.6042480469, 10.8203125, 0, 29, 0, 0 ) fadeCamera ( source, true ) setCameraTarget ( source, source ) end addEventHandler ( "onPlayerSpawn", getRootElement(), hola ) triggerServerEvent ( "onPlayerClick", getRootElement(), GUIEditor.button[1])
-
Mira edite el ultimo q postee ok deja intento crear uno
-
function hola ( ) spawnPlayer ( source, 0, 0, 5, 0, 29, 0, 0 ) fadeCamera ( source, true ) setCameraTarget ( source, source ) end addEventHandler ( "onPlayerSpawn", getRootElement(), hola ) triggerServerEvent ( "onPlayerClick", getRootElement(), "Police")
-
Graicas, pero supongamos q yo cree una windown y dentro le agrege un boton supongamos "Police" aja al precionar ese boton spawnear como deberia ser?
-
function hola () spawnPlayer (thePlayer, 0, 0, 5, 0, 29, 0, 0, spawnTeam) fadeCamera (source, true) setCameraTarget (source, source) end addEventHandler ( "onPlayerSpawn", getRootElement(), hola ) addEventHandler( "onPlayerSpawn", getRootElement(), hola ) asi como va?
-
intenta descargar la nueva version, osea descando el recuerso normal luego solo utiliza tu spawn_localitation.map y listo recuerda agregarle las password