BlackTen
LUA Dev.
Wiek: 28 Na forum: 4329 dni Posty: 698
Piwa : 2080
Ju? dzia?a, lecz gdy dodaj? kod na nie zabijanie teamu. Wtedy si? psuj?
[ Dodano : 2016-02-01, 21:11 ]
S - SIDE
-- T E A M Y
local grove = createTeam ( "Grove Street Family" , 0 , 100 , 0 )
local vagos = createTeam ( "Vagos" , 254 , 254 , 51 )
local balla = createTeam ( "Ballas" , 255 , 0 , 150 )
local polic = createTeam ( "Policja" , 0 , 0 , 255 )
local aztec = createTeam ( "Aztec" , 0 , 255 , 255 )
local mafia = createTeam ( "Rosyjska Mafia" , 150 , 75 , 0 )
-- E V E N T Y
addEvent ( "grove" , true )
addEvent ( "ballas" , true )
addEvent ( "vagos" , true )
addEvent ( "poli" , true )
addEvent ( "aztec" , true )
addEvent ( "mafia" , true )
-- N I E Z A B I J A N I E T E A M ? W
function groveb ( plr )
if getPlayerTeam ( plr , "Grove Street Family" ) then
local zdrowie = getElementHealth ( plr )
if zdrowie =< 999 then
setElementHealt ( plr , 100 )
end
end
addEventHandler ( 'onResourceStart' , groveb )
-- G R O V E S T R E E T
local spawnygrove = {
{ 2497.96753 , - 1653.08228 , 13.45108 },
{ 2504.72729 , - 1681.42444 , 13.54688 },
{ 2523.05908 , - 1668.27869 , 15.00279 },
{ 2505.85742 , - 1687.93835 , 13.55422 },
}
addEventHandler ( "grove" , root ,
function ( player )
local rnd = math . random ( 1 , #spawnygrove)
local skinygrove = math . random ( 105 , 107 )
spawnPlayer ( player , spawnygrove [ rnd ][ 1 ], spawnygrove [ rnd ][ 2 ], spawnygrove [ rnd ][ 3 ])
setElementModel ( player , skinygrove )
setPlayerTeam ( player , grove )
setPlayerNametagColor ( player , 0 , 100 , 0 )
giveWeapon ( player , 31 , 200 )
giveWeapon ( player , 32 , 200 )
giveWeapon ( player , 16 , 5 )
end
)
-- V A G O S
local spawnyvagos = {
{ 2693.46094 , - 1236.32410 , 58.08152 },
{ 2693.72681 , - 1195.94763 , 69.76436 },
{ 2676.23193 , - 1211.73401 , 63.76993 },
{ 2663.81445 , - 1244.79846 , 52.30690 },
}
addEventHandler ( "vagos" , root ,
function ( player )
local rnd = math . random ( 1 , #spawnyvagos)
local skinyvagos = math . random ( 108 , 110 )
spawnPlayer ( player , spawnyvagos [ rnd ][ 1 ], spawnyvagos [ rnd ][ 2 ], spawnyvagos [ rnd ][ 3 ])
setElementModel ( player , skinyvagos )
setPlayerTeam ( player , vagos )
setPlayerNametagColor ( player , 254 , 254 , 51 )
giveWeapon ( player , 30 , 200 )
giveWeapon ( player , 29 , 200 )
giveWeapon ( player , 18 , 5 )
end
)
-- B A L L A
local spawnyballas = {
{ 1645.68079 , - 1144.74817 , 24.07421 },
{ 1682.87073 , - 1099.57410 , 24.07031 },
{ 1612.36133 , - 1098.47058 , 23.90625 },
{ 1639.96265 , - 1083.13245 , 23.90625 },
}
addEventHandler ( "ballas" , root ,
function ( player )
local rnd = math . random ( 1 , #spawnyballas)
local skinyballas = math . random ( 102 , 104 )
spawnPlayer ( player , spawnyballas [ rnd ][ 1 ], spawnyballas [ rnd ][ 2 ], spawnyballas [ rnd ][ 3 ])
setElementModel ( player , skinyballas )
setPlayerTeam ( player , balla )
setPlayerNametagColor ( player , 255 , 0 , 150 )
giveWeapon ( player , 31 , 200 )
giveWeapon ( player , 28 , 200 )
giveWeapon ( player , 17 , 5 )
end
)
C - SIDE
addEvent ( "zalogowalS" , true )
addEventHandler ( "zalogowalS" , root ,
function ()
grove = guiCreateButton ( 0.31 , 0.38 , 0.13 , 0.10 , "Grove Street Family" , true )
guiSetProperty ( grove , "NormalTextColour" , "FFAAAAAA" )
guiSetVisible ( grove , true )
vagos = guiCreateButton ( 0.31 , 0.27 , 0.13 , 0.10 , "Vagos" , true )
guiSetProperty ( vagos , "NormalTextColour" , "FFAAAAAA" )
guiSetVisible ( vagos , true )
ballas = guiCreateButton ( 0.45 , 0.27 , 0.13 , 0.10 , "Ballas" , true )
guiSetProperty ( ballas , "NormalTextColour" , "FFAAAAAA" )
guiSetVisible ( ballas , true )
poli = guiCreateButton ( 0.59 , 0.27 , 0.13 , 0.10 , "Policja" , true )
guiSetProperty ( poli , "NormalTextColour" , "FFAAAAAA" )
guiSetVisible ( poli , true )
aztec = guiCreateButton ( 0.45 , 0.38 , 0.13 , 0.10 , "Aztec" , true )
guiSetProperty ( aztec , "NormalTextColour" , "FFAAAAAA" )
guiSetVisible ( aztec , true )
mafia = guiCreateButton ( 0.59 , 0.38 , 0.13 , 0.10 , "Rosyjska Mafia" , true )
guiSetProperty ( mafia , "NormalTextColour" , "FFAAAAAA" )
guiSetVisible ( mafia , true )
showCursor ( true , false )
showChat ( false )
end
)
addEventHandler ( "onClientGUIClick" , getRootElement (),
function ()
if source ~= grove then return end
triggerServerEvent ( "grove" , getRootElement (), localPlayer )
showCursor ( false , false )
showChat ( true )
guiSetVisible ( grove , false )
guiSetVisible ( ballas , false )
guiSetVisible ( vagos , false )
guiSetVisible ( aztec , false )
guiSetVisible ( mafia , false )
guiSetVisible ( poli , false )
setCameraTarget ( localPlayer )
fadeCamera ( true , 10 )
end
)
addEventHandler ( "onClientGUIClick" , getRootElement (),
function ()
if source ~= vagos then return end
triggerServerEvent ( "vagos" , getRootElement (), localPlayer )
showCursor ( false , false )
showChat ( true )
guiSetVisible ( grove , false )
guiSetVisible ( ballas , false )
guiSetVisible ( vagos , false )
guiSetVisible ( aztec , false )
guiSetVisible ( mafia , false )
guiSetVisible ( poli , false )
setCameraTarget ( localPlayer )
fadeCamera ( true , 10 )
end
)
addEventHandler ( "onClientGUIClick" , getRootElement (),
function ()
if source ~= ballas then return end
triggerServerEvent ( "ballas" , getRootElement (), localPlayer )
showCursor ( false , false )
showChat ( true )
guiSetVisible ( grove , false )
guiSetVisible ( ballas , false )
guiSetVisible ( vagos , false )
guiSetVisible ( aztec , false )
guiSetVisible ( mafia , false )
guiSetVisible ( poli , false )
setCameraTarget ( localPlayer )
fadeCamera ( true , 10 )
end
)