Wysłany: 2016-08-02, 18:44
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4150 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
Witam, robie skrypt na raporty.
Mam problem poniewa? po wpisaniu /raport nick tresc pokazuje informacje ze zgloszenie wyslano pomyslnie aczkolwiek nie pokazuje gui
local sw , sh = guiGetScreenSize ()
function pokaz ()
raport = false
end
addEvent ( "skarga" , true )
addEventHandler ( "skarga" , root ,function( winny , tresc )
if source == localPlayer then
raport = tresc
x = winny
setTimer ( pokaz , 7000 , 1 )
setTimer ( playSoundFrontEnd , 300 , 10 , 5 )
end
end )
addEventHandler ( "onClientRender" , root , function( tresc , x )
if ( raport ) then
dxDrawRectangle ( sw * 0.6100 , sh * 0.8100 , sw * 0.3900 , sh * 0.1900 , tocolor ( 219 , 0 , 0 , 190 ), false )
dxDrawText ( "Nick: " .. getPlayerName ( localPlayer ).. "" , 499 , 498 , 697 , 522 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , "default" , "left" , "top" , false , false , false , false , false )
dxDrawText ( "Nick oskar?onego: " .. x .. "" , 496 , 521 , 697 , 543 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , "default" , "left" , "top" , false , false , false , false , false )
dxDrawText ( "Tre?c: " .. raport .. "" , 492 , 550 , 794 , 595 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , "default" , "left" , "top" , false , false , false , false , false )
return
end
end )
S:
addCommandHandler ( "raport" ,function( plr , cmd , target , ...)
-- addCommandHandler ( "report" ,function( plr , cmd , target , ...)
if not target then
outputChatBox ( "Wpisz /raport <nick> <powod>" , plr )
return
end
local tresc = table . concat ({...}, " " )
local winny = getPlayerFromName ( target )
if not winny then
outputChatBox ( "Nie ma takiego gracza lub nie jest online" , plr )
return
end
if string . len ( tresc )<= 1 then
outputChatBox ( "Wpisz pow?d" , plr )
return
end
triggerClientEvent ( "skarga" , winny , tresc )
outputChatBox ( "Zg?oszenie wys?ane pomy?lnie" , plr )
-- end
-- end )
end )
DB3 milczy
Nagradzam i
Wysłany: 2016-08-02, 19:13
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
marcin778 , w funkcji: s? inne argumenty.
https://wiki.multitheftauto.com napisał/a : triggerClientEvent ( [ table / element sendTo = getRootElement ()], string name , element sourceElement , [ arguments ...] )
sendTo- komu ma wysy?a? Event
name - nazwa eventu
sourceElement - element zr?d?o
arguments - dalsze argumenty
Wysłany: 2016-08-02, 19:17
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4150 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
triggerClientEvent ( localPlayer , "skarga" , localPlayer , winny , tresc )
outputChatBox ( "Zg?oszenie wys?ane pomy?lnie" , plr )
-- end
-- end )
end )
expected string at argument 1
Wysłany: 2016-08-02, 19:20
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
marcin778 , triggerClientEvent jest po stronie server
Wysłany: 2016-08-02, 19:20
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4150 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
A no ta....
Ostatnio zmieniony przez marcin778 2016-08-02, 19:21, w całości zmieniany 1 raz
Wysłany: 2016-08-02, 19:21
Brzysiek
Skrypter pralek
Wiek: 27 Na forum: 5199 dni Posty: 488
Nick w MP: Brzysiek
Piwa : 1034
Sk?d ty localPlayera po stronie serwera wytrzasn??e?. Element gracza masz w komendzie.
Wysłany: 2016-08-02, 19:24
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4150 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
triggerClientEvent ( plr , "skarga" , root , winny , tresc )
outputChatBox ( "Zg?oszenie wys?ane pomy?lnie" , plr )
-- end
-- end )
end )
Nadal to samo
Wysłany: 2016-08-02, 19:31
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
marcin778 , triggerClientEvent ( getRootElement (), "skarga" , plr , winny , tresc )
outputChatBox ( "Zg?oszenie wys?ane pomy?lnie" , plr )
-- end
-- end )
end )
Wysłany: 2016-08-02, 19:46
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4150 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
GUI pokazuje z samym nickiem i jest db
http://imgur.com/a/w2PGo
dxDrawText ( "Nick oskar?onego: " .. x .. "" , 496 , 521 , 697 , 543 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , "default" , "left" , "top" , false , false , false , false , false )
Wysłany: 2016-08-02, 19:52
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
local sw , sh = guiGetScreenSize ()
function pokaz ()
raport = false
end
addEvent ( "skarga" , true )
addEventHandler ( "skarga" , root ,function( winny , tresc ))
if source == localPlayer then
raport = tresc
x = winny
setTimer ( pokaz , 7000 , 1 )
setTimer ( playSoundFrontEnd , 300 , 10 , 5 )
end
end )
addEventHandler ( "onClientRender" , root , function()
if ( raport ) then
dxDrawRectangle ( sw * 0.6100 , sh * 0.8100 , sw * 0.3900 , sh * 0.1900 , tocolor ( 219 , 0 , 0 , 190 ), false )
dxDrawText ( "Nick: " .. getPlayerName ( localPlayer ).. "" , 499 , 498 , 697 , 522 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , "default" , "left" , "top" , false , false , false , false , false )
dxDrawText ( "Nick oskar?onego: " .. x .. "" , 496 , 521 , 697 , 543 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , "default" , "left" , "top" , false , false , false , false , false )
dxDrawText ( "Tre?c: " .. raport .. "" , 492 , 550 , 794 , 595 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , "default" , "left" , "top" , false , false , false , false , false )
return
end
end )
Wysłany: 2016-08-02, 19:58
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4150 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
Wysłany: 2016-08-02, 19:59
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
marcin778 ,
Wysłany: 2016-08-02, 20:03
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4150 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
Tagi: raport
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: