PL/copyAccountData: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
Jurandovsky (talk | contribs)  | 
				Jurandovsky (talk | contribs)  No edit summary  | 
				||
| Line 17: | Line 17: | ||
==Example==  | ==Example==  | ||
Po wpisaniu komendy /skopiuj kopiuje wartości z konta losowego gracza i przypisuje je na nasze konto  | |||
<syntaxhighlight lang="lua">  | <syntaxhighlight lang="lua">  | ||
| Line 23: | Line 23: | ||
	local acc = getPlayerAccount(plr) -- pobieramy nasze konto  | 	local acc = getPlayerAccount(plr) -- pobieramy nasze konto  | ||
	local acc2 = getPlayerAccount(getRandomPlayer()) -- pobieramy konto losowego gracza  | 	local acc2 = getPlayerAccount(getRandomPlayer()) -- pobieramy konto losowego gracza  | ||
	copyAccountData(acc2, acc) -- kopiujemy z konta '  | 	copyAccountData(acc2, acc) -- kopiujemy z konta 'acc2' wszystkie wartości i przypisujemy je do konca 'acc'  | ||
end)  | end)  | ||
Revision as of 13:52, 5 March 2016
Funkcja ta pozwala na skopiowanie wszystkich wartości konta z jednego account na drugie.
Składnia
bool copyAccountData ( account theAccount, account fromAccount )
OOP Syntax Help! I don't understand this!
- Method: account:copyDataTo(...)
 
Wymagane parametry
- theAccount: Konto na które chcesz skopiować wartość.
 - fromAccount: Konto z którego kopiujesz wartość.
 
Zwracana wartość
Funkcja ta zwraca prawdę jeżeli konta zostały podane prawidłowo, lub fałsz w przeciwnym wypadku.
Example
Po wpisaniu komendy /skopiuj kopiuje wartości z konta losowego gracza i przypisuje je na nasze konto
addCommandHandler("skopiuj", function(plr, cmd)
	local acc = getPlayerAccount(plr) -- pobieramy nasze konto
	local acc2 = getPlayerAccount(getRandomPlayer()) -- pobieramy konto losowego gracza
	copyAccountData(acc2, acc) -- kopiujemy z konta 'acc2' wszystkie wartości i przypisujemy je do konca 'acc'
end)
Zobacz również
- addAccount
 - copyAccountData
 - getAccount
 - getAccountData
 - getAccountName
 - getAccountPlayer
 - getAccountSerial
 - getAccounts
 - getAccountsBySerial
 - getAllAccountData
 - getPlayerAccount
 - isGuestAccount
 - logIn
 - logOut
 - removeAccount
 - setAccountData
 - setAccountPassword
 - getAccountByID
 - getAccountID
 - getAccountIP
 - getAccountsByData
 - getAccountsByIP
 - setAccountName