Wysłany: 2012-11-20, 14:20
Beck
Wiek: 40 Na forum: 4961 dni Posty: 13
Czy kto? by mi napisa? (od zrazu pisze ?e to nie m?j skrypt, ale go rozumiem), jak zrobi?, by ten skrypt zapisywa? graczy na xml.
Skrypt Client:
Kod: function GivePassport( player, commandName, nick )
local targetPlayer = getPlayerFromName(tostring(nick))
local team = getTeamFromName("Policja")
if getPlayerTeam(player) == team then
if targetPlayer == false then
outputChatBox("Gracz nie jest pod??czony do serwera", player)
return
end
setElementData(targetPlayer, "prawo", true)
outputChatBox("Gracz " .. nick .. " otrzyma? prawo jazdy", player)
else
outputChatBox("Nie jestes policjantem!", player)
end
end
function CheckPassport( player, commandName, nick )
local targetPlayer = getPlayerFromName(tostring(nick))
local team = getTeamFromName("Policja")
if getPlayerTeam(player) == team then
if targetPlayer == false then
outputChatBox("Gracz nie jest pod??czony do serwera", player)
return
end
if getElementData(targetPlayer, "prawo") then
outputChatBox("Gracz posiada prawo jazdy", player)
else
outputChatBox("Gracz nie posiada prawa jazdy", player)
end
else
outputChatBox("Nie jestes policjantem!", player)
end
end
addCommandHandler("dajprawo", GivePassport)
addCommandHandler("zobaczprawo", CheckPassport)
Wysłany: 2012-11-20, 14:57
Piorun
Wiek: 32 Na forum: 6712 dni Posty: 1837
Nick w MP: Piorun
Piwa : 516
Wysłany: 2012-11-20, 16:10
Beck
Wiek: 40 Na forum: 4961 dni Posty: 13
Dzi?ki, ale skrypt rozumiem ale nie zbyt xml.
Wysłany: 2012-11-20, 16:34
pidbulxd
Wiek: 28 Na forum: 5230 dni Posty: 135
Nick w MP: Word
Piwa : 540
Ja te? zbytynio XML nie rozumiem. Ale masz tutaj przyk?ad z systemu aut z neta. function ()
local root = xmlLoadFile ( "cars.xml" )
local houseroot = xmlFindChild ( root , "cars" , 0 )
if ( houseroot ) then
for i , v in ipairs ( xmlNodeGetChildren ( houseroot )) do
local carmodel = xmlNodeGetAttribute ( v , "model" )
local x = xmlNodeGetAttribute ( v , "x" )
local y = xmlNodeGetAttribute ( v , "y" )
local z = xmlNodeGetAttribute ( v , "z" )
local color1 = xmlNodeGetAttribute ( v , "color1" )
local color2 = xmlNodeGetAttribute ( v , "color2" )
local owner = xmlNodeGetAttribute ( v , "owner" )
local price = xmlNodeGetAttribute ( v , "price" )
local lock = xmlNodeGetAttribute ( v , "lock" )
local a = xmlNodeGetAttribute ( v , "a" )
cars [ i ] = createVehicle ( tonumber ( carmodel ), tonumber ( x ), tonumber ( y ), tonumber ( z ), 0 , 0 , tonumber ( a ) )
setElementInterior ( cars [ i ], 0 )
setElementData ( cars [ i ], "xpos" , tonumber ( x ))
setElementData ( cars [ i ], "ypos" , tonumber ( y ))
setElementData ( cars [ i ], "zpos" , tonumber ( z ))
setElementData ( cars [ i ], "angle" , tonumber ( a ))
setElementData ( cars [ i ], "owner" , owner )
setElementData ( cars [ i ], "price" , tonumber ( price ))
setElementData ( cars [ i ], "lock" , tonumber ( lock ))
setElementData ( cars [ i ], "num" , i )
setVehicleColor ( cars [ i ], tonumber ( color1 ), tonumber ( color2 ), 0 , 0 )
if( lock == 1 ) then
setVehicleLocked ( car , true )
end
if getElementData ( cars [ i ], "owner" ) == "Nobody" then
buycarpickup [ i ] = createPickup ( x , y , z , 3 , 1274 )
attachElements ( buycarpickup [ i ], cars [ i ], 0 , 0 , 1.9 )
end
maxcars = maxcars + 1
end
outputDebugString ( "System aut w??czony .!" )
end
end
)
Wysłany: 2012-11-20, 17:17
Piorun
Wiek: 32 Na forum: 6712 dni Posty: 1837
Nick w MP: Piorun
Piwa : 516
Nie o to chodzi aby komu? dawa? "przyk?ady z d***". Jak kto? czego? nie rozumie to i z przyk?adem czego? nie zrozumie. Albo nale?y t?umaczy? albo dawac linki do zew. poradnik?w.
Wysłany: 2012-11-21, 09:18
Beck
Wiek: 40 Na forum: 4961 dni Posty: 13
Piorun masz racje, z tego nic nie rozumiem.
Wysłany: 2012-11-21, 16:23
Piorun
Wiek: 32 Na forum: 6712 dni Posty: 1837
Nick w MP: Piorun
Piwa : 516
Do wszystkiego najlepiej doj?? samemu - powoli, po cichu .. gdzie? na uboczu .
Tagi: xml
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: