AR/getPlayerTeam: Difference between revisions
Jump to navigation
Jump to search
KING-ABADY (talk | contribs) (Created page with "هاذه الوضيفة تحضر فريق الاعب ==Syntax== <syntaxhighlight lang="lua"> team getPlayerTeam ( player thePlayer ) </syntaxhighlight> ===العناصر المطلوبة=== *'''thePlaye...") |
(No difference)
|
Revision as of 16:23, 7 April 2013
هاذه الوضيفة تحضر فريق الاعب
Syntax
team getPlayerTeam ( player thePlayer )
العناصر المطلوبة
- thePlayer الاعب المراد احضار فريقه
Returns
Returns فريق الاعب الذي تم احضاره, false اذا لم يكن الاعب في فريق.
مثال
Click to collapse [-]
Serverهاذه المثال يحضر فريق الاعب ثم يغير اسمه.
function teamName ( source, key, newTeamName ) local playerTeam = getPlayerTeam ( source ) -- احضار فريق الاعب if ( playerTeam ) then -- اذا تم احضار فريق الاعب local oldTeamName = getTeamName ( playerTeam ) -- احضار اسم الفريق setTeamName ( playerTeam, newTeamName ) -- تغير اسم الفريق outputChatBox ( "Changed " .. getPlayerName ( source ).."'s team name from " .. oldTeamName .. " to " .. newTeamName ) else outputChatBox ( getPlayerName ( source ) .. " الاعب ليسه في فريق" ) end end addCommandHandler ( "teamname", teamName )