https://wiki.multitheftauto.com/api.php?action=feedcontributions&user=Peter&feedformat=atomMulti Theft Auto: Wiki - User contributions [en]2024-03-29T15:52:59ZUser contributionsMediaWiki 1.39.3https://wiki.multitheftauto.com/index.php?title=Template:Text_functions&diff=16561Template:Text functions2008-04-14T15:38:37Z<p>Peter: </p>
<hr />
<div>*[[textCreateDisplay]]<br />
<br />
*[[textCreateTextItem]]<br />
<br />
*[[textDestroyDisplay]]<br />
<br />
*[[textDestroyTextItem]] <br />
<br />
*[[textDisplayAddObserver]]<br />
<br />
*[[textDisplayRemoveObserver]]<br />
<br />
{{New feature|3|DP3|<br />
*[[textDisplayIsObserver]]<br />
*[[textDisplayGetObservers]]<br />
}}<br />
<br />
*[[textDisplayAddText]]<br />
<br />
*[[textDisplayRemoveText]]<br />
<br />
*[[textItemGetColor]]<br />
<br />
*[[textItemGetPosition]]<br />
<br />
*[[textItemGetPriority]]<br />
<br />
*[[textItemGetScale]]<br />
<br />
*[[textItemGetText]]<br />
<br />
*[[textItemSetColor]]<br />
<br />
*[[textItemSetPosition]]<br />
<br />
*[[textItemSetPriority]]<br />
<br />
*[[textItemSetScale]]<br />
<br />
*[[textItemSetText]]</div>Peterhttps://wiki.multitheftauto.com/index.php?title=GetPlayerTask&diff=16167GetPlayerTask2008-03-12T17:35:38Z<p>Peter: Nicknames and MTA accounts aren't the same thing =p</p>
<hr />
<div>{{Client function}}<br />
__NOTOC__<br />
This function is used to get the name of the current task of a certain type for a player.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
string getPlayerTask ( player thePlayer, string priority, int taskType, [int index = 0] )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''thePlayer''': The [[player]] whose task you want to retrieve.<br />
*'''priority''': A string determining which set of tasks you want to retrieve it from. This must be either "primary" or "secondary".<br />
*'''taskType''': An integer value representing the task type (or slot) you want to get the task from. Types can be:<br />
**'''PRIMARY TASKS'''<br />
***'''0:''' TASK_PHYSICAL_RESPONSE<br />
***'''1:''' TASK_EVENT_RESPONSE_TEMP<br />
***'''2:''' TASK_EVENT_RESPONSE_NONTEMP<br />
***'''3:''' TASK_PRIMARY<br />
***'''4:''' TASK_DEFAULT<br />
**'''SECONDARY TASKS'''<br />
***'''0:''' TASK_SECONDARY_ATTACK<br />
***'''1:''' TASK_SECONDARY_DUCK<br />
***'''2:''' TASK_SECONDARY_SAY<br />
***'''3:''' TASK_SECONDARY_FACIAL_COMPLEX<br />
***'''4:''' TASK_SECONDARY_PARTIAL_ANIM<br />
***'''5:''' TASK_SECONDARY_IK<br />
<br />
===Optional Arguments===<br />
*'''index''': An integer value representing how many sub tasks to go through. -1 to get the simplest task, 0 to get the most complex task.<br />
<br />
===Returns===<br />
Returns a string containing the name of a task. See [[list of player tasks]] for valid strings. Returns ''false'' if invalid arguments are specified or if there is no task of the type or index specified.<br />
<br />
==Example==<br />
<section name="Client" class="client" show="true"><br />
This example prints the name of a player's task to the chat when they use the "task" command in the console.<br />
<syntaxhighlight lang="lua"><br />
function myTask ( commandName, priority, taskType )<br />
task = getPlayerTask ( source, priority, tonumber(taskType) )<br />
taskName = "none"<br />
if ( task ) then<br />
taskName = task<br />
end<br />
outputChatBox ( getPlayerName( source ) .. "'s " .. priority .. "(" .. taskType .. ") task is: " .. taskName )<br />
end <br />
addCommandHandler ( "task", myTask )<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Player functions}}</div>Peterhttps://wiki.multitheftauto.com/index.php?title=Resource:Realdriveby&diff=15958Resource:Realdriveby2008-02-23T16:56:11Z<p>Peter: </p>
<hr />
<div>{{Resource page}}<br />
== Introduction ==<br />
RealDriveby is a fully customisable resource which allows a flexible driveby system for your server.<br />
<br />
All of GTA's driveby compatible weapons, including the shotguns,pistols,M4 and AK-47 are supported by this resource. Shot delays for weapons such as pistols are fixed to their normal rate.<br />
<br />
Users can switch weapons by default using the &quot;Vehicle Look Left&quot; and &quot;Vehicle Look Right&quot; keys while in driveby mode.<br />
<br />
However, it is completely up to the admin how he or she wants drivebys to be: Using MTA's settings system, shot delays for weapons can be modified; the weapons which a driver can driveby with are customisable; the weapons a passenger can driveby with are customisable.<br />
<br />
There are also options available to disable steering whilst in driveby mode, or disable drivebys altogether for certain vehicles.<br />
<br />
On top of this, RealDriveby provides clientside scripting functions so that users can modify these attributes on a player-basis, allowing different players the ability to driveby different weapons and different delays.<br />
<br />
== Settings ==<br />
All settings can be modified using MTA's set() functions, modifying the meta.xml of the resource, or modifying the settings.xml.<br />
<br />
===Driver weapons===<br />
* '''Setting name:''' ''driveby_driver''<br />
* '''Description:''' Sets the weapons that a driver can driveby with. To disable driver drivebys, just pass an empty table. See [[Resource:Realdriveby#GTA_Driveby_Compatible_weapons|here]] for compatible weapons.<br />
* '''XML Example:''' <syntaxhighlight lang="xml"><setting name="driveby_driver" value="[[ 22,23,24,26,28,29,32 ]]"/></syntaxhighlight><br />
<br />
===Passenger weapons===<br />
* '''Setting name:''' ''driveby_passenger''<br />
* '''Description:''' Sets the weapons that a passenger can driveby with. To disable passenger drivebys, just pass an empty table. See [[Resource:Realdriveby#GTA_Driveby_Compatible_weapons|here]] for compatible weapons.<br />
* '''XML Example:''' <syntaxhighlight lang="xml"><setting name="driveby_passenger" value="[[ 22,23,24,25,26,28,29,32,30,31,33 ]]"/></syntaxhighlight><br />
<br />
===Shot delay===<br />
* '''Setting name:''' ''driveby_shot_delay''<br />
* '''Description:''' Sets the delay between each individual shot for the specified weapons. Unspecified weapons have GTA's default driveby fire rate. The setting is in the format of a table where the key is a '''string''' of the weapon ID, and the value is the delay in milliseconds.<br />
* '''XML Example:''' <syntaxhighlight lang="xml"><setting name="driveby_shot_delay" value="[{ '22':300,'23':300,'24':800,'26':700 }]"/></syntaxhighlight><br />
<br />
===Blocked vehicles===<br />
* '''Setting name:''' ''driveby_blocked_vehicles''<br />
* '''Description:''' Sets the vehicles which driveby mode cannot be accessed in. Useful to block strange effects such as drivebys in tanks. In the format of an array of vehicle IDs.<br />
* '''XML Example:''' <syntaxhighlight lang="xml"><setting name="driveby_blocked_vehicles" value="[[ 432,601,437,431,592,553,577,488,497,548,563,512,476,447,425,519,520,460,417,469,487,513,441,464,501,465,564,538,449,537,539,570472,473,493,595,484,430,453,452,446,454,606,591,607,611,610,590,569,611,435,608,584,450 ]]"/></syntaxhighlight><br />
<br />
===Steer Cars while in driveby mode===<br />
* '''Setting name:''' ''driveby_steer_cars''<br />
* '''Description:''' Sets whether drivers can steer left or right while in driveby mode for vehicles besides bikes. The setting is in the format of a bool, where ''true'' allows steering.<br />
* '''XML Example:''' <syntaxhighlight lang="xml"><setting name="driveby_steer_cars" value="[true]"/></syntaxhighlight> <br />
<br />
===Steer Bikes while in driveby mode===<br />
* '''Setting name:''' ''driveby_steer_bikes''<br />
* '''Description:''' Sets whether drivers can steer left or right while in driveby mode for bikes/bicycles. If set to false, it allows extra realism. The setting is in the format of a bool, where ''true'' allows steering.<br />
* '''XML Example:''' <syntaxhighlight lang="xml"><setting name="driveby_steer_bikes" value="[true]"/></syntaxhighlight> <br />
<br />
===Toggle driveby mode key===<br />
* '''Setting name:''' ''driveby_toggle_mode''<br />
* '''Description:''' Sets the [[Key names|key]] which will be used to toggle driveby mode.<br />
* '''XML Example:''' <syntaxhighlight lang="xml"><setting name="driveby_toggle_mode" value="mouse2"/></syntaxhighlight> <br />
<br />
===Next driveby weapon key===<br />
* '''Setting name:''' ''driveby_next_weapon''<br />
* '''Description:''' Sets the [[Key names|key]] which will be used to change to the next driveby weapon (if there is one).<br />
* '''XML Example:''' <syntaxhighlight lang="xml"><setting name="driveby_next_weapon" value="vehicle_look_right"/></syntaxhighlight> <br />
<br />
===Previous driveby weapon key===<br />
* '''Setting name:''' ''driveby_prev_weapon''<br />
* '''Description:''' Sets the [[Key names|key]] which will be used to change to the previous driveby weapon (if there is one).<br />
* '''XML Example:''' <syntaxhighlight lang="xml"><setting name="driveby_prev_weapon" value="vehicle_look_left"/></syntaxhighlight> <br />
<br />
==Scripting functions==<br />
All scripting functions are '''clientside''' and therefore only affect the '''local player'''. All functions must be called using the [[call]] function, e.g.<br />
<syntaxhighlight lang="lua">call(getResourceFromName("realdriveby"),"setWeaponShotDelay",22,300)</syntaxhighlight><br />
<br />
===setDriverDrivebyAbility===<br />
This function allows you to set what weapons the local player can use while a driver of a vehicle.<br />
<syntaxhighlight lang="lua"><br />
bool setDriverDrivebyAbility ( table weapons )<br />
</syntaxhighlight><br />
* '''weapons:''' An an array/table containing weapon IDs that the driver may use. See [[Resource:Realdriveby#GTA_Driveby_Compatible_weapons|here]] for compatible weapons.<br />
<br />
<br />
===getDriverDrivebyAbility===<br />
This function allows you to retrive what weapons the local player can use while a driver of a vehicle.<br />
<syntaxhighlight lang="lua"><br />
table getDriverDrivebyAbility ()<br />
</syntaxhighlight><br />
Returns a table of the weapons that can be used as a driver.<br />
<br />
===setPassengerDrivebyAbility===<br />
This function allows you to set what weapons the local player can use while a passenger of a vehicle.<br />
<syntaxhighlight lang="lua"><br />
bool setPassengerDrivebyAbility ( table weapons )<br />
</syntaxhighlight><br />
* '''weapons:''' An an array/table containing weapon IDs that the passenger may use. See [[Resource:Realdriveby#GTA_Driveby_Compatible_weapons|here]] for compatible weapons.<br />
<br />
<br />
===getPassengerDrivebyAbility===<br />
This function allows you to retrive what weapons the local player can use while a passenger of a vehicle.<br />
<syntaxhighlight lang="lua"><br />
table getPassengerDrivebyAbility ()<br />
</syntaxhighlight><br />
Returns a table of the weapons that can be used as a passenger.<br />
<br />
<br />
===setWeaponShotDelay===<br />
This function allows setting of a certain weapon's shot delay for the local player<br />
<syntaxhighlight lang="lua"><br />
bool setWeaponShotDelay(int weaponID, int delay)<br />
</syntaxhighlight><br />
* '''weaponID:''' An integer representing the [[Weapons|weapon ID]] of the delay that you wish to set.<br />
* '''delay:''' An integer representing the delay in between each shot, in '''milliseconds'''.<br />
<br />
<br />
===getWeaponShotDelay===<br />
This function allows retrieving of a certain weapon's shot delay for the local player<br />
<syntaxhighlight lang="lua"><br />
int getWeaponShotDelay(int weaponID)<br />
</syntaxhighlight><br />
* '''weaponID:''' An integer representing the [[Weapons|weapon ID]] of the delay that you wish to retrieve.<br />
Returns an integer representing the weapon delay in between each shot.<br />
<br />
<br />
===setDrivebySteeringAbility===<br />
This function allows setting of whether the local player can steer while in driveby mode.<br />
<syntaxhighlight lang="lua"><br />
bool setDrivebySteeringAbility( bool otherVehicles, bool bikes )<br />
</syntaxhighlight><br />
* '''otherVehicles:''' A bool representing whether steering is enabled while in any vehicle besides a bike/bicycle, where ''true'' represents enabled steering and ''false'' represents disabled steering.<br />
* '''bikes :''' A bool representing whether steering is enabled while in a bike/bicycle, where ''true'' represents enabled steering and ''false'' represents disabled steering.<br />
<br />
<br />
===getDrivebySteeringAbility===<br />
This function allows retrieving of whether the local player can steer while in driveby mode.<br />
<syntaxhighlight lang="lua"><br />
bool getDrivebySteeringAbility( string drivebyType )<br />
</syntaxhighlight><br />
* '''drivebyType :''' A string which can either be "'''bike'''", representing bikes/bicycles, or "'''car'''" representing all other vehicles.<br />
Returns a bool of the ability of the specified type of driveby, where ''true'' is enabled and ''false'' is disabled.<br />
<br />
==GTA Driveby Compatible weapons==<br />
These are weapons that are compatible with GTA/MTA's driveby mode, and can be used by this script.<br />
<br />
<table border="1" class="unnamed1"><tr><th>Name</th><th>ID</th><td> </td><th>Name</th><th>ID</th></tr><tr><td>Pistol</td><td>22</td><td> </td><td>Silenced Pistol</td><td>23</td></tr><tr><td>Desert Eagle</td><td>24</td><td> </td><td>Chrome Shotgun</td><td>25</td> </tr><tr><td>Sawn-Off Shotgun</td><td>26</td><td> </td><td>Combat Shotgun</td><td>27</td></tr><tr><td>Uzi</td><td>28</td><td> </td><td>MP5</td><td>29</td></tr><tr><td>Tec-9</td><td>32</td><td> </td><td>AK-47</td><td> 30</td></tr><tr><td>M4</td><td>31</td><td> </td><td>Country Rifle</td><td>33</td></tr><br />
<tr><td>Minigun</td><td>38</td><td> </td><td></td><td></td></tr></table></div>Peterhttps://wiki.multitheftauto.com/index.php?title=FixVehicle&diff=15687FixVehicle2008-02-03T16:27:31Z<p>Peter: No such function</p>
<hr />
<div>{{Server client function}}<br />
__NOTOC__<br />
This function will set a [[vehicle]]'s health to full and fix its damage model. If you wish to only change the vehicle's health, without affecting its damage model, use [[setElementHealth]].<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool fixVehicle ( vehicle theVehicle ) <br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''theVehicle:''' The vehicle you wish to fix<br />
<br />
===Returns===<br />
Returns ''true'' if the vehicle was fixed, ''false'' if '''theVehicle''' is invalid.<br />
<br />
==Example== <br />
This example fixes all the vehicles that exist in the map.<br />
<syntaxhighlight lang="lua"><br />
-- Retrieve a table containing all the vehicles that exist<br />
vehicles = getElementsByType ( "vehicle" )<br />
-- Loop through the list, storing the vehicle from the table in the variable vehicleValue<br />
for vehicleKey, vehicleValue in ipairs(vehicles) do<br />
-- fix the vehicle<br />
fixVehicle ( vehicleValue )<br />
end<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Vehicle_functions}}</div>Peterhttps://wiki.multitheftauto.com/index.php?title=SetVehiclePanelState&diff=15188SetVehiclePanelState2008-01-24T10:20:54Z<p>Peter: </p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
<br />
This function allows you to change the state of one of the six panels vehicle's can have. When executed on the server-side resources, the damage will be synched for all players, whereas the change is only client-side if the function is used in a client resource. <br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua">bool setVehiclePanelState ( vehicle theVehicle, int panelID, int state )</syntaxhighlight><br />
<br />
==Required Arguments==<br />
*'''theVehicle:''' The [[vehicle]] you would like to modify the panel of.<br />
*'''panelID:''' 0-6<br />
*'''state:''' 0-255 (check what range is effective, it may be much smaller e.g. 0-3)<br />
<br />
==Returns==<br />
Returns ''true'' if the panel state has been updated, ''false'' otherwise<br />
<br />
==See Also==<br />
{{Vehicle functions}}</div>Peterhttps://wiki.multitheftauto.com/index.php?title=SetVehiclePanelState&diff=15187SetVehiclePanelState2008-01-24T10:16:25Z<p>Peter: </p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua">setVehiclePanelState ( vehicle theVehicle, int panelID, int state )</syntaxhighlight><br />
<br />
==Required Arguments==<br />
*'''theVehicle:''' The vehicle you would like to modify the panel of.<br />
*'''panelID:''' 0-6<br />
*'''state:''' 0-255 (check what range is effective, it may be much smaller e.g. 0-3)<br />
<br />
==Returns==<br />
Returns ''true'' if it works, ''false'' otherwise<br />
<br />
==See Also==<br />
{{Vehicle functions}}</div>Peter