Mobile::createMobilePhone: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
Creates a mobile phone of the specified type.<br><br>Possible phone types:<br><br>0 - Default phone / Michael's phone<br>1 - Trevor's phone<br>2 - Franklin's phone<br>4 - Prologue phone<br><br>These values represent bit flags, so a value of '3' would toggle Trevor and Franklin's phones together, causing unexpected behavior and most likely crash the game.
{{ClientsideJsFunction}}
Creates a mobile phone of the specified type. This will also put a phone in the players hand as well.
 
 
Phone Types:
* 0 - Default phone / Michael's phone
* 1 - Trevor's phone
* 2 - Franklin's phone
* 4 - Prologue phone
* 5 - Old Phone
 
'''INFO'''
* These values represent bit flags, so a value of '3' would toggle Trevor and Franklin's phones together, causing unexpected behavior and most likely crash the game.
 
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">mp.game.mobile.createMobilePhone(phoneType);</syntaxhighlight>
<pre>mp.game.mobile.createMobilePhone(phoneType);</pre>
 
=== Required Arguments ===
=== Required Arguments ===
*'''phoneType:''' int
*'''phoneType:''' int
===Return value===
===Return value===
*'''Undefined'''
*'''Undefined'''
==Example==
==Example==
<syntaxhighlight lang="javascript">
Creates a mobile phone in the center of your screen when you press F7.
// todo
{{ClientsideCode|
</syntaxhighlight>
<pre>
mp.keys.bind(0x76, true, function() {  // F7
    mp.game.mobile.createMobilePhone(0);
    mp.game.mobile.setMobilePhoneScale(300);
    mp.gui.chat.push('Mobile Created');
});
</pre>
}}
 
==See also==
==See also==
{{Mobile_s_function_c}}
{{Mobile_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:Mobile API]]
[[Category:Mobile API]]
[[Category:TODO: Example]]

Latest revision as of 18:58, 19 May 2020

Client-Side
Function

 JavaScript



Creates a mobile phone of the specified type. This will also put a phone in the players hand as well.


Phone Types:

  • 0 - Default phone / Michael's phone
  • 1 - Trevor's phone
  • 2 - Franklin's phone
  • 4 - Prologue phone
  • 5 - Old Phone

INFO

  • These values represent bit flags, so a value of '3' would toggle Trevor and Franklin's phones together, causing unexpected behavior and most likely crash the game.

Syntax

mp.game.mobile.createMobilePhone(phoneType);

Required Arguments

  • phoneType: int

Return value

  • Undefined

Example

Creates a mobile phone in the center of your screen when you press F7.

Client-Side
mp.keys.bind(0x76, true, function() {   // F7
    mp.game.mobile.createMobilePhone(0);
    mp.game.mobile.setMobilePhoneScale(300);
    mp.gui.chat.push('Mobile Created');
});

See also