Wysłany: 2017-09-12, 19:31
DaVeCS
Mapper
Wiek: 31 Na forum: 3386 dni Posty: 193
Nick w MP: DaVe
Piwa : 59
Witam, ot?? posiadam skrypt na ?ebraki i mam taki problem, gdy? jak pojawia si? ?ebrak to takie co? si? wy?wietla:
?ebrak pojawi? si? w okolicach Las Colinas! Kto pierwszy ten lepszy!
?ebrak pojawi? si? w okolicach Las Colinas! Kto pierwszy ten lepszy!
?ebrak pojawi? si? w okolicach Las Colinas! Kto pierwszy ten lepszy!
?ebrak pojawi? si? w okolicach Las Colinas! Kto pierwszy ten lepszy!
?ebrak pojawi? si? w okolicach Las Colinas! Kto pierwszy ten lepszy!
?ebrak pojawi? si? w okolicach Las Colinas! Kto pierwszy ten lepszy!
chc? ?eby tylko raz si? to wy?wietla?o, mo?e kto? pom?c?
Skrypt:
----
local time = 20 ---- w minutach
local start = false
local command = "nagroda" ---- komenda do odebrania nagrody
positions = {
-- x , y , z , rotacja -- peda
-- < 90 270 > / 0\ 0 /
{- 2708.05 , 377.27 , 4.97 , - 0.00 , 0.00 , 58.07 },
{- 1968.72 , 110.16 , 27.69 , - 0.00 , 0.00 , 7.42 },
{- 1928.82 , 829.11 , 37.98 , - 0.00 , 0.00 , 9.46 },
{- 1625.27 , 717.13 , 14.61 , - 0.00 , 0.00 , 268.40 },
{- 1947.33 , 718.14 , 46.56 , - 0.00 , 0.00 , 99.22 },
{- 2623.88 , 1411.68 , 7.09 , - 0.00 , 0.00 , 206.39 },
{- 1787.92 , 580.13 , 35.16 , - 0.00 , 0.00 , 130.39 },
{ 1540.56 , - 1616.93 , 13.38 , 330 },
{ 1734.49 , - 1888.40 , 13.56 , 90 },
{ 2168.37 , - 2240.38 , 13.29 , 90 },
{ 2233.97 , - 1333.12 , 23.98 , 90 },
{ 2386.88 , - 1483.41 , 24.36 , 180 },
{ 2445.17 , - 1758.69 , 13.59 , 180 },
{ 2918.81 , - 1599.95 , 14.95 , 90 },
{ 2790.96 , - 1534.70 , 11.09 , 235 },
{ 2792.81 , - 1087.42 , 30.72 , 270 },
{ 2315.00 , 33.69 , 27.47 , 270 },
{ 2833.73 , 47.32 , 28.57 , 90 },
{ 2103.30 , - 105.23 , 2.17 , 270 },
{ 1925.58 , 170.21 , 37.28 , 350 },
{ 1566.88 , 15.00 , 24.00 , 90 },
{ 1530.35 , 755.12 , 11.02 , 250 },
{ 1642.33 , - 2285.11 , - 1.20 , 270 },
{ 2166.82 , - 2175.74 , 18.26 , 180 },
{ 2147.95 , - 2089.95 , 13.55 , 90 },
{ 2273.03 , - 2563.28 , 8.30 , 90 },
{ 2196.22 , - 2474.51 , 13.54 , 270 },
{ 2401.24 , - 2272.10 , 15.45 , 270 },
{ 1219.02 , - 1817.76 , 13.60 , 135 },
{ 536.13 , - 1810.50 , 6.57 , 270 },
{ 389.08 , - 1899.27 , 12.53 , 90 },
{ 394.09 , - 2057.14 , 10.71 , 90 },
{ 328.53 , - 1511.75 , 36.03 , 185 },
{ 507.59 , - 1609.70 , 16.26 , 0 },
{ 725.55 , - 1451.03 , 17.70 , 0 },
{ 725.55 , - 1451.03 , 17.70 , 180 },
{ 1293.49 , - 994.78 , 38.39 , 90 },
{ 1076.69 , - 1295.02 , 17.05 , 45 },
{ 1000.60 , - 920.09 , 42.33 , 90 },
{- 386.85 , - 1438.76 , 26.32 , 180 },
{- 98.80 , - 1015.63 , 14.33 , 190 },
{- 758.29 , - 133.18 , 65.84 , 270 },
{- 152.46 , 235.31 , 10.03 , 270 },
{ 1383.42 , 465.48 , 20.19 , 180 },
{ 1324.34 , 286.11 , 20.05 , 0 },
{ 1416.92 , 261.32 , 19.54 , 90 },
{ 1797.26 , 843.46 , 10.63 , 180 },
{ 2697.57 , 907.16 , 10.61 , 270 },
{ 2853.18 , 1244.37 , 11.39 , 90 },
{ 2461.16 , 1558.15 , 11.78 , 0 },
{ 2173.31 , 1285.58 , 24.48 , 90 },
{ 1951.44 , 1343.07 , 15.37 , 270 },
{ 2000.57 , 1518.11 , 18.39 , 0 },
{ 1690.74 , 1418.48 , 11.65 , 270 },
{ 2294.84 , 1994.16 , 6.52 , 270 },
{ 2286.87 , 2432.36 , 10.82 , 180 },
{ 2097.94 , 2494.15 , 14.84 , 180 },
{ 1532.31 , 2760.98 , 11.23 , 315 },
{ 984.77 , 2562.89 , 10.75 , 252 },
{ 1064.76 , 1730.25 , 10.82 , 355 },
{ 1400.74 , 2124.11 , 14.22 , 90 },
{ 1584.04 , 1768.82 , 10.82 , 90 },
{ 2313.87 , 1391.76 , 10.98 , 0 },
{ 912.85 , 893.70 , 13.85 , 220 },
{ 541.17 , 2362.64 , 30.86 , 15 },
{- 36.26 , 2350.51 , 24.30 , 180 },
{- 802.21 , 1469.24 , 21.00 , 0 },
{ 271.25 , - 1249.67 , 73.92 , 70 },
{ 826.54 , - 924.87 , 55.25 , 260 },
{ 1119.81 , - 736.95 , 100.12 , 90 },
{ 1259.64 , - 785.12 , 92.03 , 90 },
{ 1302.73 , - 796.54 , 84.14 , 220 },
{ 1333.07 , - 658.54 , 109.62 , 5 },
{ 1521.09 , - 698.49 , 94.75 , 0 },
{ 1660.78 , - 982.69 , 29.30 , 45 },
{ 162.58 , - 1765.14 , 6.80 , 0 },
{- 420.43 , - 1840.63 , 4.02 , 200 },
{- 2105.84 , - 2480.54 , 30.63 , 230 },
{- 2532.24 , 52.55 , 8.62 , 90 },
{- 2286.76 , 148.18 , 35.31 , 225 },
{- 1679.99 , 438.45 , 7.18 , 180 },
{- 1989.89 , 1118.05 , 54.47 , 270 },
{- 2637.05 , 640.06 , 14.45 , 140 },
{- 1540.35 , - 439.03 , 6.00 , 90 },
{ 246.32 , 1435.19 , 23.37 , 180 },
{- 32.08 , 1038.67 , 20.94 , 180 },
{ 90.11 , 1182.01 , 18.66 , 90 },
{ 397.30 , 1157.74 , 8.35 , 180 },
{- 553.85 , 2593.89 , 53.93 , 270 },
{ 14.95 , 1735.54 , 22.20 , 0 },
{- 1682.56 , - 748.53 , 40.79 , 250 },
{- 1678.51 , 1365.49 , 7.18 , 325 },
{- 2659.71 , 1527.90 , 54.78 , 180 },
{- 2909.62 , 1241.94 , 9.64 , 330 },
{- 1738.27 , 32.37 , 3.55 , 175 },
{- 2237.01 , - 1746.64 , 480.87 , 30 },
{- 2402.63 , - 2268.79 , 15.14 , 105 },
{ 2138.26 , 1789.02 , 10.82 , 0 },
{ 1968.61 , 2295.86 , 16.46 , 180 },
}
function checkPed ()
if start == true then
destroyElement ( ped )
destroyElement ( col )
createPeds ()
killTimer ( timer )
timer = setTimer ( checkPed ,( 1000 * 60 )* time , 0 )
else
createPeds ()
start = true
end
end
timer = setTimer ( checkPed , 1000 *( 60 * time ), 0 )
function createPeds ()
local number = math . random ( 1 , #positions)
ped = createPed ( 137 , positions [ number ][ 1 ], positions [ number ][ 2 ], positions [ number ][ 3 ], positions [ number ][ 4 ])
col = createColSphere ( positions [ number ][ 1 ], positions [ number ][ 2 ], positions [ number ][ 3 ], 1 )
for _ , p in pairs ( getElementsByType ( "player" )) do
outputChatBox ( "?ebrak pojawi? si? w okolicach " .. getZoneName ( positions [ number ][ 1 ], positions [ number ][ 2 ], positions [ number ][ 3 ]).. "! Kto pierwszy ten lepszy!" )
end
end
function tpped ( plr )
if exports [ "dutyadmin" ]: getAdmin ( plr , 4 ) then
outputChatBox ( "Przeteleportowano do ?ebraka :D" , plr )
local x , y , z = getElementPosition ( ped )
setElementPosition ( plr , x , y , z )
else
outputChatBox ( "Kolego, nie masz uprawnie? do tej komendy :D" , plr , 255 , 0 , 0 )
end
end
addCommandHandler ( "tpbiz" , tpped )
function inCol ( plr )
if source ~= col then return end
outputChatBox ( "Aby odebra? nagrod? wpisz /" .. command .. " [numer od 1 do 2]" , plr )
end
addEventHandler ( "onColShapeHit" , resourceRoot , inCol )
function getReward ( plr , c , number )
if not getElementData ( plr , "player:logged" ) then return end
if isElementWithinColShape ( plr , col ) then
if not tonumber ( number ) then return end
if tonumber ( number ) == math . random ( 1 , 2 ) then ---- je & #65533;eli trafi to dajemy kase
local money = math . random ( 0 , 4000 ) --- przykladowe wartosci
local uid = getElementData ( plr , "player:uid" )
givePlayerMoney ( plr , money )
outputChatBox ( "Dosta?e? " .. money .. "PLN od biznesmena" , plr ) ----- nie wiem czy b & #65533;d� powiadomienia czy co� , dlatego ustawi�em outputa
outputChatBox ( "" .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. ", odnalaz? Biznesmen'a i otrzyma? " .. money .. " PLN! Gratulacje!" , root , 0 , 255 , 0 )
exports [ "ogrpg-db" ]: dbSet ( "insert into ogrpg_logs values (null,null,?,?,?,?)" , uid , getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ), "HAJS" , money )
checkPed ()
else
local reputation = math . random ( 1 , 5 )
local gp = getElementData ( plr , "player:reputation" ) or 0
local uid = getElementData ( plr , "player:uid" )
setElementData ( plr , "player:reputation" , tonumber ( gp ) + reputation )
outputChatBox ( "Dosta?e? " .. reputation .. " puntk?w reputacji od biznesmena" , plr )
outputChatBox ( "" .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. ", odnalaz? Biznesmen'a i otrzyma? " .. reputation .. " punkt?w reputacji! Gratulacje!" , root , 0 , 255 , 0 )
exports [ "ogrpg-db" ]: dbSet ( "insert into ogrpg_logs values (null,null,?,?,?,?)" , uid , getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ), "RP" , reputation )
checkPed ()
end
end
end
addCommandHandler ( command , getReward )
checkPed ()
Wysłany: 2017-09-12, 19:48
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
function createPeds ()
local number = math . random ( 1 , #positions)
ped = createPed ( 137 , positions [ number ][ 1 ], positions [ number ][ 2 ], positions [ number ][ 3 ], positions [ number ][ 4 ])
col = createColSphere ( positions [ number ][ 1 ], positions [ number ][ 2 ], positions [ number ][ 3 ], 1 )
outputChatBox ( "?ebrak pojawi? si? w okolicach " .. getZoneName ( positions [ number ][ 1 ], positions [ number ][ 2 ], positions [ number ][ 3 ]).. "! Kto pierwszy ten lepszy!" , 255 , 255 , 255 , root )
end
Wysłany: 2017-09-13, 14:06
DaVeCS
Mapper
Wiek: 31 Na forum: 3386 dni Posty: 193
Nick w MP: DaVe
Piwa : 59
Niestety teraz wog?le nie wy?wietla informacji gdzie ?ebrak si? znajduje
Wysłany: 2017-09-13, 14:14
Jacob
Głupiomądry
Wiek: 28 Na forum: 5502 dni Posty: 967
Nick w MP: Jacob
Piwa : 786
zamie? na
function createPeds ()
local number = math . random ( 1 , #positions)
ped = createPed ( 137 , positions [ number ][ 1 ], positions [ number ][ 2 ], positions [ number ][ 3 ], positions [ number ][ 4 ])
col = createColSphere ( positions [ number ][ 1 ], positions [ number ][ 2 ], positions [ number ][ 3 ], 1 )
for _ , p in pairs ( getElementsByType ( "player" )) do
outputChatBox ( "?ebrak pojawi? si? w okolicach " .. getZoneName ( positions [ number ][ 1 ], positions [ number ][ 2 ], positions [ number ][ 3 ]).. "! Kto pierwszy ten lepszy!" , p )
end
end
Wysłany: 2017-09-13, 14:34
DaVeCS
Mapper
Wiek: 31 Na forum: 3386 dni Posty: 193
Nick w MP: DaVe
Piwa : 59
Dzi?ki wielkie Dzia?a tak jak powinno
Tagi: wyświetlanie :: napisu
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: