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

Wysłany: 2014-09-13, 21:48


Dorex

Rick






Wiek: 28
Na forum: 4856 dni
Posty: 108

Piwa: 2471

Respekt: 296,3
Respekt: 296,3Respekt: 296,3Respekt: 296,3

Spr?buj tak wymagaj? tego od nowych wersji MTA

[2014-09-13 20] WARNING: Script 'SAPD/test.lua' is not encoded in UTF-8. Loading as ANSI...

Aby unikn?? tego zmie? w swoim programie w kt?rym to piszesz kodowanie z UTF-8 na UTF-8 (Bez BOM) cz?sto nazywa to si? "Formatuj, Edycja, Ustawienia" tylko licz si? z tym ?e polskie znaki i inne ni? standardowe zamieni na [EQR] czyli kod maszynowy wystarczy je usun?? i wstawi? prawid?owe dla tego zr?b lepiej kopie :D

A co do kodu musisz go wpisa? po stronie serwera oraz zamie? ca?a funkcj? wejd? na t? u mnie sprawdza?em dzia?a.


function wejdz (player,seat,jacket)
if seat == 0 then
    if getElementData(source"SAPD") == "tak" then
        if isPlayerInTeam(player,"SAPD"then
        --//Jeste? Policja
        else
        if not(wasEventCancelled ( )) then
        cancelEvent()
        outputChatBox("Nie jestes pracownikiem SAPD",player,255,0,0)
        end
       end
    else
    --//Te Auto nie jest Policyjnym    
    end
else
--//Nie chce jedz jako Kierowca    
end
end
addEventHandler "onVehicleStartEnter"getRootElement(), wejdz )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-13, 22:37


Zbyklon







Wiek: 50
Na forum: 4290 dni
Posty: 45
Nick w MP: Zbyklon

Piwa: 7

Respekt: 55,3

function infek1(model,x,y,zrx,ry,rznumberplatedirectionvariant1variant2)
if model and and and and rx and ry and rz then
local infek createVehicle(model,x,y,zrx,ry,rznumberplatedirectionvariant1variant2)
removeVehicleSirens(infek)
addVehicleSirens infek22truefalsetruefalse setVehicleSirens infek1, -0.7002.600, -0.50025500255255 )
setVehicleSirens infek20.7002.600, -0.50000255255255 )
setVehicleColor (infek000)
addVehicleUpgrade infek1096 )
setElementData(infek,"SAPD","tak")
end
end

function infek2()
infek1(41122642473.54272460942.7917623519897000"SAPDW 01"false0infek1(41122682473.54272460942.7917623519897000"SAPDW 02"false0)
infek1(4112272.52473.54272460942.7917623519897000"SAPDW 03"false0)
infek1(41122772473.54272460942.7917623519897000"SAPDW 04"false0)
infek1(4112281.252473.54272460942.7917623519897000"SAPDW 05"false0)
infek1(4112285.752473.54272460942.7917623519897000"SAPDW 06"false0)
--infek1(41122682473.54272460942.7917623519897000"SAPDW 00"false0)
end
addEventHandler('onResourceStart',getResourceRootElement(getThisResource()),infek2)

function isPlayerInTeam(playerteam)
    assert(isElement(player) and getElementType(player) == "player""Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]")
    assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]")
    return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true)))
end

function wejdz (player,seat,jacket)
if seat == 0 then
    if getElementData(source"SAPD") == "tak" then
        if isPlayerInTeam(player,"SAPD"then
        --//Jeste? Policja
        else
        if not(wasEventCancelled ( )) then
        cancelEvent()
        outputChatBox("Nie jestes pracownikiem SAPD",player,255,0,0)
        end
       end
    else
    --//Te Auto nie jest Policyjnym    
    end
else
--//Nie chce jedz jako Kierowca    
end
end
addEventHandler "onVehicleStartEnter"getRootElement(), wejdz )

zwa?aj?c na powy?sze uwagi m?j kod wygl?da tak jak powy?e j...
Powie mi kto? gdzie tu jest b??d, po zast?pieniu tamt? funkcj? "wejdz" na funkcje Dorex'a wgl nie spawni? si? te pojazdy natomiast wcze?niejsza opcja pozwala wej?? ka?demu ;-;


///EDIT !

Okej dzia?a :> piwka lec?

Postaw piwo autorowi tego posta
 

 
Tagi: pojazdy :: acl :: team
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Pojazdy na ACL / Team 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