Witam, chcia?em zrobi? tak. Aby po wej?ciu na serwer przypisa?o nowego do Teamu "Gracze"
Ju? mam skrypt z teamami i z zapisem teamu do account.
Ale jest problem, ?e po wej?ciu na serwer gracz nie jest w ?adnym teamie Jest na to jaki? skrypt czy co? Prosz? o pomoc
Skrypt na zapis teamu do gracza:
[code]
--Team save
function onPlayQuit ( )
local playeraccount = getPlayerAccount ( source )
if ( playeraccount ) and not isGuestAccount ( playeraccount ) then -- if the player is logged in
local myTeam = getPlayerTeam ( source )
if (myTeam) then
local currentTeam = getTeamName ( myTeam )
setAccountData ( playeraccount, "TeamLog", currentTeam ) -- save it in his account
end
end
end
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayQuit )
--Team load
function onPlayLogin (_, playeraccount )
if ( playeraccount ) then
local LoadTeam = getAccountData ( playeraccount, "TeamLog" )
if ( LoadTeam ) then
teamLoad = getTeamFromName ( LoadTeam )
setPlayerTeam ( source, teamLoad )
end
end
end
addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayLogi
[/code]
Skrypt na teamy:
[code]
function createTeamsOnStart ()
createTeam ( "Gracze", 255, 255, 255 ) --change the 3 numbers(0,255,0), the first number is ColourR, the second is ColourG, ... |