AR/fadeCamera: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "وهذه وظيفة تتلاشى كاميرا اللاعب إلى لون أو العودة إلى وضعها الطبيعي خلال فترة زمنية محددة . وهذا ...")
 
Line 6: Line 6:
bool fadeCamera ( player thePlayer, bool fadeIn, [ float timeToFade = 1.0, int red = 0, int green = 0, int blue = 0 ] )
bool fadeCamera ( player thePlayer, bool fadeIn, [ float timeToFade = 1.0, int red = 0, int green = 0, int blue = 0 ] )
</syntaxhighlight>
</syntaxhighlight>


==Example==
==Example==
Line 24: Line 28:
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>
==See Also==
{{Camera functions}}

Revision as of 18:31, 25 July 2015

وهذه وظيفة تتلاشى كاميرا اللاعب إلى لون أو العودة إلى وضعها الطبيعي خلال فترة زمنية محددة . وهذا يؤثر أيضا على حجم الصوت ل اعب ( 50 ٪ تلاشت = حجم 50 ٪ ، تتلاشى كامل = أي صوت) . للمخطوطات clientside يمكنك تنفيذ 2 الإضافية تتلاشى أو تتلاشى الرافضة في صف واحد، ولكن للمخطوطات جانب الخادم يجب استخدام واحد ثم من جهة أخرى .

Syntax

Click to collapse [-]
Server
bool fadeCamera ( player thePlayer, bool fadeIn, [ float timeToFade = 1.0, int red = 0, int green = 0, int blue = 0 ] )



Example

<section name="Server example" class="server" show="true"> When a player gets damaged, place a quick fade-to-red effect on his screen.

function addRednessOnDamage ( )
      fadeCamera ( source, false, 1.0, 255, 0, 0 )         -- fade the player's camera to red over a period of 1 second
      setTimer ( fadeCameraDelayed, 500, 1, source )   -- don't let it go to opaque red, interrupt it after half a second and fade back to normal
end
addEventHandler ( "onPlayerDamage", getRootElement(), addRednessOnDamage )

function fadeCameraDelayed(player) -- This function prevents debug warnings when the player disconnects while the timer is running.
      if (isElement(player)) then
            fadeCamera(player, true, 0.5)
      end
end


See Also