Wysłany: 2016-08-15, 19:58
=DC=
Wiek: 35 Na forum: 3944 dni Posty: 223
Nick w MP: =DC=
Piwa : 72
function findPlayerFromName ( name )
local name = name and name : gsub ( "#%x%x%x%x%x%x" , "" ): lower () or nil
if name then
for _ , player in ipairs ( getElementsByType ( "player" )) do
local name_ = getPlayerName ( player ): gsub ( "#%x%x%x%x%x%x" , "" ): lower ()
if name_ : find ( name , 1 , true ) then
return player
end
end
end
end
--[[
Resource : OURGame v2
Developers : Split < split . programista @ gmail . com >
You have no right to use this code without my permission .
( c ) 2015 < split . programista @ gmail . com >. All rights reserved .
]]
function onPrivateMessage ( plr , cmd , komu , ...)
if not komu or not {...} then
outputChatBox ( '* U?yj /pm <nick/ID> <tre??> ' , plr )
return
end
local text = table . concat ({...}, ' ' )
local target = findPlayerFromName ( komu )
if not target then
outputChatBox ( '* Nie znaleziono podanego gracza.' , plr , 255 , 0 , 0 )
return
end
local id = getElementData ( target , "id" ) or ""
local id2 = getElementData ( plr , "id" ) or ""
outputChatBox ( "#FFFFFF>> #BABABA" .. getPlayerName ( target ).. "[" .. id .. "]: #ffffff" .. text .. "" , plr , _ , _ , _ , true )
outputChatBox ( "#FFFFFF<< #BABABA" .. getPlayerName ( plr ).. "[" .. id2 .. "]: #ffffff" .. text .. "" , target , _ , _ , _ , true )
local pm_text =( "PM> " .. getPlayerName ( plr ).. "[" .. id2 .. "]" .. " do " .. getPlayerName ( target ).. "[" .. id .. "] : " .. text )
triggerClientEvent ( root , "admin:addText" , root , pm_text )
end
addCommandHandler ( 'pw' , onPrivateMessage )
addCommandHandler ( 'pm' , onPrivateMessage )
function zaplacPieniadze ( plr , cmd , komu , value )
local cel = findPlayerFromName ( komu )
if plr == cel then
outputChatBox ( 'Nie mo?esz wysy?a? pieni?dzy samemu sobie' , plr )
return
end
if ( not value ) or ( not cel ) then
outputChatBox ( "#FF007E* U?yj: /przelej <nick/ID> <kwota>" , plr , 255 , 0 , 0 , true )
return
end
if ( not cel ) then
outputChatBox ( "#FF007E* Nie znaleziono gracza o podanym ID/nicku!" , plr , 255 , 0 , 0 , true )
return
end
if tonumber ( value ) < 0 then return end
if ( not tonumber ( value )) then return end
if getPlayerMoney ( plr ) < tonumber ( value ) then
outputChatBox ( "#FF007E* Nie posiadasz wystarczaj?cej ilo?ci pieni?dzy!" , plr , 255 , 0 , 0 , true )
return
end
takePlayerMoney ( plr , tonumber ( value ))
givePlayerMoney ( cel , tonumber ( value ))
outputChatBox ( "#FF007E* Gracz #DDDDDD" .. getPlayerName ( plr ).. " #FF007Eprzekazuje Ci #DDDDDD" .. tonumber ( value ).. " #FF007EZ?." , cel , 255 , 0 , 0 , true )
outputChatBox ( "* #FF007EPrzekazujesz #DDDDDD" .. tonumber ( value ).. " #FF007EZ? graczowi #DDDDDD" .. getPlayerName ( cel ).. "" , plr , 255 , 0 , 0 , true )
end
addCommandHandler ( "przelej" , zaplacPieniadze )
addCommandHandler ( "zaplac" , zaplacPieniadze )
addCommandHandler ( "dajkase" , zaplacPieniadze )
Takie co? u mnie ?miga ale nie wyszukuje gracza po id czyli musisz podawa? cz??? nicku - nie musi by? tak dok?adnie np zamiast =DC= mo?esz wpisa? dc
Podpis
Witaj
[you]
, jeśli Ci pomogłem postaw mi lub Dzięki!
Wysłany: 2016-08-15, 20:09
AlaneqYT
Uczeń LUA
Wiek: 25 Na forum: 3884 dni Posty: 37
Piwa : 20
"=DC=" napisał/a :
function findPlayerFromName ( name )
local name = name and name : gsub ( "#%x%x%x%x%x%x" , "" ): lower () or nil
if name then
for _ , player in ipairs ( getElementsByType ( "player" )) do
local name_ = getPlayerName ( player ): gsub ( "#%x%x%x%x%x%x" , "" ): lower ()
if name_ : find ( name , 1 , true ) then
return player
end
end
end
end
--[[
Resource : OURGame v2
Developers : Split < split . programista @ gmail . com >
You have no right to use this code without my permission .
( c ) 2015 < split . programista @ gmail . com >. All rights reserved .
]]
function onPrivateMessage ( plr , cmd , komu , ...)
if not komu or not {...} then
outputChatBox ( '* U?yj /pm <nick/ID> <tre??> ' , plr )
return
end
local text = table . concat ({...}, ' ' )
local target = findPlayerFromName ( komu )
if not target then
outputChatBox ( '* Nie znaleziono podanego gracza.' , plr , 255 , 0 , 0 )
return
end
local id = getElementData ( target , "id" ) or ""
local id2 = getElementData ( plr , "id" ) or ""
outputChatBox ( "#FFFFFF>> #BABABA" .. getPlayerName ( target ).. "[" .. id .. "]: #ffffff" .. text .. "" , plr , _ , _ , _ , true )
outputChatBox ( "#FFFFFF<< #BABABA" .. getPlayerName ( plr ).. "[" .. id2 .. "]: #ffffff" .. text .. "" , target , _ , _ , _ , true )
local pm_text =( "PM> " .. getPlayerName ( plr ).. "[" .. id2 .. "]" .. " do " .. getPlayerName ( target ).. "[" .. id .. "] : " .. text )
triggerClientEvent ( root , "admin:addText" , root , pm_text )
end
addCommandHandler ( 'pw' , onPrivateMessage )
addCommandHandler ( 'pm' , onPrivateMessage )
function zaplacPieniadze ( plr , cmd , komu , value )
local cel = findPlayerFromName ( komu )
if plr == cel then
outputChatBox ( 'Nie mo?esz wysy?a? pieni?dzy samemu sobie' , plr )
return
end
if ( not value ) or ( not cel ) then
outputChatBox ( "#FF007E* U?yj: /przelej <nick/ID> <kwota>" , plr , 255 , 0 , 0 , true )
return
end
if ( not cel ) then
outputChatBox ( "#FF007E* Nie znaleziono gracza o podanym ID/nicku!" , plr , 255 , 0 , 0 , true )
return
end
if tonumber ( value ) < 0 then return end
if ( not tonumber ( value )) then return end
if getPlayerMoney ( plr ) < tonumber ( value ) then
outputChatBox ( "#FF007E* Nie posiadasz wystarczaj?cej ilo?ci pieni?dzy!" , plr , 255 , 0 , 0 , true )
return
end
takePlayerMoney ( plr , tonumber ( value ))
givePlayerMoney ( cel , tonumber ( value ))
outputChatBox ( "#FF007E* Gracz #DDDDDD" .. getPlayerName ( plr ).. " #FF007Eprzekazuje Ci #DDDDDD" .. tonumber ( value ).. " #FF007EZ?." , cel , 255 , 0 , 0 , true )
outputChatBox ( "* #FF007EPrzekazujesz #DDDDDD" .. tonumber ( value ).. " #FF007EZ? graczowi #DDDDDD" .. getPlayerName ( cel ).. "" , plr , 255 , 0 , 0 , true )
end
addCommandHandler ( "przelej" , zaplacPieniadze )
addCommandHandler ( "zaplac" , zaplacPieniadze )
addCommandHandler ( "dajkase" , zaplacPieniadze )
Takie co? u mnie ?miga ale nie wyszukuje gracza po id czyli musisz podawa? cz??? nicku - nie musi by? tak dok?adnie np zamiast =DC= mo?esz wpisa? dc
Czy m?g?by? mi poda? kod je?eli by gracze mieli taki sam uid ?eby kickowa?o go z powodem ?e kto? ju? jest na tym koncie? ElementData do uid: player:uid
[ Dodano : 2016-08-15, 20:39 ]
Dobra, mo?na zamkn?? ten temat. Wszyscy otrzymuj? piwka.
Tagi: blokada :: przesyłania :: pieniędzy :: samo :: uid
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: