Jump to content

spwan para mta sa / spawn for mta sa


Recommended Posts

hola me gustaria que me ayudaras con una pequeña duda y sugerencia,  estoy creando un servidor mta sa local para un pequeño cyber de mi pueblo... el caso es que consegui un script de spawn y lo modifique (agregue y cambie algunos spawn) pero quisiera saber si se puede privatizar o bloquear uno de los spawn para un (admin, moderador) en ese caso seria yo el admin..  
Aclaro que no se hablar mucho el ingles y no tngo mucho conocimiento de programacion.. espero logren responderme y ayudarme con todo esto.. 
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

hello I would like you to help me with a little doubt and suggestion, I am creating a local mta sa server for a small cyber of my town ... the case is that I got a spawn script and modified it (add and change some spawn) but I would like to know if you can privatize or block one of the spawn for an (admin, moderator) in that case I would be the admin ..
I clarify that I do not speak much English and I do not have much knowledge of programming .. I hope you can answer me and help me with all this ..

server.Lua

------------<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>------------
------------<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>------------
policia = createTeam     ( "Municipal Force",     000, 000, 255 )
------------<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>-----------
------------<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>-----------
local spawnXPOLILV, spawnYPOLILV, spawnZPOLILV = 2247.4521484375, 2491.10546875, 10.8203125
addEvent("Poli-LV",true)                --igual con triggerServerEvent
addEventHandler("Poli-LV",root,            --igual con triggerServerEvent
function(skin)
setPlayerTeam (source, getTeamFromName("Municipal Force"))
spawnPlayer(source, spawnXPOLILV, spawnYPOLILV, spawnZPOLILV)
setElementRotation ( source, 90 ,90 , 90 )  
fadeCamera(source, true)
setCameraTarget ( source, source )
setElementModel ( source, 266 )
giveWeapon ( source,  3, 1   )    --Nightstick
giveWeapon ( source, 22, 500 )    --Colt 45
giveWeapon ( source, 25, 500 )    --Shotgun
giveWeapon ( source, 29, 500 )    --MP5
setPlayerNametagColor ( source, 000, 000, 255 )
setTeamFriendlyFire ( policia, true )
outputChatBox("POLICIA DE LAS VENTURAS", source, 000, 000, 255 )

end)

local spawnXPOLILV2, spawnYPOLILV2, spawnZPOLILV2 = 2248.01074218, 2488.21484375, 10.8203125
addEvent("Poli-LV2",true)            --igual con triggerServerEvent
addEventHandler("Poli-LV2",root,    --igual con triggerServerEvent
function(skin)
setPlayerTeam (source, getTeamFromName("Municipal Force"))
spawnPlayer(source, spawnXPOLILV2, spawnYPOLILV2, spawnZPOLILV2)
setElementRotation ( source, 0 ,0 ,90 )  
fadeCamera(source, true)
setCameraTarget ( source, source )
setElementModel ( source, 265 )
giveWeapon ( source,  3, 1   )    --Nightstick
giveWeapon ( source, 22, 500 )    --Colt 45
giveWeapon ( source, 25, 500 )    --Shotgun
giveWeapon ( source, 29, 500 )    --MP5
setPlayerNametagColor ( source, 000, 000, 255 )
setTeamFriendlyFire ( policia, true )
outputChatBox("POLICIA DE LAS VENTURAS", source, 000, 000, 255 )

end)

local spawnXPOLILV3, spawnYPOLILV3, spawnZPOLILV3 =  2252.29, 2489.06, 10.990804672241
addEvent("Poli-LV3",true)                    --igual con triggerServerEvent
addEventHandler("Poli-LV3",root,            --igual con triggerServerEvent
function(skin)
setPlayerTeam (source, getTeamFromName("Municipal Force"))
spawnPlayer(source, spawnXPOLILV3, spawnYPOLILV3, spawnZPOLILV3)
setElementRotation ( source, 0 ,0 ,90 )  
fadeCamera(source, true)
setCameraTarget ( source, source )
setElementModel ( source, 267 )
giveWeapon ( source,  3, 1   )    --Nightstick
giveWeapon ( source, 22, 500 )    --Colt 45
giveWeapon ( source, 25, 500 )    --Shotgun
giveWeapon ( source, 29, 500 )    --MP5
setPlayerNametagColor ( source, 000, 000, 255 )
setTeamFriendlyFire ( policia, true )
outputChatBox("POLICIA DE LAS VENTURAS", source, 000, 000, 255 )

end)

------------<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>-----------
local spawnXPoliSF, spawnYPoliSF, spawnZPoliSF = -1617.8623046875, 687.236328125, 7.1875
addEvent("Poli-SF",true)
addEventHandler("Poli-SF",root,
function(skin)
setPlayerTeam (source, getTeamFromName("Municipal Force"))
spawnPlayer(source, spawnXPoliSF, spawnYPoliSF, spawnZPoliSF)
setElementRotation ( source, 0 ,0 ,180 )  
fadeCamera(source, true)
setCameraTarget ( source, source )
setElementModel ( source, 280 )
giveWeapon ( source, 16, 15 )  --granada
giveWeapon ( source, 24, 500 ) --Deagle
giveWeapon ( source, 27, 500 )  --Shotgun
giveWeapon ( source, 31, 500 )  --M4
setPlayerNametagColor ( source, 000, 000, 255 )
setTeamFriendlyFire ( policia, true )
outputChatBox("POLICIA DE SAN FIERRO", source, 000, 000, 255)

end)

local spawnXPoliSF2, spawnYPoliSF2, spawnZPoliSF2 = -1620.3212890625, 693.572265625, 7.1875
addEvent("Poli-SF2",true)
addEventHandler("Poli-SF2",root,
function(skin)
setPlayerTeam (source, getTeamFromName("Municipal Force"))
spawnPlayer(source, spawnXPoliSF2, spawnYPoliSF2, spawnZPoliSF2)
setElementRotation ( source, 0 ,0 ,180 )  
fadeCamera(source, true)
setCameraTarget ( source, source )
setElementModel ( source, 281 )
giveWeapon ( source, 16, 15 )  --granada
giveWeapon ( source, 24, 500 ) --Deagle
giveWeapon ( source, 27, 500 )  --Shotgun
giveWeapon ( source, 31, 500 )  --M4
setPlayerNametagColor ( source, 000, 000, 255 )
setTeamFriendlyFire ( policia, true )
outputChatBox("POLICIA DE SAN FIERRO", source, 000, 000, 255)

end)

local spawnXPoliSF3, spawnYPoliSF3, spawnZPoliSF3 = -1617.8623046875, 687.236328125, 7.1875
addEvent("Poli-SF3",true)
addEventHandler("Poli-SF3",root,
function(skin)
setPlayerTeam (source, getTeamFromName("Municipal Force"))
spawnPlayer(source, spawnXPoliSF3, spawnYPoliSF3, spawnZPoliSF3)
setElementRotation ( source, 0 ,0 ,180 )  
fadeCamera(source, true)
setCameraTarget ( source, source )
setElementModel ( source, 282 )
giveWeapon ( source, 16, 15 )  --granada
giveWeapon ( source, 24, 500 ) --Deagle
giveWeapon ( source, 27, 500 )  --Shotgun
giveWeapon ( source, 31, 500 )  --M4
setPlayerNametagColor ( source, 000, 000, 255 )
setTeamFriendlyFire ( policia, true )
outputChatBox("POLICIA DE SAN FIERRO", source, 000, 000, 255)

end)

 

aca abajo dejo el 
Client.Lua


GUIEditor = {
    button = {}
}
local screenW, screenH = guiGetScreenSize()
guiventana = guiCreateWindow(10, (screenH - 534) / 2, 552, 434,
"--<<<<<<<<<<<<<<<MENÚ DE SELECCIÓN DE SPAWN>>>>>>>>>>>>>--", false)
guiSetProperty(guiventana, "CaptionColour", "FFFFFFFF")-- blanco texto
guiWindowSetSizable(guiventana, false)
guiSetAlpha(guiventana, 2.00)

grid_city  = guiCreateGridList(15, 43, 180, 100, false, guiventana)
columnCity = guiGridListAddColumn(grid_city, "1--<<ELIJA SU EQUIPO>>-1", 0.9)
rowCitySF = guiGridListAddRow(grid_city)
guiGridListSetItemText ( grid_city, rowCitySF, columnCity, "Municipal Force", false, false )

grid_groups = guiCreateGridList(15, 135, 180, 100, false, guiventana)
columnGroups = guiGridListAddColumn(grid_groups, "2--<<ELIGE ZONA DEL MAPA>>-2", 0.9)
font = guiCreateFont("font.otf", 25)
boton = guiCreateButton(15, 328, 180, 100, "iniciar", false, guiventana)
guiSetFont(boton, font)
guiSetProperty(boton, "NormalTextColour", "FFFEFAFA")
memo = guiCreateMemo(0.40, 0.08, 0.50, 0.17, "", true, guiventana)
guiMemoSetReadOnly(memo, true)
labelinfo= guiCreateLabel(252, 165, 300, 15, "", false, guiventana)
labelarmas= guiCreateLabel(230, 120, 394, 15, "__________>PERSONAJE ELEGIDO<_________", false, guiventana)
guiSetFont(labelarmas, "default-bold-small")
guiLabelSetColor(labelarmas, 255, 0, 0)
grid_skins = guiCreateGridList(15, 228, 180, 100, false, guiventana)
columnSkins = guiGridListAddColumn(grid_skins, "3--<<ELIGE TU PERSONAJE>>--3", 0.9)
guiSetVisible ( guiventana, true )
showCursor ( true )


function selectGroups ()
    if ( rowCitySF ) then
        local row, col = guiGridListGetSelectedItem ( source )
        if ( row and col and row ~= -1 and col ~= -1 ) then
            local cityName = guiGridListGetItemText ( source, row, 1 )
if ( cityName == "Municipal Force" ) then
                guiGridListClear ( grid_groups )
				guiGridListClear ( grid_skins )
                rowGroupsPolice3 = guiGridListAddRow ( grid_groups )
                rowGroupsPolice4 = guiGridListAddRow ( grid_groups )
             guiGridListSetItemText ( grid_groups, rowGroupsPolice3, columnGroups, "LAS VENTURAS", false, false )
------------<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>-----------

            end
        end
    end
end
addEventHandler ( "onClientGUIClick", grid_city, selectGroups, false )







addEventHandler ( "onClientGUIClick", guiRoot,
    function ( )
        if ( source == boton ) then			
		    local row0, col0 = guiGridListGetSelectedItem ( grid_city )
            local row, col = guiGridListGetSelectedItem ( grid_groups )
			local row3, col3 = guiGridListGetSelectedItem ( grid_skins )
            if  (row0 and col0 and row0 ~= -1 and col0 ~= -1 ) and ( row and col and row ~= -1 and col ~= -1 ) and ( row3 and col3 and row3 ~= -1 and col3 ~= -1 )  then
			 local cityName = guiGridListGetItemText ( grid_city, row0, col0 )
			local skinName = guiGridListGetItemText ( grid_skins, row3, col3 )
                local teleportName = guiGridListGetItemText ( grid_groups, row, 1 )
				
if ( teleportName == "LAS VENTURAS" ) then-->>>>>>><vinculo-grupo
				if ( skinName == "Policia >Teniente<" ) then -->>>>>>NOMBRE DEL SKIN
                    triggerServerEvent ( "Poli-LV", localPlayer )-->>>>><vinculo-spawn
					guiSetVisible ( guiventana, false )
                    showCursor ( false )
			elseif ( skinName == "Policia >Capitan<" ) then -->>>>>>-NOMBRE DEL SKIN
                    triggerServerEvent ( "Poli-LV2", localPlayer )--><vinculo-spawn
					guiSetVisible ( guiventana, false )
                    showCursor ( false )
			elseif ( skinName == "Policia >Oficial Recluta<" ) then -->>>>>>-NOMBRE DEL SKIN
                    triggerServerEvent ( "Poli-LV3", localPlayer )--><vinculo-spawn
					guiSetVisible ( guiventana, false )
                    showCursor ( false )
					end
				end
            else
                outputChatBox ( "Por favor, seleccione un lugar de la lista.", 255, 0, 0 )
            end
        end
    end
)





function selectSkin ()
    local row, col = guiGridListGetSelectedItem ( source )
    if ( row and col and row ~= -1 and col ~= -1 ) then
        local groupName = guiGridListGetItemText ( source, row, 1 )
if ( groupName == "LAS VENTURAS" ) then
setCameraMatrix ( 2327.599609375, 2208.8203125, 105, 2338.65234375, 2456.353515625, 14, 0, 70 )
			guiSetText ( memo, "descripcion del personaje" )
            guiSetText ( labelinfo, "descripcion de armas" )
            guiGridListClear ( grid_skins )
            rowSkinMan1 = guiGridListAddRow ( grid_skins )
            rowSkinMan2 = guiGridListAddRow ( grid_skins )
            rowSkinMan3 = guiGridListAddRow ( grid_skins )
            rowSkinMan4 = guiGridListAddRow ( grid_skins )
            guiGridListSetItemText ( grid_skins, rowSkinMan1, columnSkins, "Policia >Teniente<", false, false )
            guiGridListSetItemText ( grid_skins, rowSkinMan2, columnSkins, "Policia >Capitan<", false, false )
			guiGridListSetItemText ( grid_skins, rowSkinMan3, columnSkins, "Policia >Oficial Recluta<", false, false )			
guiCreateStaticImage(200, 200, 300, 200, "skinn/Skin001.jpg", false, guiventana)
			end 
    	end
	end
addEventHandler ( "onClientGUIClick", grid_groups, selectSkin, false )





addEventHandler ( "onClientPlayerWasted", localPlayer,
    function ( )
   setTimer(guiSetVisible, 2000, 1, guiventana , false )
   setTimer(guiSetVisible, 2000, 1, boton , false )
   setTimer(showCursor, 2000, 1, false )
   setTimer( MyAleatoriu, 2000, 1, false)
    end
)




function MyAleatoriu()
local Aleatorio = math.random(1,8)
 if (Aleatorio == 1) then
 setCameraMatrix(1574.53515625, -1017.4836425781, 120,1402.880859375, -785.837890625, 50)
 elseif(Aleatorio == 2) then
 setCameraMatrix(1369.7905273438, -1418.2299804688, 42.584976196289, 1335.2913818359, -1366.0750732422, 13.565061569214)
 elseif(Aleatorio == 3) then
 setCameraMatrix(1574.7861328125, -1603.6557617188, 64.496025085449, 1436.1011962891, -1683.4934082031, 13.546875)
 elseif(Aleatorio == 4) then
 setCameraMatrix(1212.9506835938, -1297.9165039063, 40, 1176.1223144531, -1322.3160400391, 10)
 elseif(Aleatorio == 5) then
 setCameraMatrix(1331.8840332031, -1280.87109375, 30, 1367.0164794922, -1279.7514648438, 13.546875) 
 elseif(Aleatorio == 6) then
 setCameraMatrix(2090.3076171875, 1945.4853515625, 12.966592788696, 2070.978515625, 1914.9150390625, 14.861493110657)
 elseif(Aleatorio == 7) then
 setCameraMatrix( 2081.1259765625, 1334, 47.372898101807, 2374.5654296875, 1180.7080078125, 10.8203125)
 elseif(Aleatorio == 8) then
 setCameraMatrix(  2234.0380859375, 2409.041015625, 10.726833343506, 2246.99609375, 2429.2314453125, 32.980667114258)
 end
  end
  
 addEventHandler( "onClientResourceStart", getResourceRootElement(),
    function ( )
            fadeCamera( true );
        setTimer( MyAleatoriu, 50, 1 );
    end
)



GUIEditor = {
    button = {},
    window = {},
    label = {}
}
addEventHandler ( "onClientPlayerWasted", localPlayer,
function ()
setTimer ( function()
local screenW, screenH = guiGetScreenSize()
GuiHospital = guiCreateWindow(screenW - 664 - 10, (screenH - 145) / 2, 364, 145, "Hospital Menu", false)
guiWindowSetSizable(GuiHospital, false)
font2 = guiCreateFont("font.otf", 13)
--botonhospital = guiCreateButton(10, 99, 139, 36, "Hospital", false, GuiHospital)
--guiSetFont(botonhospital, "default-bold-small")
guiSetFont(botonhospital, font2)
font3 = guiCreateFont("font.otf", 13)
guiSetProperty(botonhospital, "NormalTextColour", "FFFEFEFF")
botonmenu = guiCreateButton(215, 99, 139, 36, "Menu Spawn", false, GuiHospital)
--guiSetFont(botonmenu, "default-bold-small")
guiSetFont(botonmenu, font3)
guiSetProperty(botonmenu, "NormalTextColour", "FFFD0000")
--leb = guiCreateLabel(6, 29, 352, 15, "  Nacer en el Hospital.", false, GuiHospital)
guiSetFont(leb, "default-bold-small")
guiLabelSetColor(leb, 0, 254, 12)
guiSetVisible ( guiventana, false )
showCursor ( true )
addEventHandler("onClientGUIClick", botonmenu, funcionmenu, false )
addEventHandler("onClientGUIClick", botonhospital, funcionhospital, false )
end, 2500, 1 )
end)





function funcionhospital()
dame = getElementModel(source)
setElementPosition ( localPlayer, 1178.0686035156,-1324.5438232422,14.10182762146 )
fadeCamera(localPlayer, true)
setCameraTarget ( localPlayer, localPlayer )
setElementModel ( localPlayer, dame )
setElementHealth ( localPlayer, 100 )
 guiSetVisible ( GuiHospital, false )
 showCursor( false )
end
--addCommandHandler("funcionmenu", funcionmenu)



function funcionmenu()
   setTimer(guiSetVisible, 2000, 1, guiventana , true )
   setTimer(guiSetVisible, 2000, 1, boton , true )
   setTimer(showCursor, 2000, 1, true )
   setTimer( MyAleatoriu, 2000, 1, true)
   guiSetVisible ( GuiHospital, false )
    
end

 

 

ESPERO PUEDAN AYUDARME.. necesito y me gustaria que aunguno de ellos sea para el admin..

 

I HOPE YOU CAN HELP ME .. I need and I would like some of them to be for the admin ..

Link to comment

No es necesario que utilices el inglés en esta seccion, es la seccion en español. ( Esto en el caso de que no hayan movido tu topic )

La respuesta a tu pregunta es que si, se puede "privatizar" una funcion o evento. Debes utilizar la funcion:

isObjectInACLGroup()

En el caso de que quieras hacerlo para un grupo ACL. ( La wiki te proporciona ejemplos claros sobre el uso de la misma )

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...