Wysłany: 2017-09-25, 23:06
sasik12
Wiek: 26 Na forum: 3763 dni Posty: 182
Piwa : 7
Witajcie . Czemu ten kod nie daje kasy ?
To kod na kase dla premium
setTimer (function()
local players = getElementsByType ( 'player' )
for _ , p in pairs ( players ) do
if getElementData ( p , "player:online" ) and tonumber ( getElementData ( p , "player:online" )) > 10 then
if getElementData ( p , "player:online" ) == 10 then
local hour = getElementData ( localPlayer , "player:hours" ) or 0
setElementData ( localPlayer , "player:hours" , hour + 1 )
end
setElementData ( p , "player:online" , 0 )
if getElementData ( p , "player:premium" ) then
triggerEvent ( "givePlayerMoney" , p , 20000 , false )
triggerClientEvent ( p , "addNotification" , root , "* Premium* Dostajesz 20000 PLN za przegranie 10min" , "info" )
end
end
end
end , 10000 , 0 )
Podpis
Uczeń LUA . Mapper MTA.
Wysłany: 2017-09-26, 01:53
.RiV
Wiek: 25 Na forum: 3588 dni Posty: 554
Nick w MP: Split
Piwa : 2596
Jak wygl?da ten trigger ?
triggerEvent ( "givePlayerMoney" , p , 20000 , false )
Podpis
Autor OGRPG, na scenie MTA od 2012 roku.
Użytkownik: 08.08.2016
GTAO Member: 06.02.2017
Support-Team: 17.06.2017 & 01.06.2019 - 18.11.2019
Moderator: 14.01.2018 - 09.08.2018
Wysłany: 2017-09-26, 11:50
DylemaT929
Nikt
Wiek: 28 Na forum: 4041 dni Posty: 333
Nick w MP: dylemat929
Piwa : 3195
trigger mo?e i jest, ale o to mu chodzi, ?e nie daje kasy. Ten event masz te? w ogrpg-prace-settings musisz to tez mie? w??czone.
A ten event tak wyglada
addEvent ( "givePlayerMoney" , true )
addEventHandler ( "givePlayerMoney" , root , function( value , value2 )
-- nie zalogowana osoba a fuj
if not tonumber ( value ) then return end
if not getElementData ( source , "player:logged" ) then return end
givePlayerMoney ( source , value )
-- Kod od reputacji
if not value2 then
local rnd ={ math . random ( 1 , 10 ), math . random ( 1 , 3 )}
local rep = getElementData ( source , "player:reputation" ) or 0
local xd = rep + rnd [ 2 ]
setElementData ( source , "player:reputation" , xd )
if rnd [ 1 ] == 1 or rnd [ 1 ] == 4 or rnd [ 1 ] == 9 then
triggerClientEvent ( source , "reputation:show" , resourceRoot , rnd )
end
end
end )
Tagi: nie :: daje :: pln
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: