Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: isplayerinteam
1. isPlayerInTeam [player expected, got nil]
Wie kto? mo?e co tu jest nie tak? W konsoli wywala b??d "Bad argument 1 @ isPlayerInTeam [player expected, got nil]". Dopiero co zacz??em pisa? skrypty :->

Kod:

brama = createObject ( 980, 1587.9000244141, -1638.3000488281, 13.89999961853, 0, 0, 0 )

function isPlayerInTeam(player, team)
assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]")
assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]")
return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true)))
end


addCommandHandler("open",function()
local team = getTeamFromName("Milicja")
if isPlayerInTeam(source, team) then
moveObject ( brama, 2500, 1587.9000244141, -1638.3000488281, 8.5 )
end
end)


addCommandHandler("close",function()
local team = getTeamFromName("Milicja")
if isPlayerInTeam(source, team) then
moveObject ( brama, 2500, 1587.9000244141, -1638.3000488281, 13.89999961853 )
end
end )