Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2016-08-10, 23:45


STOPseba

Emeryt na scenie MTA






Wiek: 25
Na forum: 3771 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5014

Respekt: 576,3
Respekt: 576,3

Witam mo?e kto? mi pom?c z tym skryptem na po?ary.Chodzi o to ?eby informacja o Po?arach wy?wietla?a si? tylko graczy w acl PSP
client:
local fireTypes = {'fire''fire_med''fire_large'};
local fireData = {};

addEvent('attemptCreateFire'true);
addEventHandler('attemptCreateFire'root, function(colshape)
     if not isElement(colshape) and getElementType(colshape) == false then return end

     local x,y,getElementPosition(colshape)
     local effect createEffect(fireTypes[math.random(1#fireTypes)], x,y,z)
    fireData[colshape] = effect
    
    addEventHandler('onClientElementDestroy'effect, function() fireData[colshape] = nil end);
    addEventHandler('onClientElementDestroy'colshape, function() destroyElement(fireData[colshape]) fireData[colshape] = nil end)
end);

addEventHandler('onClientPlayerWeaponFire'localPlayer, function(wep,_,_,hitX,hitY)
    if wep ~= 42 then return end
    for _v in ipairs(getElementsByType('colshape',resourceRoot)) do
        
        local x,y,getElementPosition(v)

        local dist getDistanceBetweenPoints2D(hitX,hitY,x,y,z);

        if dist 3 then
            triggerServerEvent('attemptDestroyFire'localPlayerv)
        end
    end
end);

addEventHandler('onClientResourceStart'resourceRoot, function()
    triggerServerEvent('attemptRandomFire'root);
end);

ogien:
local groupName 'PSP';
 
--{xyz'trawa'}, -- info na temat dodawania kolejnych po?ar?w
local fireCoords = {
    {-2817.48975,337.68900,4.50193,'Osiedle ko?o GS!'},
    {2513.96606, -1657.6367212.81505,'Grove Street!'},
    {1126.57568, -1454.5261215.79688,'Centrum handlowe!'},
    {2165.88477, -1805.0605513.37065,'Osielde!'},
                  {314.26550,-1769.42053,4.60265,'Domu Pla?a LS!'},
                  {1579.86157, -1619.6087613.38281,'Parking policyjny!'},
                  {1021.87042, -1091.8476623.8348,'Zaplecze klubu LS!'},
                  {2410.15454, -1425.4781523.98221,'Recycling center'},
                  {1943.72742, -1771.7905313.39060,'Stacja Benzynowa LS-Idlewood!'},
                  {2672.54932, -1951.7771013.54688,'Transformator!'},
                  {1987.43066, -2198.1682113.54688,'Lotnisko LS!'},
                  {874.21649, -1260.1212214.93777,'Studio filmowe!'},
                  {2760.30518, -2390.0048813.63281,'Doki LS!'},
                  {1188.79199,-2034.27881,69.00781,'?awki Park LS (dzielnica Vedant Bluffs)'},
                  {1726.19727, -1971.5142814.11719,'Stacja kolejowa LS!'},
                  {374.13165, -2043.613287.67188,'Diabelski m?yn LS!'},
                  {758.34332, -1258.0474913.56406,'Kort tenisowy!'},

};

addEvent('attemptDestroyFire'true);
addEvent('attemptRandomFire'true);

local function createMyFire(xyz)
    local colshape createColSphere(xyz2);
    triggerClientEvent('attemptCreateFire'rootcolshape);

    return colshape;
end

local function createRandomFire()
    local posID math.random(1#fireCoords);

    for i=1,do
        createMyFire(fireCoords[posID][1] + ifireCoords[posID][2] + ifireCoords[posID][3]);
        createMyFire(fireCoords[posID][1] - ifireCoords[posID][2] + ifireCoords[posID][3]);
        createMyFire(fireCoords[posID][1] + ifireCoords[posID][2] - ifireCoords[posID][3]);
        createMyFire(fireCoords[posID][1] - ifireCoords[posID][2] - ifireCoords[posID][3]);
    end
    outputChatBox('Po?ar : '..fireCoords[posID][4])
end

addEventHandler('onColShapeHit'root, function(hitElement)
if isElement(hitElement) and getElementType(hitElement) == "player" then

    local group aclGetGroup(groupName)
    local konto getPlayerAccount(hitElement)
    if not isObjectInACLGroup('user.'..getAccountName(konto), groupthen
    end
    end
end);

addEventHandler('attemptDestroyFire'root, function(colshape)
    local group aclGetGroup(groupName);
    local konto getPlayerAccount(source)
    if not isObjectInACLGroup('user.'..getAccountName(konto), groupthen return end

    if isElement(colshapethen
        destroyElement(colshape);
        givePlayerMoney sourcemath.random(0,1) )
    end

    local cols #getElementsByType('colshape', resourceRoot);

    if cols == 0 then
        Timer(function() createRandomFire() end9000001);
    end
end);

addEventHandler('attemptRandomFire'root, function()
    createRandomFire();
end);

Za pomoc :piwo:

Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-11, 09:35


eject

kurdebele






Wiek: 30
Na forum: 3659 dni
Posty: 182
Nick w MP: EjecT

Piwa: 2456

Respekt: 85,8

Ostrzeżeń: 60%
Funkcj? createRandomFire()
podmien na:
Grupe ustawiasz na samej g?rze twojego skryptu w groupName
tylko na koncu usun ;

local function createRandomFire()
    local posID math.random(1#fireCoords);

    for i=1,do
        createMyFire(fireCoords[posID][1] + ifireCoords[posID][2] + ifireCoords[posID][3]);
        createMyFire(fireCoords[posID][1] - ifireCoords[posID][2] + ifireCoords[posID][3]);
        createMyFire(fireCoords[posID][1] + ifireCoords[posID][2] - ifireCoords[posID][3]);
        createMyFire(fireCoords[posID][1] - ifireCoords[posID][2] - ifireCoords[posID][3]);
    end
   for k,v in ipairs getElementsByType "player" )) do
   local konto getAccountName (getPlayerAccount(v))
   if isObjectInACLGroup "user." .. kontoaclGetGroup (groupName) ) then
   outputChatBox('Po?ar : '..fireCoords[posID][4],v)
end
end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-11, 11:46


STOPseba

Emeryt na scenie MTA






Wiek: 25
Na forum: 3771 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5014

Respekt: 576,3
Respekt: 576,3

"eject" napisał/a:

Funkcj? createRandomFire()
podmien na:
Grupe ustawiasz na samej g?rze twojego skryptu w groupName
tylko na koncu usun ;

local function createRandomFire()
    local posID math.random(1#fireCoords);

    for i=1,do
        createMyFire(fireCoords[posID][1] + ifireCoords[posID][2] + ifireCoords[posID][3]);
        createMyFire(fireCoords[posID][1] - ifireCoords[posID][2] + ifireCoords[posID][3]);
        createMyFire(fireCoords[posID][1] + ifireCoords[posID][2] - ifireCoords[posID][3]);
        createMyFire(fireCoords[posID][1] - ifireCoords[posID][2] - ifireCoords[posID][3]);
    end
   for k,v in ipairs getElementsByType "player" )) do
   local konto getAccountName (getPlayerAccount(v))
   if isObjectInACLGroup "user." .. kontoaclGetGroup (groupName) ) then
   outputChatBox('Po?ar : '..fireCoords[posID][4],v)
end
end
end

chyba co? robi? zle robi? bo nie dzia?a

Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-13, 22:00


Loop

Inspektor






Wiek: 27
Na forum: 4289 dni
Posty: 311
Nick w MP: Inspektor

Piwa: 201

Respekt: 130
Respekt: 130

wielki panie skrypterze powinien sam to pan zrobic a nie sie wartosciowac jaki z ciebie skrypter jest a nic nie potrafi.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-14, 00:48


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

Loop, Skrypt jest moj? w?asno?ci?, lecz wyciek? on do sieci przez co musia?em go 'porz?dnie' ulepszy? zmodernizowa?, ale skoro ten tutaj pan sie uwa?a za skryptera kt?ry wszystko umie a tu wyk?ada si? na takiej b?achostce.....


STOPseba,

Tak ?le musisz kopiowa? kod....

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-14, 01:39


STOPseba

Emeryt na scenie MTA






Wiek: 25
Na forum: 3771 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5014

Respekt: 576,3
Respekt: 576,3

"marcin778" napisał/a:

Loop, Skrypt jest moj? w?asno?ci?, lecz wyciek? on do sieci przez co musia?em go 'porz?dnie' ulepszy? zmodernizowa?, ale skoro ten tutaj pan sie uwa?a za skryptera kt?ry wszystko umie a tu wyk?ada si? na takiej b?achostce.....


STOPseba,

Tak ?le musisz kopiowa? kod....

Nie wiem o co wam chodzi nigdzie nie napisa?em ze jestem skrypterem.
Dzi?ki za pomoc poradzi?em sobie z tym problemem.

Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Tagi: pożary
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku