piotr172
Wiek: 26 Na forum: 4417 dni Posty: 130
Piwa : 2329
Witam, mam skrypt na serwerze. A wiec tak gdy serwer by? na 1.3 skrypt dzia?a?. A gdy zmieni?em wersje na 1.4 to skrypt nie dzia?a. Jak naciskam GUI to nic sie nie dzieje. Nawet muzyka si? nie stopuje. W DB3 nic si? nie pokazuje.
Oto kod:
client:
local x , y = guiGetScreenSize ()
local GUIEditor_Button1 = guiCreateButton ( 20 / 640 * x , 15 / 480 * y , 150 / 640 * x , 25 / 480 * y , "San Fierro" , false )
local GUIEditor_Button2 = guiCreateButton ( 20 / 640 * x , 40 / 480 * y , 150 / 640 * x , 25 / 480 * y , "Las Venturas" , false )
local GUIEditor_Button3 = guiCreateButton ( 20 / 640 * x , 65 / 480 * y , 150 / 640 * x , 25 / 480 * y , "Los Santos" , false )
local GUIEditor_Button4 = guiCreateButton ( 20 / 640 * x , 90 / 480 * y , 150 / 640 * x , 25 / 480 * y , "Las Paysadas" , false )
local GUIEditor_Button5 = guiCreateButton ( 20 / 640 * x , 115 / 480 * y , 150 / 640 * x , 25 / 480 * y , "El Quebrados" , false )
local GUIEditor_Button6 = guiCreateButton ( 20 / 640 * x , 140 / 480 * y , 150 / 640 * x , 25 / 480 * y , "Bluberry" , false )
local GUIEditor_Button7 = guiCreateButton ( 20 / 640 * x , 165 / 480 * y , 150 / 640 * x , 25 / 480 * y , "Fort Carson" , false )
local GUIEditor_Button8 = guiCreateButton ( 20 / 640 * x , 190 / 480 * y , 150 / 640 * x , 25 / 480 * y , "Las Venturas/Szpital" , false )
local GUIEditor_Button9 = guiCreateButton ( 20 / 640 * x , 215 / 480 * y , 150 / 640 * x , 25 / 480 * y , "Montgomery" , false )
local GUIEditor_Button10 = guiCreateButton ( 20 / 640 * x , 240 / 480 * y , 150 / 640 * x , 25 / 480 * y , "Palomino Creek" , false )
local GUIEditor_Button11 = guiCreateButton ( 20 / 640 * x , 265 / 480 * y , 150 / 640 * x , 25 / 480 * y , "Dillimore" , false )
local GUIEditor_Button12 = guiCreateButton ( 20 / 640 * x , 290 / 480 * y , 150 / 640 * x , 25 / 480 * y , "Kopalnia" , false )
local GUIEditor_Button13 = guiCreateButton ( 20 / 640 * x , 315 / 480 * y , 150 / 640 * x , 25 / 480 * y , "Wojsko" , false )
local GUIEditor_Button14 = guiCreateButton ( 20 / 640 * x , 340 / 480 * y , 150 / 640 * x , 25 / 480 * y , "Lotnisko/Pustynia" , false )
local GUIEditor_Button15 = guiCreateButton ( 20 / 640 * x , 365 / 480 * y , 150 / 640 * x , 25 / 480 * y , "Bayside" , false )
showCursor ( true )
function closeAllButtons ()
guiSetVisible ( GUIEditor_Button1 , false )
guiSetVisible ( GUIEditor_Button2 , false )
guiSetVisible ( GUIEditor_Button3 , false )
guiSetVisible ( GUIEditor_Button4 , false )
guiSetVisible ( GUIEditor_Button5 , false )
guiSetVisible ( GUIEditor_Button6 , false )
guiSetVisible ( GUIEditor_Button7 , false )
guiSetVisible ( GUIEditor_Button8 , false )
guiSetVisible ( GUIEditor_Button9 , false )
guiSetVisible ( GUIEditor_Button10 , false )
guiSetVisible ( GUIEditor_Button11 , false )
guiSetVisible ( GUIEditor_Button12 , false )
guiSetVisible ( GUIEditor_Button13 , false )
guiSetVisible ( GUIEditor_Button14 , false )
guiSetVisible ( GUIEditor_Button15 , false )
showCursor ( false )
end
function spawnA ()
triggerServerEvent ( "onSpawn" , getLocalPlayer (), "San Fierro" )
closeAllButtons ()
end
addEventHandler ( "onClientGUIClick" , GUIEditor_Button1 , spawnA , false )
function spawnB ()
triggerServerEvent ( "onSpawn" , getLocalPlayer (), "Las Venturas" )
closeAllButtons ()
end
addEventHandler ( "onClientGUIClick" , GUIEditor_Button2 , spawnB , false )
function spawnC ()
triggerServerEvent ( "onSpawn" , getLocalPlayer (), "Los Santos" )
closeAllButtons ()
end
addEventHandler ( "onClientGUIClick" , GUIEditor_Button3 , spawnC , false )
function spawnD ()
triggerServerEvent ( "onSpawn" , getLocalPlayer (), "Las Paysadas" )
closeAllButtons ()
end
addEventHandler ( "onClientGUIClick" , GUIEditor_Button4 , spawnD , false )
function spawnE ()
triggerServerEvent ( "onSpawn" , getLocalPlayer (), "Tierra Robada" )
closeAllButtons ()
end
addEventHandler ( "onClientGUIClick" , GUIEditor_Button5 , spawnE , false )
function spawnF ()
triggerServerEvent ( "onSpawn" , getLocalPlayer (), "Bluberry" )
closeAllButtons ()
end
addEventHandler ( "onClientGUIClick" , GUIEditor_Button6 , spawnF , false )
function spawn1 ()
triggerServerEvent ( "onSpawn" , getLocalPlayer (), "Fort Carson" )
closeAllButtons ()
end
addEventHandler ( "onClientGUIClick" , GUIEditor_Button7 , spawn1 , false )
function spawn2 ()
triggerServerEvent ( "onSpawn" , getLocalPlayer (), "Las Venturas/Szpital" )
closeAllButtons ()
end
addEventHandler ( "onClientGUIClick" , GUIEditor_Button8 , spawn2 , false )
function spawn3 ()
triggerServerEvent ( "onSpawn" , getLocalPlayer (), "Montgomery" )
closeAllButtons ()
end
addEventHandler ( "onClientGUIClick" , GUIEditor_Button9 , spawn3 , false )
function spawn4 ()
triggerServerEvent ( "onSpawn" , getLocalPlayer (), "Palomino Creek" )
closeAllButtons ()
end
addEventHandler ( "onClientGUIClick" , GUIEditor_Button10 , spawn4 , false )
function spawn5 ()
triggerServerEvent ( "onSpawn" , getLocalPlayer (), "Dillimore" )
closeAllButtons ()
end
addEventHandler ( "onClientGUIClick" , GUIEditor_Button11 , spawn5 , false )
function spawn6 ()
triggerServerEvent ( "onSpawn" , getLocalPlayer (), "Kopalnia" )
closeAllButtons ()
end
addEventHandler ( "onClientGUIClick" , GUIEditor_Button12 , spawn6 , false )
function spawn7 ()
triggerServerEvent ( "onSpawn" , getLocalPlayer (), "Wojsko" )
closeAllButtons ()
end
addEventHandler ( "onClientGUIClick" , GUIEditor_Button13 , spawn7 , false )
function spawn8 ()
triggerServerEvent ( "onSpawn" , getLocalPlayer (), "Lotnisko/Pustynia" )
closeAllButtons ()
end
addEventHandler ( "onClientGUIClick" , GUIEditor_Button14 , spawn8 , false )
function spawn9 ()
triggerServerEvent ( "onSpawn" , getLocalPlayer (), "Bayside" )
closeAllButtons ()
end
addEventHandler ( "onClientGUIClick" , GUIEditor_Button15 , spawn9 , false )
-- muzyczka
function startMySound ()
sound = playSound ( "buena.mp3" , true )
end
addEventHandler ( "onClientResourceStart" , getResourceRootElement ( getThisResource () ), startMySound )
function stopMySound ()
stopSound ( sound )
end
addEventHandler ( "onClientPlayerSpawn" , getLocalPlayer (), stopMySound )
server:
local rot = getRootElement ()
addEvent ( "onSpawn" , true )
addEventHandler ( "onSpawn" , getRootElement (),
function( spawn )
if ( spawn == "San Fierro" ) then
fadeCamera ( source , true )
setCameraTarget ( source , source )
outputChatBox ( "Witamy w San Fierro!" , source )
spawnPlayer ( source , - 1938.75 , 889.20 , 38.50 , rot , getElementModel ( source ))
return
end
if ( spawn == "Las Venturas" ) then
fadeCamera ( source , true )
setCameraTarget ( source , source )
outputChatBox ( "Witamy w Las Venturas!" , source )
spawnPlayer ( source , 2446.90 , 2375.99 , 12.16 , rot , getElementModel ( source ))
return
end
if ( spawn == "Fort Carson" ) then
fadeCamera ( source , true )
setCameraTarget ( source , source )
outputChatBox ( "Witamy w Fort Carson!" , source )
spawnPlayer ( source , - 96.20 , 1086.83 , 19.74 , rot , getElementModel ( source ))
return
end
if ( spawn == "Las Paysadas" ) then
fadeCamera ( source , true )
setCameraTarget ( source , source )
outputChatBox ( "Witamy w Las Paysadas!" , source )
spawnPlayer ( source , - 236.69 , 2608.50 , 62.70 , rot , getElementModel ( source ))
return
end
if ( spawn == "Tierra Robada" ) then
fadeCamera ( source , true )
setCameraTarget ( source , source )
outputChatBox ( "Witamy w El Quebrados!" , source )
spawnPlayer ( source , - 1513.03 , 2532.32 , 55.69 , rot , getElementModel ( source ))
return
end
if ( spawn == "Bluberry" ) then
fadeCamera ( source , true )
setCameraTarget ( source , source )
outputChatBox ( "Witamy w Bluberry!" , source )
spawnPlayer ( source , 140.25897 , - 203.83972 , 1.57813 , 180.31604 , rot , getElementModel ( source ))
return
end
if ( spawn == "Los Santos" ) then
fadeCamera ( source , true )
setCameraTarget ( source , source )
outputChatBox ( "Witamy w Los Santos!" , source )
spawnPlayer ( source , 1481.23804 , - 1765.80811 , 18.79576 , rot , getElementModel ( source ))
return
end
if ( spawn == "Las Venturas/Szpital" ) then
fadeCamera ( source , true )
setCameraTarget ( source , source )
outputChatBox ( "Witamy w Las Venturas/Szpital!" , source )
spawnPlayer ( source , 1601.35999 , 1817.23169 , 10.82031 , rot , getElementModel ( source ))
return
end
if ( spawn == "Montgomery" ) then
fadeCamera ( source , true )
setCameraTarget ( source , source )
outputChatBox ( "Witamy w Montgomery!" , source )
spawnPlayer ( source , 1285.34851 , 260.03430 , 19.54689 , 253.83905 , rot , getElementModel ( source ))
return
end
if ( spawn == "Palomino Creek" ) then
fadeCamera ( source , true )
setCameraTarget ( source , source )
outputChatBox ( "Witamy w Palomino Creeak!" , source )
spawnPlayer ( source , 2302.65308 , - 35.31084 , 26.48438 , 80 , rot , getElementModel ( source ))
return
end
if ( spawn == "Dillimore" ) then
fadeCamera ( source , true )
setCameraTarget ( source , source )
outputChatBox ( "Witamy w Dillimore!" , source )
spawnPlayer ( source , 690.51605 , - 536.97711 , 16.33594 , 90 , rot , getElementModel ( source ))
return
end
if ( spawn == "Kopalnia" ) then
fadeCamera ( source , true )
setCameraTarget ( source , source )
outputChatBox ( "Witamy w Kopalni LV!" , source )
spawnPlayer ( source , 591.42615 , 869.72198 , - 42.49732 , 271.51062 , rot , getElementModel ( source ))
return
end
if ( spawn == "Wojsko" ) then
fadeCamera ( source , true )
setCameraTarget ( source , source )
outputChatBox ( "Witamy w Wojsku!" , source )
spawnPlayer ( source , 342.57129 , 1785.80164 , 17.82133 , 34.96519 , rot , getElementModel ( source ))
return
end
if ( spawn == "Lotnisko/Pustynia" ) then
fadeCamera ( source , true )
setCameraTarget ( source , source )
outputChatBox ( "Witamy w Lotnisku na Pustyni.!" , source )
spawnPlayer ( source , 401.76721 , 2532.19678 , 16.54523 , 180.32983 , rot , getElementModel ( source ))
return
end
if ( spawn == "Bayside" ) then
fadeCamera ( source , true )
setCameraTarget ( source , source )
outputChatBox ( "Witamy w Bayside!" , source )
spawnPlayer ( source ,- 2486.35596 , 2403.27026 , 16.15622 , 118.93925 , rot , getElementModel ( source ))
return
end
end
)
addEventHandler ( "onResourceStart" , resourceRoot ,
function()
for i , player in ipairs ( getElementsByType ( "player" )) do
spawn ( player )
end
end
)
function spawn ( player )
setPlayerNametagColor ( player , 244 , 244 , 244 )
setPlayerTeam ( player , nil )
end
function spawnWasted ( player )
outputChatBox ( "Zosta?e? ranny. Odrodzi?e? si? w szpitalu w San Fierro " )
spawnPlayer ( player , - 2665.74 , 636.11 , 14.45 , 325 , math . random ( 19 , 25 ) )
fadeCamera ( player , true )
setCameraTarget ( player , player )
setPlayerNametagColor ( player , 244 , 244 , 244 )
takePlayerMoney ( player , 0 )
takeAllWeapons ( player )
end
addEventHandler ( "onPlayerLogin" , root ,
function()
spawn ( source )
end
)
addEventHandler ( "onPlayerWasted" , root ,
function()
setTimer ( spawnWasted , 3500 , 1 , source )
end
)
function setCameraOnPlayerJoin ()
fadeCamera ( source , true , 5 )
setCameraMatrix ( source , 1468.8785400391 , - 919.25317382813 , 100.153465271 , 1468.388671875 , - 918.42474365234 , 99.881813049316 )
end
addEventHandler ( "onPlayerJoin" , getRootElement (), setCameraOnPlayerJoin )
Prosz? o pomoc. Za pomoc daje zimne piwko.