Wysłany: 2019-04-15, 12:29
DenyPL
Wiek: 25 Na forum: 3251 dni Posty: 64
Nick w MP: D4nyPL
Wysłany: 2019-04-15, 12:35
AmaMa.
AmaMa.#3768
Wiek: 25 Na forum: 3208 dni Posty: 182
Nick w MP: AmaMa.
Piwa : 1825
DenyPL , Ten zas?b wykorzystuje SQL. Tw?j serwer jest postawiony na MySQL. Musisz sobie przerobi? ten skrypt, aby dzia?a? on z twoim systemem pojazd?w.
Wysłany: 2019-04-15, 12:38
DenyPL
Wiek: 25 Na forum: 3251 dni Posty: 64
Nick w MP: D4nyPL
"AmaMa." napisał/a :DenyPL , Ten zas?b wykorzystuje SQL. Tw?j serwer jest postawiony na MySQL. Musisz sobie przerobi? ten skrypt, aby dzia?a? on z twoim systemem pojazd?w.
Powiesz jak przerobi? ? Bo nie widz? w tym skrypcie nigdzie by by?y miejsca do wpisania hosta MySQL itp.
Wysłany: 2019-04-15, 13:34
AmaMa.
AmaMa.#3768
Wiek: 25 Na forum: 3208 dni Posty: 182
Nick w MP: AmaMa.
Piwa : 1825
DenyPL , Napisa?em Ci kod na to, musisz mie? w ogrpg_admins rang? 3, aby komendy dzia?a?y. W kodzie mo?esz sobie edytowa? potrzebn? rang?.
-- Pierwotny w ? a ? ciciel i tw ? rca kodu : AmaMa
-- Zakaz u ? ywania / edycji kodu bez wcze ? niejszej zgody ze strony w ? a ? ciciela
addCommandHandler ( "ttv" , function( plr , cmd , veh )
if getAdmin ( plr , 3 ) then
if not veh then
outputChatBox ( "* Nie poda?e? ID pojazdu." , plr , 255 , 0 , 0 )
return
end
if tonumber ( veh ) then
local v = findveh ( veh )
if not v then
outputChatBox ( "Nie znaleziono pojazdu o takim ID." , plr , 255 , 0 , 0 )
return
end
outputChatBox ( "Pomy?lnie przeniesiono do pojazdu o ID: " .. veh .. "" , plr , 255 , 0 , 0 , true )
warpPedIntoVehicle ( plr , v )
end
end
end )
addCommandHandler ( "ttp" , function( plr , cmd , veh )
if getAdmin ( plr , 3 ) then
if not veh then
outputChatBox ( "* Nie poda?e? ID pojazdu." , plr , 255 , 0 , 0 )
return
end
if tonumber ( veh ) then
local v = findveh ( veh )
if not v then
outputChatBox ( "Nie znaleziono pojazdu o takim ID." , plr , 255 , 0 , 0 )
return
end
outputChatBox ( "Pomy?lnie przeniesiono pojazd o ID: " .. veh .. "" , plr , 255 , 0 , 0 , true )
local x , y , z = getElementPosition ( plr )
setElementPosition ( v , x , y , z )
setElementPosition ( plr , x , y , z + 2 )
end
end
end )
addCommandHandler ( "vehowner" , function( plr , cmd , veh )
if getAdmin ( plr , 3 ) then
if not veh then
outputChatBox ( "* Nie poda?e? ID pojazdu." , plr , 255 , 0 , 0 )
return
end
if tonumber ( veh ) then
local result = exports [ "ogrpg-db" ]: dbGet ( "SELECT * FROM ogrpg_vehicles WHERE id=?" , veh )
if result then
local result2 = exports [ "ogrpg-db" ]: dbGet ( "SELECT * FROM ogrpg_users WHERE id=?" , result [ 1 ]. ownedPlayer )
outputChatBox ( "Pojazd o ID: " .. veh .. " nale?y do gracza: " .. result2 [ 1 ]. login .. "(UID:" .. result [ 1 ]. ownedPlayer .. ")" , plr , 255 , 0 , 0 , true )
end
end
end
end )
function findveh ( id )
for i , v in pairs ( getElementsByType ( "vehicle" )) do
if getElementData ( v , "vehicle:id" ) == id then
return v
end
end
end
Wysłany: 2019-04-15, 13:49
DenyPL
Wiek: 25 Na forum: 3251 dni Posty: 64
Nick w MP: D4nyPL
"AmaMa." napisał/a :DenyPL , Napisa?em Ci kod na to, musisz mie? w ogrpg_admins rang? 3, aby komendy dzia?a?y. W kodzie mo?esz sobie edytowa? potrzebn? rang?.
-- Pierwotny w ? a ? ciciel i tw ? rca kodu : AmaMa
-- Zakaz u ? ywania / edycji kodu bez wcze ? niejszej zgody ze strony w ? a ? ciciela
addCommandHandler ( "ttv" , function( plr , cmd , veh )
if getAdmin ( plr , 3 ) then
if not veh then
outputChatBox ( "* Nie poda?e? ID pojazdu." , plr , 255 , 0 , 0 )
return
end
if tonumber ( veh ) then
local v = findveh ( veh )
if not v then
outputChatBox ( "Nie znaleziono pojazdu o takim ID." , plr , 255 , 0 , 0 )
return
end
outputChatBox ( "Pomy?lnie przeniesiono do pojazdu o ID: " .. veh .. "" , plr , 255 , 0 , 0 , true )
warpPedIntoVehicle ( plr , v )
end
end
end )
addCommandHandler ( "ttp" , function( plr , cmd , veh )
if getAdmin ( plr , 3 ) then
if not veh then
outputChatBox ( "* Nie poda?e? ID pojazdu." , plr , 255 , 0 , 0 )
return
end
if tonumber ( veh ) then
local v = findveh ( veh )
if not v then
outputChatBox ( "Nie znaleziono pojazdu o takim ID." , plr , 255 , 0 , 0 )
return
end
outputChatBox ( "Pomy?lnie przeniesiono pojazd o ID: " .. veh .. "" , plr , 255 , 0 , 0 , true )
local x , y , z = getElementPosition ( plr )
setElementPosition ( v , x , y , z )
setElementPosition ( plr , x , y , z + 2 )
end
end
end )
addCommandHandler ( "vehowner" , function( plr , cmd , veh )
if getAdmin ( plr , 3 ) then
if not veh then
outputChatBox ( "* Nie poda?e? ID pojazdu." , plr , 255 , 0 , 0 )
return
end
if tonumber ( veh ) then
local result = exports [ "ogrpg-db" ]: dbGet ( "SELECT * FROM ogrpg_vehicles WHERE id=?" , veh )
if result then
local result2 = exports [ "ogrpg-db" ]: dbGet ( "SELECT * FROM ogrpg_users WHERE id=?" , result [ 1 ]. ownedPlayer )
outputChatBox ( "Pojazd o ID: " .. veh .. " nale?y do gracza: " .. result2 [ 1 ]. login .. "(UID:" .. result [ 1 ]. ownedPlayer .. ")" , plr , 255 , 0 , 0 , true )
end
end
end
end )
function findveh ( id )
for i , v in pairs ( getElementsByType ( "vehicle" )) do
if getElementData ( v , "vehicle:id" ) == id then
return v
end
end
end
Naprawd? ci dzi?kuj? za ten kod! w imi? mojej wdzi?czno?ci obiecuj? ?e nie b?d? usuwa? ciebie z skryptu jako autora, Dodatkowo masz piwko!
[ Dodano : 2019-04-15, 14:31 ]
AmaMa. ,
AmaMa. ,
Tw?j skrypt nie dzia?a, wywala takie b??dy:
startResource: Resource 'TW-vehiclecommands' started
[19-04-15 14:26] ERROR: Loading script failed: TW-vehiclecommands/s.lua:1: unexpected symbol near '?'
[19-04-15 14:26] SCRIPT ERROR: TW-vehiclecommands/s.lua:1: unexpected symbol near '?'
[19-04-15 14:26] WARNING: Script 'TW-vehiclecommands/s.lua' is not encoded in UTF-8. Loading as ANSI...
[19-04-15 14:26] Use the 'upgrade' command to perform a basic upgrade of resources.
[19-04-15 14:26] Some files in 'TW-vehiclecommands' use deprecated functions.
[19-04-15 14:26] WARNING: TW-vehiclecommands/s.lua [Server] is encoded in ANSI instead of UTF-8. Please convert your file to UTF-8.
Wysłany: 2019-04-15, 18:52
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
Ustaw formatowanie tego pliku na UTF-8.
Wysłany: 2019-04-16, 12:26
DenyPL
Wiek: 25 Na forum: 3251 dni Posty: 64
Nick w MP: D4nyPL
"Wilq" napisał/a :Ustaw formatowanie tego pliku na UTF-8.
Nadal nic
Wysłany: 2019-04-17, 20:45
adaskOO
Ten który patrzy
Wiek: 24 Na forum: 3732 dni Posty: 249
Nick w MP: adaskOO
Piwa : 3168
Czasami gdy b??d o UTF-8 wyskakiwa? tworzy?em nowy plik o formacie .lua i skopiowa?em tre?? ze starego i zadzia?a?o.
Tagi: skrypt :: tepanie :: aut :: nie :: działa
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: