Wysłany: 2014-05-24, 19:04
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Nie trzeba tak miesza?. Je?li nie u?ywasz ?adnych obiekt?w przyczepionych do gracza ani pojazdu, wystarczy prosty kod.
[ Dodano : 2014-05-24, 19:05 ]
a po 2
setTimer(triggerServerEvent,2000,1,"setElementInt", root, getLocalPlayer(), int )
Co to jest ? po co 2 elementy ?
Wysłany: 2014-05-24, 21:49
maxerxxl
Wiek: 30 Na forum: 5067 dni Posty: 285
Nick w MP: MaXI
Piwa : 38
@UP@UP dzi?ki ale nie chce si? b??dzi? w kodzie
@UP@UP@UP dzi?ki masz piwko..
Jeszcze mam jedno pytanie, zrobi?em ?e si? p?aci za mandaty
Kod: elseif source == urzadman then
konto = getPlayerAccount ( hitPlayer )
ilosc = getAccountData ( konto, "mandaty" )
outputChatBox ( "(( Aktualnie posiadasz: "..tonumber(ilosc).." mandat?w. ))", hitPlayer )
outputChatBox ( "(( Cena za wszystkie mandaty: "..tonumber(ilosc)+tonumber(20).." EUR. ))", hitPlayer )
outputChatBox ( "(( Aby zap?aci? zaleg?e mandaty wpisz /zaplac-mandaty. ))", hitPlayer )
end
end
addEventHandler("onMarkerHit", getRootElement(), MarkerHit)
ale jak mog? zrobi? ?e jak mam 0 mandat?w to pokazuje si? 0 EUR tzw. tonumber(ilosc), a jak mam np ju? 1,2,3,4,.... mandat?w to ?eby si? dodawa?o +tonumber(20) bo nawet jak teraz mam 0 mandat?w to si? pokazuje 20 e... a powinno 0
EDIT@@@@@
Jeszcze jedno, chcia?em zrobi? ?e jak wpisuje komend? /zaplac-mandaty to sprawdza czy posiadam jakie? mandaty a jak nie posiadam wyskakuje wiadomo?? ...
Teraz mam 6 mandat?w i chce wpisa? komend? i nie mog? bo wpisze ?e nie posiadam ?adnych mandat?w, nie wiem czy co? ?le zrobi?em w sprawdzaniu.
Kod: addCommandHandler ( "zaplac-mandaty", function(hitPlayer)
konto = getPlayerAccount ( hitPlayer )
ilosc = getAccountData ( konto, "mandaty" )
local kasa = getPlayerMoney ( hitPlayer )
if kasa < tonumber(ilosc)*100 then
outputChatBox("Nie posiadasz wystarczaj?cej ilo?ci pieni?dzy!", hitPlayer, 255, 0, 0)
return end
if getAccountData ( konto, "mandaty" ) ~= "0" then
outputChatBox ("* Nie posiadasz ?adnych mandat?w!",hitPlayer)
return end
takePlayerMoney ( hitPlayer, tonumber(ilosc)+tonumber(20) )
setAccountData ( konto, "mandaty", tonumber(0) )
end)
z g?ry dzi?kuje
Ostatnio zmieniony przez maxerxxl 2014-05-24, 21:56, w całości zmieniany 1 raz
Wysłany: 2014-05-24, 21:51
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Sko?cz? rund? i ci pomog?
[ Dodano : 2014-05-24, 22:25 ]
Kod: elseif source == urzadman then
konto = getPlayerAccount ( hitPlayer )
ilosc = getAccountData ( konto, "mandaty" )
if tonumber(ilosc) == 0 then
outputChatBox ( "(( Aktualnie posiadasz: "..tonumber(ilosc).." mandat?w. ))", hitPlayer )
outputChatBox ( "(( Cena za wszystkie mandaty: 0 EUR. ))", hitPlayer )
outputChatBox ( "(( Aby zap?aci? zaleg?e mandaty wpisz /zaplac-mandaty. ))", hitPlayer )
else
outputChatBox ( "(( Aktualnie posiadasz: "..tonumber(ilosc).." mandat?w. ))", hitPlayer )
outputChatBox ( "(( Cena za wszystkie mandaty: "..tonumber(ilosc)+tonumber(20).." EUR. ))", hitPlayer )
outputChatBox ( "(( Aby zap?aci? zaleg?e mandaty wpisz /zaplac-mandaty. ))", hitPlayer )
end
end
end
addEventHandler("onMarkerHit", getRootElement(), MarkerHit)
Wysłany: 2014-05-24, 22:29
maxerxxl
Wiek: 30 Na forum: 5067 dni Posty: 285
Nick w MP: MaXI
Piwa : 38
dzia?a thx, zapomnia?e? o tym:
"Jeszcze jedno, chcia?em zrobi? ?e jak wpisuje komend? /zaplac-mandaty to sprawdza czy posiadam jakie? mandaty a jak nie posiadam wyskakuje wiadomo?? ...
Teraz mam 6 mandat?w i chce wpisa? komend? i nie mog? bo wpisze ?e nie posiadam ?adnych mandat?w, nie wiem czy co? ?le zrobi?em w sprawdzaniu.
Kod: addCommandHandler ( "zaplac-mandaty", function(hitPlayer)
konto = getPlayerAccount ( hitPlayer )
ilosc = getAccountData ( konto, "mandaty" )
local kasa = getPlayerMoney ( hitPlayer )
if kasa < tonumber(ilosc)*100 then
outputChatBox("Nie posiadasz wystarczaj?cej ilo?ci pieni?dzy!", hitPlayer, 255, 0, 0)
return end
if getAccountData ( konto, "mandaty" ) ~= "0" then
outputChatBox ("* Nie posiadasz ?adnych mandat?w!",hitPlayer)
return end
takePlayerMoney ( hitPlayer, tonumber(ilosc)+tonumber(20) )
setAccountData ( konto, "mandaty", tonumber(0) )
end)
z g?ry dzi?kuje"
Wysłany: 2014-05-24, 22:30
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
addCommandHandler ( "zaplac-mandaty", function(hitPlayer)
konto = getPlayerAccount ( hitPlayer )
ilosc = getAccountData ( konto, "mandaty" )
local kasa = getPlayerMoney ( hitPlayer )
if kasa < tonumber(ilosc)*100 then
outputChatBox("Nie posiadasz wystarczaj?cej ilo?ci pieni?dzy!", hitPlayer, 255, 0, 0)
return end
if getAccountData ( konto, "mandaty" ) == 0 then
outputChatBox ("* Nie posiadasz ?adnych mandat?w!",hitPlayer)
return end
takePlayerMoney ( hitPlayer, tonumber(ilosc)+tonumber(20) )
setAccountData ( konto, "mandaty", tonumber(0) )
end)
znak "~=" znaczy "jest inne ni?"
Wysłany: 2014-05-24, 22:35
maxerxxl
Wiek: 30 Na forum: 5067 dni Posty: 285
Nick w MP: MaXI
Piwa : 38
dzi?ki, ostatnia pro?ba doda?by? do tej komendy ?e musz? by? w markerze aby j? u?y?? mia?em ten kod ale zapomnia?em jego budow?.
Wysłany: 2014-05-24, 22:38
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Kod: addCommandHandler ( "zaplac-mandaty", function(hitPlayer)
if not isElementWithinMarker ( hitPlayer, markerman ) then
outputChatBox ( "Nie jeste? w markerze", hitPlayer, 255, 255, 255 ) return end
konto = getPlayerAccount ( hitPlayer )
ilosc = getAccountData ( konto, "mandaty" )
local kasa = getPlayerMoney ( hitPlayer )
if kasa < tonumber(ilosc)*100 then
outputChatBox("Nie posiadasz wystarczaj?cej ilo?ci pieni?dzy!", hitPlayer, 255, 0, 0)
return end
if getAccountData ( konto, "mandaty" ) == 0 then
outputChatBox ("* Nie posiadasz ?adnych mandat?w!",hitPlayer)
return end
takePlayerMoney ( hitPlayer, tonumber(ilosc)+tonumber(20) )
setAccountData ( konto, "mandaty", tonumber(0) )
end)
Wysłany: 2014-05-24, 22:58
maxerxxl
Wiek: 30 Na forum: 5067 dni Posty: 285
Nick w MP: MaXI
Piwa : 38
no dzi?kuje jako jedyny pomagasz xd, piwko:)
aaa zapomnia?em jeszcze jeden mam problem ot?? brama jak podchodz? do niej si? nie otwiera, a powinna, jestem dodany w acl do grupy Console wi?c nie wiem w czym problem, w db3 nic nie ma.
Kod: brama1 = createObject ( 10150, -148.5, 1216.5, 21.10000038147, 0, 0, 90 )
kolo1 = createColCircle ( -148.32, 1215.50, 20.97 )
function otwieranie(source)
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) then
moveObject (brama1, 10150, -148.5, 1216.5, 21.10000038147 )
end
end
addEventHandler( "onColShapeHit", kolo1, otwieranie )
function zamykanie(source)
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) then
moveObject (brama1, 10150, -148.5, 1216.5, 18.10000038147 )
end
end
addEventHandler( "onColShapeLeave", kolo1, zamykanie )
Wysłany: 2014-05-24, 23:00
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Dam Ci m?j kod bo nie mam za wiele czasu.
Jest to kod na otwieranie wej?cia dwudrziowego :
Kod: prawe = createObject ( 2946, 2303.8999, -17.8, 25.5, 0 , 0, 0 )
lewe = createObject ( 2946, 2303.8999, -14.6, 25.5, 0 , 0, 180.5 )
zew = createMarker ( 2302.802734375, -16.2080078125, 25.484375, "cylinder", 2, 255, 255, 255, 0, 0 )
wew = createMarker ( 2305.1240234375, -16.30078125, 25.749565124512, "cylinder", 2, 255, 255, 255, 0, 0 )
stan = 0
addEventHandler ( "onMarkerHit", wew, function()
if stan == 1 then return end
stan = 1
moveObject ( prawe, 1500, 2303.8999, -17.8, 25.5, 0, 0, 90 )
moveObject ( lewe, 1500, 2303.8999, -14.6, 25.5, 0, 0, -90 )
setTimer ( function()
moveObject ( prawe, 1500, 2303.8999, -17.8, 25.5, 0, 0, -90 )
moveObject ( lewe, 1500, 2303.8999, -14.6, 25.5, 0, 0, 90 )
end, 3000, 1 )
setTimer ( function()
stan = 0
end, 4500, 1 )
end)
addEventHandler ( "onMarkerHit", zew, function()
if stan == 1 then return end
stan = 1
moveObject ( prawe, 1500, 2303.8999, -17.8, 25.5, 0, 0, -90 )
moveObject ( lewe, 1500, 2303.8999, -14.6, 25.5, 0, 0, 90 )
setTimer ( function()
moveObject ( prawe, 1500, 2303.8999, -17.8, 25.5, 0, 0, 90 )
moveObject ( lewe, 1500, 2303.8999, -14.6, 25.5, 0, 0, -90 )
end, 3000, 1 )
setTimer ( function()
stan = 0
end, 4500, 1 )
end)
[ Dodano : 2014-05-24, 23:01 ]
moveObject je?li chodzi o rotacje nie zmienia na podan?, tylko dzia?a matematycznie, dodaje/odejmuje drug? warto??.
Wysłany: 2014-05-25, 10:08
maxerxxl
Wiek: 30 Na forum: 5067 dni Posty: 285
Nick w MP: MaXI
Piwa : 38
Dzi?ki dzia?a, temat do zamkni?cia.
Tagi: problem :: interiorem
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: