Wysłany: 2016-11-30, 20:27
maslibo
Wiek: 22 Na forum: 3793 dni Posty: 22
Nick w MP: maslibo
Piwa : 2
Wysłany: 2016-12-04, 12:18
Qwertick
Coming soon...
Wiek: 23 Na forum: 3577 dni Posty: 472
Nick w MP: Qwertick
Piwa : 2726
Witam mam pytanie przerobi? by mi kto? torbe r1 aby po wpisaniu /torba w poje?dzie SAMA i PSP bierze t? torbe i chowa i po wpisaniu komenday /torba-toggle j? k?adzie i podnosi dam i respekt oto link: http://www61.zippyshare.com/v/FT33tEJo/file.html
Podpis
Kontakt
Discord: Qwertick#1210
Wysłany: 2016-12-04, 13:05
Judaszek*
Wiek: 26 Na forum: 3524 dni Posty: 1
Nick w MP: Judasz*
Piwa : 2
za Respekt raczej nikt ci nie zrobi jezeli chcesz ja ci moge za psc pierw daje Skrypt potem psc lub inaczej Zapraszam. skype:dawid.osowski8
Wysłany: 2016-12-04, 14:03
Qwertick
Coming soon...
Wiek: 23 Na forum: 3577 dni Posty: 472
Nick w MP: Qwertick
Piwa : 2726
"Judaszek*" napisał/a :za Respekt raczej nikt ci nie zrobi jezeli chcesz ja ci moge za psc pierw daje Skrypt potem psc lub inaczej Zapraszam. skype:dawid.osowski8
Bo?e jakie dzieci chc? za PSC
Podpis
Kontakt
Discord: Qwertick#1210
Wysłany: 2016-12-08, 17:07
CertER
Wiek: 30 Na forum: 3469 dni Posty: 15
Nick w MP: CertER
Witam
Dopiero ucz? si? pisania skrypt?w w lua i chcia?bym pokaza? m?j kod na Panel Policji kt?ry zosta? wygenerowany za pomoc? GuiCreatora . Sam skrypt na Gui i elementy jest raczej dobrze zrobiony lecz problem w tym ?e postanowi?em by panel by? dost?pny tylko dla graczy z grup? acl "Policja" i ?eby gui by?o pod klawiszem "i".
Jak wspomnia?em dopiero si? ucz? pisa? w lua wi?c prosz? o wyrozumia?o?? i w zwi?zku z skryptem to nie do ko?ca wiem gdzie umie?ci? linijki kodu odpowiadaj?ce za sprawdzenie czy gracz jest w wspomnianym acl i linijk? odpowiadaj?c? za bind klawisza "i" by wy?wietla?o si? ca?e gui. Mam nadziej? ?e wszystko jest zrozumia?e i prosi?bym o pomoc.
Kod:
Kod:
GUIEditor = {
scrollpane = {},
label = {},
button = {},
window = {},
gridlist = {},
memo = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function guiToggleVisible ( )
if ( guiGetVisible ( Panel Policji ) == true ) then -- check if the gui element is visible
guiSetVisible ( Panel Policji, false ) -- if it is, we hide it
else
guiSetVisible ( Panel Policji, true ) -- if not, we make it visible
end
end
if isObjectInACLGroup (user." .. playerName, aclgetGroup ( "Policja") ) then === Nie doko?ca wiem gdzie powinienem umie?ci? t? linijke i te dwie poni?sze.
myWindow = guiCreateWindow ( 0, 0, .5, .5, "Panel Policji", true ) -- Create the gui window
bindKey ( "i", "down", guiToggleVisible )
end
function()
if isObjectInACLGroup (user." .. playerName, aclgetGroup ( "Policja") ) then
GUIEditor.window[1] = guiCreateWindow(336, 210, 793, 481, "Panel Policji", false)
guiWindowSetMovable(GUIEditor.window[1], false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetAlpha(GUIEditor.window[1], 0.83)
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF177DA8")
GUIEditor.label[1] = guiCreateLabel(25, 440, 126, 24, "Panel Policji by CertER", false, GUIEditor.window[1])
guiSetFont(GUIEditor.label[1], "default-bold-small")
guiLabelSetColor(GUIEditor.label[1], 17, 127, 173)
guiLabelSetVerticalAlign(GUIEditor.label[1], "bottom")
GUIEditor.button[1] = guiCreateButton(649, 352, 100, 41, "Mandat", false, GUIEditor.window[1])
GUIEditor.label[2] = guiCreateLabel(25, 42, 122, 24, "Wybierz gracza z listy:", false, GUIEditor.window[1])
GUIEditor.gridlist[1] = guiCreateGridList(25, 83, 276, 331, false, GUIEditor.window[1])
guiGridListAddColumn(GUIEditor.gridlist[1], "Gracze:", 0.9)
for i = 1, 20 do
guiGridListAddRow(GUIEditor.gridlist[1])
end
guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "-", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "-", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 2, 1, "-", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 3, 1, "-", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 4, 1, "-", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 5, 1, "-", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 6, 1, "-", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 7, 1, "-", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 8, 1, "-", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 9, 1, "-", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 10, 1, "-", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 11, 1, "-", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 12, 1, "-", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 13, 1, "-", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 14, 1, "-", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 15, 1, "-", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 16, 1, "-", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 17, 1, "-", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 18, 1, "-", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 19, 1, "-", false, false)
GUIEditor.button[2] = guiCreateButton(344, 341, 101, 42, "", false, GUIEditor.window[1])
GUIEditor.button[3] = guiCreateButton(334, 352, 100, 41, "Pouczenie", false, GUIEditor.window[1])
GUIEditor.button[4] = guiCreateButton(493, 352, 100, 41, "Sprawd?", false, GUIEditor.window[1])
GUIEditor.memo[1] = guiCreateMemo(413, 154, 151, 118, "", false, GUIEditor.window[1])
GUIEditor.scrollpane[1] = guiCreateScrollPane(356, 137, 139, 160, false, GUIEditor.window[1])
GUIEditor.label[3] = guiCreateLabel(487, 83, 128, 24, "Poziom poszukiwania:", false, GUIEditor.window[1])
bindKey ( "i", "down", guiToggleVisible )
end
bindKey ( "i", "down", guiToggleVisible )
)
Z g?ry dzi?ki
-CertER
Wysłany: 2016-12-08, 22:59
Kamilosek50
Wiek: 24 Na forum: 3551 dni Posty: 15
Nick w MP: Kamilos
Witam mam pro?b? o przerobienie tego kodu, trzeba tutaj tylko uzupe?ni? jedn? funkcj?, kt?ra jest na samym dole.
Chodzi mi o uzupe?nienie tej funkcji:
___________________________________________________________
--[[
function uzupelnijxD()
hmm = mysql_query(aaa,"SELECT * FROM auta")
if (hmm) then
while true do
local row = mysql_fetch_row(hmm)
if (not row) then break end
login = row[17]
login2 = row[18]
id = getPlayerAccountID(login)
id2 = getPlayerAccountID(login2)
mysql_query ( aaa, "UPDATE `auta` SET NaKogo1ID='"..tostring(id).."' WHERE `NaKogo1` = '".. login .."'")
mysql_query ( aaa, "UPDATE `auta` SET NaKogo2ID='"..tostring(id2).."' WHERE `NaKogo2` = '".. login2 .."'")
end
end
end
addCommandHandler("uzup",uzupelnijxD)
]]--
________________________________________________
Kod:
output = false
function getPlayerAccountID(login)
account = getAccount(tostring(login))
if account then
data = getAccountData(account,"ID-Player")
if data then
return data
else
return false
end
else
return false
end
end
function zapiszlog(string)
local file = fileOpen("logs.txt")
if not file then
file = fileCreate("logs.txt")
end
if (file) then
local time = getRealTime()
fileSetPos(file,fileGetSize(file))
local written = fileWrite(file,"\r\n",string.format("-- %02s/%02s/%04s %02s:%02s\r : ",
tostring(time.monthday),
tostring(time.month + 1),
tostring(time.year + 1900),
tostring(time.hour),
tostring(time.minute)),
string,"\r\n")
fileFlush(file)
fileClose(file)
end
end
local panelvip = exports.panelvip
aaa =mysql_connect(get("mysql.host"), get("mysql.user"), get("mysql.pass"), get("mysql.db"), 3306)
if ( not aaa ) then
outputDebugString("Blad polaczenia!-Vehsaver")
end
function makeCaptcha(capNumz)
theC = ""
tCode = { "a","A", "b","B", "c","C", "d","D", "e","E", "f","F", "g","G", "h","H", "j","J", "k","K", "l","L", "m","L", "n","N", "o","O", "p","P", "q","Q", "r","R", "s","S", "t","T", "u","U", "v","V", "x","X", "y","Y", "z","Z", "1", "2", "3", "4", "5", "6", "7", "8", "9" }
for k=1,capNumz or 5 do
randomCode = math.random (#tCode )
theC = ""..theC..""..tCode[randomCode]..""
end
return theC
end
function showBox(player,value,str)
exports.msgboxrpg:showBox(player,value,str)
end
for i,v in ipairs(getElementsByType("player")) do
setElementData(v,"UzylParkowanie",false)
end
function saveallvehicles(thePlayer)
insert = false
insertvip = false
local vehicle = getPedOccupiedVehicle ( thePlayer )
if vehicle then
data = getElementData(vehicle,"PojazdMapa")
if (data==true) then
showBox(thePlayer,"error","Nie mo?na zaprawkowa? tego pojazdu, jest to pojazd frakcyjny.")
else
if getElementData(thePlayer,"UzylParkowanie") == false then
local zarejstrowany = tostring(getElementData(vehicle,"Zarejstrowany"))
if zarejstrowany then
local x = getElementData(vehicle,"Zarejstrowany-Na")
local x2 = getElementData(vehicle,"Zarejstrowany-Na2")
id = getElementData(vehicle,"Zarejstrowany-NaID")
id2 = getElementData(vehicle,"Zarejstrowany-Na2ID")
if tostring(id) == tostring(getPlayerAccountID(getAccountName(getPlayerAccount(thePlayer)))) or tostring(id2) == tostring(getPlayerAccountID(getAccountName(getPlayerAccount(thePlayer)))) then
local px, py, pz = getElementPosition(vehicle)
local rx, ry, rz = getElementRotation(vehicle)
local c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12 = getVehicleColor(vehicle,true)
local color = table.concat({c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12},",")
local model = getElementModel(vehicle)
local health = getElementHealth (vehicle)
local tableUpgrades = getVehicleUpgrades(vehicle)
local upgrades = table.concat(tableUpgrades, ",")
local paintjob = getVehiclePaintjob(vehicle)
local paliwo = tostring(getElementData(vehicle,"fuel"))
local x = getElementData(vehicle,"Zarejstrowany-Na")
local x2 = getElementData(vehicle,"Zarejstrowany-Na2")
local h = getVehicleHandling ( vehicle )
local handlingx = table.concat({h.brakeDeceleration,h.steeringLock,h.mass,h.suspensionDamping,h.suspensionHighSpeedDamping},",")
local gps = getElementData(vehicle,"Have-GPS")
if gps then gps="true" else gps="false" end
local antyr = getElementData(vehicle,"Have-AntyRadar")
if antyr then antyr="true" else antyr="false" end
local przebiegx = getElementData(vehicle,"przebieg")
setElementData(vehicle,"zatrzymane-pd",false)
if x then
na1 = getElementData(vehicle,"Zarejstrowany-Na")
else
na1 = ""
end
if x2 then
na2 = getElementData(vehicle,"Zarejstrowany-Na2")
else
na2 = ""
end
local bx = getElementData(vehicle,"Tabl_Rejstracyjna")
if not bx then
local tabrej = tostring(makeCaptcha(12))
setElementData(vehicle,"Tabl_Rejstracyjna",tabrej)
end
local tablicarejstracyjna = getElementData(vehicle,"Tabl_Rejstracyjna")
q1 = mysql_query(aaa,"SELECT * FROM auta WHERE `NaKogo1ID` = '".. getPlayerAccountID(getAccountName(getPlayerAccount(thePlayer))) .."'")
q2 = mysql_query(aaa,"SELECT * FROM auta WHERE `NaKogo2ID` = '".. getPlayerAccountID(getAccountName(getPlayerAccount(thePlayer))) .."'")
local account = getPlayerAccount(thePlayer)
local login = getAccountName(account)
local accid = getPlayerAccountID(login)
if not panelvip:isPlayerVIP(thePlayer) then
if(mysql_num_rows(q1)+mysql_num_rows(q2) < 3) then
q = mysql_query(aaa,"SELECT * FROM auta WHERE `rejstracja` = '".. tablicarejstracyjna .."'")
if(mysql_num_rows(q) == 0) then
mysql_query( aaa, "INSERT INTO auta SET VehicleID='" .. model .. "', px='" .. px .. "',py='" .. py .. "',pz='" .. pz .. "',rx='" .. rx .. "',ry='" .. ry .. "',rz='" .. rz .. "',Color='" .. color .. "',Health='" .. health .. "',upgrades='" .. upgrades .. "',paintjob='" .. paintjob .. "',PALIWO='" .. paliwo .. "',Zarejstrowany='" .. zarejstrowany .. "',NaKogo1='" .. na1 .. "',NaKogo2='" .. na2 .. "',rejstracja='"..tablicarejstracyjna.."',NaKogo1ID='"..tostring(id).."',NaKogo2ID='"..tostring(id2).."',gps='"..gps.."',antyradar='"..antyr.."',handling='"..handlingx.."',przebieg='"..przebiegx.."',blokadapd=''")
if output then outputDebugString("INSERT auta bazy wykonane!") end
showBox(thePlayer,"info","Zaparkowano pomy?lnie!")
setVehicleRespawnPosition ( vehicle, px, py, pz,rx,ry,rz )
insert = true
end
end
if insert == false then
zxc = mysql_query(aaa,"SELECT * FROM auta WHERE `rejstracja` = '".. tablicarejstracyjna .."'")
if(mysql_num_rows(zxc) ~= 0) then
fr = mysql_query ( aaa, "UPDATE `auta` SET VehicleID='" .. model .. "', px='" .. px .. "',py='" .. py .. "',pz='" .. pz .. "',rx='" .. rx .. "',ry='" .. ry .. "',rz='" .. rz .. "',Color='" .. color .. "',Health='" .. health .. "',upgrades='" .. upgrades .. "',paintjob='" .. paintjob .. "',PALIWO='" .. paliwo .. "',Zarejstrowany='" .. zarejstrowany .. "',NaKogo1='" .. na1 .. "',NaKogo2='" .. na2 .. "',NaKogo1ID='"..tostring(id).."',NaKogo2ID='"..tostring(id2).."',rejstracja='"..tablicarejstracyjna.."',gps='"..gps.."',antyradar='"..antyr.."',handling='"..handlingx.."',przebieg='"..przebiegx.."',blokadapd='' WHERE `rejstracja` = '".. tablicarejstracyjna .."'")
if output then outputDebugString("UPDATE auta bazy wykonane!") end
showBox(thePlayer,"info","Zaparkowano pomy?lnie!")
setVehicleRespawnPosition ( vehicle, px, py, pz,rx,ry,rz )
else
showBox(thePlayer,"error","Posiadasz maxymaln? liczb? pojazd?w!")
end
end
else
if(mysql_num_rows(q1)+mysql_num_rows(q2) <7) then
q = mysql_query(aaa,"SELECT * FROM auta WHERE `rejstracja` = '".. tablicarejstracyjna .."'")
if(mysql_num_rows(q) == 0) then
mysql_query( aaa, "INSERT INTO auta SET VehicleID='" .. model .. "', px='" .. px .. "',py='" .. py .. "',pz='" .. pz .. "',rx='" .. rx .. "',ry='" .. ry .. "',rz='" .. rz .. "',Color='" .. color .. "',Health='" .. health .. "',upgrades='" .. upgrades .. "',paintjob='" .. paintjob .. "',PALIWO='" .. paliwo .. "',Zarejstrowany='" .. zarejstrowany .. "',NaKogo1='" .. na1 .. "',NaKogo2='" .. na2 .. "',rejstracja='"..tablicarejstracyjna.."',NaKogo1ID='"..tostring(id).."',NaKogo2ID='"..tostring(id2).."',gps='"..gps.."',antyradar='"..antyr.."',handling='"..handlingx.."',przebieg='"..przebiegx.."',blokadapd=''")
if output then outputDebugString("INSERT auta bazy wykonane!") end
showBox(thePlayer,"info","Zaparkowano pomy?lnie!")
setVehicleRespawnPosition ( vehicle, px, py, pz,rx,ry,rz )
insertvip = true
end
end
if insertvip == false then
zxc = mysql_query(aaa,"SELECT * FROM auta WHERE `rejstracja` = '".. tablicarejstracyjna .."'")
if(mysql_num_rows(zxc) ~= 0) then
fr = mysql_query ( aaa, "UPDATE auta SET VehicleID='" .. model .. "', px='" .. px .. "',py='" .. py .. "',pz='" .. pz .. "',rx='" .. rx .. "',ry='" .. ry .. "',rz='" .. rz .. "',Color='" .. color .. "',Health='" .. health .. "',upgrades='" .. upgrades .. "',paintjob='" .. paintjob .. "',PALIWO='" .. paliwo .. "',Zarejstrowany='" .. zarejstrowany .. "',NaKogo1='" .. na1 .. "',NaKogo2='" .. na2 .. "',NaKogo1ID='"..tostring(id).."',NaKogo2ID='"..tostring(id2).."',rejstracja='"..tablicarejstracyjna.."',gps='"..gps.."',antyradar='"..antyr.."',handling='"..handlingx.."',przebieg='"..przebiegx.."',blokadapd='' WHERE `rejstracja` = '".. tablicarejstracyjna .."'")
if output then outputDebugString("UPDATE auta bazy wykonane!") end
showBox(thePlayer,"info","Zaparkowano pomy?lnie!")
setVehicleRespawnPosition ( vehicle, px, py, pz,rx,ry,rz )
else
showBox(thePlayer,"error","Posiadasz maxymaln? liczb? pojazd?w!")
end
end
end
else
showBox(thePlayer,"error","Ten pojazd nie nalezy do ciebie, nie mozesz go zaparkowa?!")
end
else
showBox(thePlayer,"error","Ten pojazd nie jest zarejstrowany, nie mozesz go zaparkowa?!")
end
setElementData(thePlayer,"UzylParkowanie",true)
triggerClientEvent (thePlayer,"ustawdataTimer", getRootElement(), thePlayer)
else
triggerClientEvent (thePlayer,"pokazdaneTimer", getRootElement(), thePlayer)
end
end
end
end
addCommandHandler("zaparkuj",saveallvehicles)
function sprawdzauto(thePlayer)
local vehicle = getPedOccupiedVehicle ( thePlayer )
if vehicle then
local zarejstrowany = tostring(getElementData(vehicle,"Zarejstrowany"))
if zarejstrowany then
local x2 = getElementData(vehicle,"Zarejstrowany-Na")
local x1 = getElementData(vehicle,"Zarejstrowany-Na2")
local x = getElementData(vehicle,"Tabl_Rejstracyjna")
showBox(thePlayer,"info","Tablica Rejstracyjna: "..x.."\nPosiadacz 1: "..x1.."\nPosiadacz 2: "..x2.."")
outputConsole ( "Rejstracja ID VEH: "..x, thePlayer )
end
else
showBox(thePlayer,"error","Nie masz samochodu!")
end
end
addCommandHandler("sprawdzauto",sprawdzauto)
function createDatabase()
local result = mysql_query(aaa,"SELECT * FROM auta")
if (result) then
while true do
local row = mysql_fetch_row(result)
if (not row) then
break end
local vehicle = createVehicle( tonumber(row[1]), row[2], row[3], row[4], row[5], row[6], row[7] )
setVehicleRespawnPosition ( vehicle, row[2], row[3], row[4], row[5], row[6], row[7])
color_table = split( row[8], 44 )
setVehicleColor ( vehicle, color_table[1],color_table[2],color_table[3],color_table[4],color_table[5],color_table[6],color_table[7],color_table[8],color_table[9],color_table[10],color_table[11],color_table[12] )
setElementHealth ( vehicle, row[12] )
local upgrades = split( row[13], 44 )
for index, upgrade in pairs (upgrades) do
addVehicleUpgrade( vehicle, upgrade )
end
if ( row[14] ) then
setVehiclePaintjob( vehicle, row[14] )
end
setElementData(vehicle,"fuel",row[15])
setElementData(vehicle,"Tabl_Rejstracyjna",row[19])
if row[16] == "brak" then
else
setElementData(vehicle,"Zarejstrowany",row[16])
setElementData(vehicle,"Zarejstrowany-Na2",row[18])
setElementData(vehicle,"Zarejstrowany-Na",row[17])
setElementData(vehicle,"Zarejstrowany-NaID",tostring(row[20]))
setElementData(vehicle,"Zarejstrowany-Na2ID",tostring(row[21]))
end
if row[22] == "true" then
setElementData(vehicle,"Have-GPS",true)
end
if row[23] == "true" then
setElementData(vehicle,"Have-AntyRadar",true)
end
handling = split( row[24], 44 )
setVehicleHandling(vehicle,"brakeDeceleration",tonumber(handling[1]))
setVehicleHandling(vehicle,"steeringLock",tonumber(handling[2]))
setVehicleHandling(vehicle,"mass",tonumber(handling[3]))
setVehicleHandling(vehicle,"suspensionDamping",tonumber(handling[4]))
setVehicleHandling(vehicle,"suspensionHighSpeedDamping",tonumber(handling[5]))
setElementData(vehicle,"przebieg",tonumber(row[25]))
if tostring(row[26])~="" or tostring(row[26])~="false" then
setElementData(vehicle,"zatrzymane-pd",tostring(row[26]))
else
setElementData(vehicle,"zatrzymane-pd",false)
end
end
mysql_free_result(result) -- Free the result
end
end
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), createDatabase)
function pokazblip(gracz)
local login = getAccountName(getPlayerAccount(gracz))
triggerClientEvent (gracz,"BlipCarSchow", getRootElement(), gracz,login)
end
addEvent( "PokazWszystkieBlipy", true )
addEventHandler( "PokazWszystkieBlipy", getRootElement(), pokazblip )
function ublip(gracz)
local login = getAccountName(getPlayerAccount(gracz))
triggerClientEvent (gracz,"BlipCarHide", getRootElement(), gracz,login)
end
addEvent( "UsunWszystkieBlipy", true )
addEventHandler( "UsunWszystkieBlipy", getRootElement(), ublip )
function uzupelnij(gracz)
local login = getAccountName(getPlayerAccount(gracz))
if panelvip:isPlayerVIP(gracz) then
tekst = 7
else
tekst = 3
end
hmm = mysql_query(aaa,"SELECT * FROM auta WHERE `NaKogo1ID` = '".. getPlayerAccountID(login) .."'")
hmm2 = mysql_query(aaa,"SELECT * FROM auta WHERE `NaKogo2ID` = '".. getPlayerAccountID(login) .."'")
if(mysql_num_rows(hmm)+mysql_num_rows(hmm2) == 0) then
else
if (hmm) then
while true do
local row = mysql_fetch_row(hmm)
if (not row) then
break end
local nazwa = getVehicleNameFromModel ( row[1] )
triggerClientEvent (gracz,"ustawAuta", getRootElement(),nazwa,row[19],tekst )
end
end
if (hmm2) then
while true do
local row = mysql_fetch_row(hmm2)
if (not row) then
break end
local nazwa = getVehicleNameFromModel ( row[1] )
triggerClientEvent (gracz,"ustawAuta", getRootElement(),nazwa,row[19],tekst )
end
end
end
end
function pokazoknoauta(gracz)
triggerClientEvent (gracz,"pokazAuta", getRootElement() )
uzupelnij(gracz)
end
addCommandHandler("pokazauta",pokazoknoauta)
function wyrejstruj(rejstracja,gracz)
for i,v in ipairs(getElementsByType("vehicle")) do
if getElementData(v,"Tabl_Rejstracyjna") == rejstracja then
local free = mysql_query( aaa, "DELETE FROM auta WHERE rejstracja='"..rejstracja.."'")
mysql_free_result( free )
setElementData(v,"Zarejstrowany",false)
setElementData(v,"Zarejstrowany-Na2",false)
setElementData(v,"Zarejstrowany-Na",false)
setElementData(v,"Tabl_Rejstracyjna",false)
triggerClientEvent (gracz,"czyscicgrd", getRootElement() )
uzupelnij(gracz)
showBox(gracz,"info","Wyrejstrowa?e? pojazd!")
end
end
end
addEvent( "WyrejstrujAuto", true )
addEventHandler( "WyrejstrujAuto", getRootElement(), wyrejstruj )
function destroyautos ()
local x = getElementData(source,"Tabl_Rejstracyjna")
local x2 = getElementData(source,"TruckerAuto")
if not x2 then
if x then
setTimer(respawnVehicle, 60000, 1, source)
else
setTimer(destroyElement, 60000, 1, source)
end
end
end
addEventHandler ("onVehicleExplode", getRootElement(), destroyautos )
function dstid(thePlayer,cmd,id)
if isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Admin" ) ) or
isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "SuperModerator" ) ) or
isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Moderator" ) ) then
hmm = mysql_query(aaa,"SELECT * FROM auta WHERE `rejstracja` = '".. id .."'")
if(mysql_num_rows(hmm) == 0) then
showBox(thePlayer,"error","Brak pojazdu o rejstracji: "..id)
else
for i,v in ipairs(getElementsByType("vehicle")) do
if getElementData(v, "Tabl_Rejstracyjna") == id then
destroyElement(v)
local free = mysql_query( aaa, "DELETE FROM auta WHERE rejstracja='"..id.."'")
showBox(thePlayer,"info","Usunieto z bazy danych pojazd o id: "..id)
end
end
mysql_free_result( free )
end
else
showBox(thePlayer,"error","BRAK PRAW!")
end
end
addCommandHandler("destroyid",dstid)
function dstpass(thePlayer)
if isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Admin" ) ) or
isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "SuperModerator" ) ) or
isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Moderator" ) ) then
local theVehicle = getPedOccupiedVehicle ( thePlayer )
local x = getElementData(theVehicle,"Tabl_Rejstracyjna")
if x then
local free = mysql_query( aaa, "DELETE FROM auta WHERE rejstracja='"..x.."'")
destroyElement(theVehicle)
showBox(thePlayer,"info","Usunieto z bazy danych pojazd o id: "..x)
mysql_free_result( free )
end
else
showBox(thePlayer,"error","BRAK PRAW!")
end
end
addCommandHandler("destroypass",dstpass)
function saveVehicle(vehicle)
if vehicle then
id = getElementData(vehicle, "Tabl_Rejstracyjna")
if id then
save = mysql_query(aaa,"SELECT * FROM auta WHERE `rejstracja` = '".. id .."'")
if(mysql_num_rows(save) > 0) then
local c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12 = getVehicleColor(vehicle,true)
local color = table.concat({c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12},",")
local health = getElementHealth (vehicle)
local tableUpgrades = getVehicleUpgrades(vehicle)
local upgrades = table.concat(tableUpgrades, ",")
local paintjob = getVehiclePaintjob(vehicle)
local paliwo = tostring(getElementData(vehicle,"fuel"))
local h = getVehicleHandling ( vehicle )
local handlingx = table.concat({h.brakeDeceleration,h.steeringLock,h.mass,h.suspensionDamping,h.suspensionHighSpeedDamping},",")
local gps = tostring(getElementData(vehicle,"Have-GPS"))
local antyr = tostring(getElementData(vehicle,"Have-AntyRadar"))
local przebiegx = getElementData(vehicle,"przebieg")
mysql_query ( aaa, "UPDATE `auta` SET Color='" .. color .. "',Health='" .. health .. "',upgrades='" .. upgrades .. "',paintjob='" .. paintjob .. "',PALIWO='" .. paliwo .. "',gps='"..gps.."',antyradar='"..antyr.."',handling='"..handlingx.."',przebieg='"..przebiegx.."' WHERE `rejstracja` = '".. id .."'")
end
end
end
end
function savePos(saver,vehicle)
if vehicle then
id = getElementData(vehicle, "Tabl_Rejstracyjna")
if id then
save = mysql_query(aaa,"SELECT * FROM auta WHERE `rejstracja` = '".. id .."'")
if(mysql_num_rows(save) > 0) then
local px, py, pz = getElementPosition(vehicle)
local rx, ry, rz = getElementRotation(vehicle)
local time = getRealTime()
local tekst = getElementData(vehicle,"Zarejstrowany-Na").."//"..time.hour..":"..time.minute.." "..time.monthday.."-"..(time.month+1).."-"..(time.year+1900)
mysql_query ( aaa, "UPDATE `auta` SET px='" .. px .. "',py='" .. py .. "',pz='" .. pz .. "',rx='" .. rx .. "',ry='" .. ry .. "',rz='" .. rz .. "',blokadapd='"..tekst.."' WHERE `rejstracja` = '".. id .."'")
setElementData(vehicle,"zatrzymane-pd",tekst)
setVehicleRespawnPosition ( vehicle, px, py, pz,rx,ry,rz )
saveVehicle(vehicle)
outputChatBox("Pozycja zapisana",saver)
end
end
end
end
function SaveOnExit ( thePlayer, seat, jacked )
if seat==0 then
saveVehicle(source)
end
end
addEventHandler ( "onVehicleExit", getRootElement(), SaveOnExit )
--[[
function uzupelnijxD()
hmm = mysql_query(aaa,"SELECT * FROM auta")
if (hmm) then
while true do
local row = mysql_fetch_row(hmm)
if (not row) then break end
login = row[17]
login2 = row[18]
id = getPlayerAccountID(login)
id2 = getPlayerAccountID(login2)
mysql_query ( aaa, "UPDATE `auta` SET NaKogo1ID='"..tostring(id).."' WHERE `NaKogo1` = '".. login .."'")
mysql_query ( aaa, "UPDATE `auta` SET NaKogo2ID='"..tostring(id2).."' WHERE `NaKogo2` = '".. login2 .."'")
end
end
end
addCommandHandler("uzup",uzupelnijxD)
]]--
[ Dodano : 2016-12-10, 12:31 ]
Witam czy kto? m?g?by mi powiedzie? co w tej funkcji jest ?le.
To jest funkcja blokowania strza?u na bro? o ID:22 lecz jak dodaje j? do skryptu to ona blokuje mi strzelanie z ka?dej broni za pomoc daje :piwo:
Funkcja:
function blockShoot()
if getPedWeapon(localPlayer) == 22 then
toggleControl("fire", false)
toggleControl("aim_weapon", true)
toggleControl("action", false)
else
toggleControl("fire", false)
end
end
Wysłany: 2016-12-10, 15:23
gg55
Wiek: 26 Na forum: 3602 dni Posty: 55
Nick w MP: Kuba56
Piwa : 955
Prosz? o przerobienie tego bo organizacja dzia?a a premium nie za to
--[[
Resource: OURGame v2
Developers: Split <[email protected] >
You have no right to use this code without my permission.
(c) 2015 <[email protected] >. All rights reserved.
]]
function loadPlayerData(plr)
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=?", getElementData(plr,"player:uid"))
if result and #result > 0 then
local v=result[1]
setPlayerMoney(plr,v.money)
setElementModel(plr,v.skin)
setElementData(plr,"status","Aktywny")
setElementData(plr,"player:logged",true)
setElementData(plr,"player:mandate",v.mandate)
setElementData(plr,"player:license:pjA",v.pjA)
setElementData(plr,"player:license:pjB",v.pjB)
setElementData(plr,"player:license:pjC",v.pjC)
setElementData(plr,"player:license:pjL",v.pjL)
setElementData(plr,"player:reputation",v.reputation)
setElementData(plr,"player:workinjob",v.worker)
setElementData(plr,"player:registerdate",v.registered)
setElementData(plr,"player:hours",v.hours)
local queryA=string.format("SELECT * FROM ogrpg_users WHERE id=%d AND premiumdate>NOW() LIMIT 1", getElementData(plr,"player:uid"))
local resultA=exports["ogrpg-db"]:pobierzWyniki(queryA)
if (resultA) then
setElementData(plr,"player:premium",true)
setElementData(plr,"player:premiumdate",v.premiumdate)
setPlayerName(plr,"#dbb234"..getPlayerName(plr))
else
setElementData(plr,"player:premium",false)
end
setElementData(plr,"player:organization",false)
setElementData(plr,"player:skin",v.skin)
local org=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_organizations WHERE uid=? LIMIT 1", getElementData(plr,"player:uid")) -- pobieramy tylko JEDEN rekord
if org and #org > 0 then
setElementData(plr,"player:organization",org[1].code)
exports['ogrpg-db']:dbSet("UPDATE ogrpg_organizations SET actived=curdate() WHERE uid=?", getElementData(plr,"player:uid"))
end
return true
end
return false
end
addEvent("load:player",true)
addEventHandler("load:player", root, function(player)
if isElement(player) and player then
if getElementType(player) ~= "player" then return end
loadPlayerData(player)
outputDebugString("Zaladowano statystyki gracza :"..getPlayerName(player))
end
end)
function savePlayerData(plr)
local uid=getElementData(plr,"player:uid")
if not uid then return end
local money=getPlayerMoney(plr)
local mandate=getElementData(plr,"player:mandate")
local licensea=getElementData(plr,"player:license:pjA")
local licenseb=getElementData(plr,"player:license:pjB")
local licensec=getElementData(plr,"player:license:pjC")
local licensel=getElementData(plr,"player:license:pjL")
local reputation=getElementData(plr,"player:reputation")
local worker =getElementData(plr,"player:workinjob")
local hours= tonumber(getElementData(plr,"player:hours")) or 0
local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET money=?, reputation=?, mandate=?, pjA=?, pjB=?, pjC=?, pjL=?, worker=?, hours=? WHERE id=?",
money, reputation, mandate, licensea, licenseb, licensec, licensel,worker,hours, uid)
end
addEvent("save:player",true)
addEventHandler("save:player", root, function(player)
if isElement(player) and player then
if getElementType(player) ~= "player" then return end
savePlayerData(player)
outputDebugString("Zapisano statystyki gracza :"..getPlayerName(player))
end
end)
addEventHandler("onPlayerQuit", root, function() savePlayerData(source) end)
Wysłany: 2016-12-12, 06:35
Qwertick
Coming soon...
Wiek: 23 Na forum: 3577 dni Posty: 472
Nick w MP: Qwertick
Piwa : 2726
"gg55" napisał/a :Prosz? o przerobienie tego bo organizacja dzia?a a premium nie za to
--[[
Resource: OURGame v2
Developers: Split <[email protected] >
You have no right to use this code without my permission.
(c) 2015 <[email protected] >. All rights reserved.
]]
function loadPlayerData(plr)
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=?", getElementData(plr,"player:uid"))
if result and #result > 0 then
local v=result[1]
setPlayerMoney(plr,v.money)
setElementModel(plr,v.skin)
setElementData(plr,"status","Aktywny")
setElementData(plr,"player:logged",true)
setElementData(plr,"player:mandate",v.mandate)
setElementData(plr,"player:license:pjA",v.pjA)
setElementData(plr,"player:license:pjB",v.pjB)
setElementData(plr,"player:license:pjC",v.pjC)
setElementData(plr,"player:license:pjL",v.pjL)
setElementData(plr,"player:reputation",v.reputation)
setElementData(plr,"player:workinjob",v.worker)
setElementData(plr,"player:registerdate",v.registered)
setElementData(plr,"player:hours",v.hours)
local queryA=string.format("SELECT * FROM ogrpg_users WHERE id=%d AND premiumdate>NOW() LIMIT 1", getElementData(plr,"player:uid"))
local resultA=exports["ogrpg-db"]:pobierzWyniki(queryA)
if (resultA) then
setElementData(plr,"player:premium",true)
setElementData(plr,"player:premiumdate",v.premiumdate)
setPlayerName(plr,"#dbb234"..getPlayerName(plr))
else
setElementData(plr,"player:premium",false)
end
setElementData(plr,"player:organization",false)
setElementData(plr,"player:skin",v.skin)
local org=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_organizations WHERE uid=? LIMIT 1", getElementData(plr,"player:uid")) -- pobieramy tylko JEDEN rekord
if org and #org > 0 then
setElementData(plr,"player:organization",org[1].code)
exports['ogrpg-db']:dbSet("UPDATE ogrpg_organizations SET actived=curdate() WHERE uid=?", getElementData(plr,"player:uid"))
end
return true
end
return false
end
addEvent("load:player",true)
addEventHandler("load:player", root, function(player)
if isElement(player) and player then
if getElementType(player) ~= "player" then return end
loadPlayerData(player)
outputDebugString("Zaladowano statystyki gracza :"..getPlayerName(player))
end
end)
function savePlayerData(plr)
local uid=getElementData(plr,"player:uid")
if not uid then return end
local money=getPlayerMoney(plr)
local mandate=getElementData(plr,"player:mandate")
local licensea=getElementData(plr,"player:license:pjA")
local licenseb=getElementData(plr,"player:license:pjB")
local licensec=getElementData(plr,"player:license:pjC")
local licensel=getElementData(plr,"player:license:pjL")
local reputation=getElementData(plr,"player:reputation")
local worker =getElementData(plr,"player:workinjob")
local hours= tonumber(getElementData(plr,"player:hours")) or 0
local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET money=?, reputation=?, mandate=?, pjA=?, pjB=?, pjC=?, pjL=?, worker=?, hours=? WHERE id=?",
money, reputation, mandate, licensea, licenseb, licensec, licensel,worker,hours, uid)
end
addEvent("save:player",true)
addEventHandler("save:player", root, function(player)
if isElement(player) and player then
if getElementType(player) ~= "player" then return end
savePlayerData(player)
outputDebugString("Zapisano statystyki gracza :"..getPlayerName(player))
end
end)
addEventHandler("onPlayerQuit", root, function() savePlayerData(source) end)
Jesli to jest ogrpg-core z itsa to podaj plik.lua
Podpis
Kontakt
Discord: Qwertick#1210
Wysłany: 2016-12-16, 17:19
Konfucjusz
Wiek: 26 Na forum: 3597 dni Posty: 1
Piwa : 10
"mrmay4141" napisał/a :Witam, prosi?bym o przerobienie tego panelu:
http://community.multithe...details&id=2181
ULECZ zmieni? na Napraw, ?eby po wybraniu gracza i wci?ni?ciu Napraw naprawia?o pojazd gracza, ale ?eby Naprawa mog?a by? mo?liwa jedynia na 6 metr?w od wybranego gracza.
Co masz na my?li, ?e dana funkcja b?dzie mo?liwa jedynie na 6 metr?w od wybranego gracza?
Wysłany: 2016-12-17, 20:51
gg55
Wiek: 26 Na forum: 3602 dni Posty: 55
Nick w MP: Kuba56
Piwa : 955
Wysłany: 2016-12-18, 08:19
AssasiPlayGames
Wiek: 22 Na forum: 3757 dni Posty: 176
Nick w MP: NiFeKpL
Piwa : 909
Wysłany: 2016-12-18, 16:10
gg55
Wiek: 26 Na forum: 3602 dni Posty: 55
Nick w MP: Kuba56
Piwa : 955
AssasiPlayGames , Nie dzia?a tylko Zapisuje Premium a Organizacja Nie!
Prosz? was Pom??cie
Witam, prosi?bym o przerobienie tego saveplayers
http://www94.zippyshare.com/v/o0bT5S4g/file.html
Zapisuje si? Organizacja a Premium Nie dzia?a i ani si? nie zapisuje Prosz? o Pomoc Za to: respektu
Wysłany: 2016-12-18, 16:20
Gravgor
Wiek: 22 Na forum: 3619 dni Posty: 380
Nick w MP: 1944
Piwa : 702
Podpis
Portfolio marceliborowczak.me
Wysłany: 2016-12-18, 17:10
DolareK
Mapper/Szkrypter
Wiek: 28 Na forum: 3760 dni Posty: 17
Nick w MP: FliX
Piwa : 190
Wysłany: 2016-12-22, 21:37
demoniskoxd
Wiek: 30 Na forum: 3989 dni Posty: 79
Nick w MP: Francesco
Piwa : 1
Witam mam co? takiego :
--------------------------
------- (c) 2010 ---------
-- by Zipper & MrCrunch --
-- and Vio MTA:RL Crew ---
--------------------------
-- Spawns a Leviathan and makes it a magnet helicopter
function magnet_func ( player )
local x, y, z = getElementPosition ( player )
local veh = createVehicle ( 417, x, y, z )
setVehicleAsMagnetHelicopter ( veh )
end
addCommandHandler ( "magnet", magnet_func )
-- Attaches a magnet to it if its a Leviathan
function setVehicleAsMagnetHelicopter ( veh )
if getElementModel ( veh ) == 417 then
local x, y, z = getElementPosition ( veh )
local magnet = createObject ( 1301, x, y, z-1.5)
attachElements ( magnet, veh, 0, 0, -1.5 )
setElementData ( veh, "magpos", -1.5 )
setElementData ( veh, "magnet", magnet )
setElementData ( veh, "magnetic", true )
setElementData ( veh, "hasmagnetactivated", false )
end
end
-- When the helicopter is destroyed, kill the magnet
function destroyMagnet ( veh )
if veh then
source = veh
end
if getElementData ( source, "magnetic" ) then
local magnet = getElementData ( veh, "magnet" )
destroyElement ( magnet )
end
end
addEventHandler ( "onVehicleExplode", getRootElement(), destroyMagnet )
-- Moves the magnet up/down
function magnetUp ( player )
local veh = getPedOccupiedVehicle ( player )
if veh then
local magpos = getElementData ( veh, "magpos" )
if magpos < -1.5 then
local magnet = getElementData ( veh, "magnet" )
detachElements ( magnet )
local magpos = magpos+0.1
attachElements ( magnet, veh, 0, 0, magpos, 0, 0, 0 )
setElementData ( veh, "magpos", magpos )
end
end
end
function magnetDown ( player )
local veh = getPedOccupiedVehicle ( player )
if veh then
local magpos = getElementData ( veh, "magpos" )
if magpos > -15 then
local magnet = getElementData ( veh, "magnet" )
detachElements ( magnet )
local magpos = magpos-0.1
attachElements ( magnet, veh, 0, 0, magpos, 0, 0, 0 )
setElementData ( veh, "magpos", magpos )
end
end
end
-- (un)Bind the keys
function bindTrigger ()
if not isKeyBound ( source, "lctrl", "down", magnetVehicleCheck ) then
bindKey ( source, "lctrl", "down", magnetVehicleCheck )
bindKey ( source, "rctrl", "down", magnetVehicleCheck )
bindKey ( source, "num_sub", "down", magnetUp )
bindKey ( source, "num_add", "down", magnetDown )
end
end
function unbindTrigger ()
if isKeyBound ( source, "lctrl", "down", magnetVehicleCheck ) then
unbindKey ( source, "lctrl", "down", magnetVehicleCheck )
unbindKey ( source, "rctrl", "down", magnetVehicleCheck )
unbindKey ( source, "num_sub", "down", magnetUp )
unbindKey ( source, "num_add", "down", magnetDown )
end
end
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), bindTrigger )
addEventHandler ( "onPlayerVehicleExit", getRootElement(), unbindTrigger )
addEventHandler ( "onPlayerWasted", getRootElement(), unbindTrigger )
-- When Ctrl is pressed, attach / detatch the helicopter
function magnetVehicleCheck ( player )
local veh = getPedOccupiedVehicle ( player )
if veh then
if getElementData ( veh, "magnetic" ) then
if getElementData ( veh, "hasmagnetactivated" ) then
setElementData ( veh, "hasmagnetactivated", false )
detachElements ( getElementData ( veh, "magneticVeh" ) )
else
local magnet = getElementData ( veh, "magnet" )
local x, y, z = getElementPosition ( magnet )
local magpos = getElementData ( veh, "magpos" )
local marker = createColSphere ( x , y , z, 2 )
local vehs = getElementsWithinColShape ( marker, "vehicle" )
destroyElement ( marker )
grabveh = false
for key, vehitem in ipairs(vehs) do
if vehitem ~= veh then
local grabveh = vehitem
attachElements ( grabveh, magnet, 0, 0, -1, 0, 0, getVehicleRotation(grabveh) )
setElementData ( veh, "hasmagnetactivated", true )
setElementData ( veh, "magneticVeh", grabveh )
break
end
end
end
end
end
end
Chcia?bym aby to by?o podpisane pod ka?dego lewiatana dacie rade jakos ogarnac?
Tagi: prośby :: przerobienie :: skryptu
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: