https://wiki.multitheftauto.com/api.php?action=feedcontributions&user=Arse&feedformat=atomMulti Theft Auto: Wiki - User contributions [en]2024-03-29T11:50:32ZUser contributionsMediaWiki 1.39.3https://wiki.multitheftauto.com/index.php?title=User:Arse&diff=22129User:Arse2009-12-31T14:19:52Z<p>Arse: Created page with 'File:Lokkaas.png'</p>
<hr />
<div>[[File:Lokkaas.png]]</div>Arsehttps://wiki.multitheftauto.com/index.php?title=File:Lokkaas.png&diff=22128File:Lokkaas.png2009-12-31T14:19:19Z<p>Arse: domo Kun</p>
<hr />
<div>domo Kun</div>Arsehttps://wiki.multitheftauto.com/index.php?title=SetTrainDerailed&diff=22123SetTrainDerailed2009-12-30T16:40:28Z<p>Arse: /* Example */</p>
<hr />
<div>__NOTOC__ <br />
[[Category:Needs_Example]]<br />
{{Server client function}}<br />
This function will set a train or tram as derailed.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool setTrainDerailed ( vehicle vehicleToDerail, bool derailed ) <br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''vehicleToDerail:''' The vehicle that you wish to derail.<br />
*'''derailed:''' whether the train is derailed.<br />
<br />
===Returns===<br />
Returns ''true'' if the state was successfully set<br />
<br />
==Example==<br />
<section name="Example" class="server" show="true"><br />
This example creates an underailable train, and alows it to be derailed when you want<br />
<syntaxhighlight lang="lua"><br />
function makeTrain(thePlayer)<br />
myTrain = createVehicle(537,1995,-1949,13)-- This will make a freight train just east of the LS train station<br />
setTrainDerailable(myTrain, false) -- myTrain can not be derailed now<br />
outputChatBox("A freight train has been created for you.", thePlayer) -- Just a simple message for the player<br />
end<br />
addCommandHandler("trainmeup", makeTrain)<br />
<br />
function derailTrain()<br />
setTrainDerailed(myTrain, true) -- When the command is used the train becomes derailed<br />
outputChatBox("Freight train has been derailed!", thePlayer) -- A message to confirm the train was derailed<br />
end<br />
addCommandHandler("derailme", derailTrain)<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Vehicle_functions}}</div>Arsehttps://wiki.multitheftauto.com/index.php?title=PL/getAccount&diff=22121PL/getAccount2009-12-30T16:34:43Z<p>Arse: /* Przykłady */</p>
<hr />
<div>__NOTOC__<br />
{{Server function}}<br />
Funkcja zwraca konto dla określonego użytkownika.<br />
==Składnia==<br />
<syntaxhighlight lang="lua"><br />
account getAccount ( string nazwa, [ string hasło ] )<br />
</syntaxhighlight><br />
<br />
===Wymagane argumenty===<br />
*'''nazwa:''' Nazwa użytkownika konta, które chcesz otrzymać.<br />
<br />
===Opcjonalne argumenty===<br />
{{ArgOpcjonalne}}<br />
*'''hasło:''' Hasło dla konta. Jeśli używasz tego argumentu, hasła muszą się zgadzać. Jeśli jednak hasło nie jest podane, konto zostanie zwrócone, bez względu na to, jakie hasło jest przypisane do konta.<br />
<br />
===Zwraca===<br />
''Account'' w przypadku sukcesu lub ''fałsz'' jeśli konto z podaną nazwa użytkownika (oraz hasłem, jeśli podane) nie mogła zostać odnalezione.<br />
<br />
==Przykłady==<br />
<syntaxhighlight lang="lua"><br />
function retAccount ( nazwa, hasło ) <br />
if getAccount( nazwa, hasło ) then<br />
return getAccount( nazwa, hasło )<br />
end<br />
return false<br />
end<br />
</syntaxhighlight><br />
<br />
==Patrz także==<br />
{{Account functions}}<br />
<br />
[[en:GetAccount]]</div>Arsehttps://wiki.multitheftauto.com/index.php?title=PL/getAccount&diff=22120PL/getAccount2009-12-30T16:33:41Z<p>Arse: /* Przykłady */</p>
<hr />
<div>__NOTOC__<br />
{{Server function}}<br />
Funkcja zwraca konto dla określonego użytkownika.<br />
==Składnia==<br />
<syntaxhighlight lang="lua"><br />
account getAccount ( string nazwa, [ string hasło ] )<br />
</syntaxhighlight><br />
<br />
===Wymagane argumenty===<br />
*'''nazwa:''' Nazwa użytkownika konta, które chcesz otrzymać.<br />
<br />
===Opcjonalne argumenty===<br />
{{ArgOpcjonalne}}<br />
*'''hasło:''' Hasło dla konta. Jeśli używasz tego argumentu, hasła muszą się zgadzać. Jeśli jednak hasło nie jest podane, konto zostanie zwrócone, bez względu na to, jakie hasło jest przypisane do konta.<br />
<br />
===Zwraca===<br />
''Account'' w przypadku sukcesu lub ''fałsz'' jeśli konto z podaną nazwa użytkownika (oraz hasłem, jeśli podane) nie mogła zostać odnalezione.<br />
<br />
==Przykłady==<br />
<syntaxhighlight lang="lua"><br />
function retAccount ( username, password ) --both arguements are strings<br />
if getAccount( username, password ) then<br />
return getAccount( username, password )<br />
end<br />
return false<br />
end<br />
</syntaxhighlight><br />
<br />
==Patrz także==<br />
{{Account functions}}<br />
<br />
[[en:GetAccount]]</div>Arsehttps://wiki.multitheftauto.com/index.php?title=CreateColPolygon&diff=22116CreateColPolygon2009-12-30T16:23:14Z<p>Arse: /* Example */</p>
<hr />
<div>__NOTOC__ <br />
{{Server client function}}<br />
This function creates a collision polygon. See [http://en.wikipedia.org/wiki/Polygon Wikipedia] for a definition of a polygon. The first set of X Y of this shape is not part of the colshape bounds, so can set anywhere in the game world, however for performance, place it somewhere within the polygon. It should be noted this shape is '''2D'''. There should be at least 3 bound points set. <br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
colshape createColPolygon ( float fX, float fY, float fX1, float fY1, float fX2, float fY2, float fX3, float fY3, ... )<br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''fX:''' The X position of the collision polygon's dummy point<br />
*'''fY:''' The Y position of the collision polygon's dummy point<br />
*'''fX1:''' The 1st X position of the collision polygon's bound point<br />
*'''fY1:''' The 1st Y position of the collision polygon's bound point<br />
*'''fX2:''' The 2nd X position of the collision polygon's bound point<br />
*'''fY2:''' The 2nd Y position of the collision polygon's bound point<br />
*'''fX3:''' The 3rd X position of the collision polygon's bound point<br />
*'''fY3:''' The 3rd Y position of the collision polygon's bound point<br />
*'''...''' From the 3rd position you can have as many points as you require to create the colshape.<br />
<br />
===Returns===<br />
Returns a [[colshape]] element if successful, ''false'' if invalid arguments were passed to the function.<br />
<br />
==Example== <br />
<section name="Server" class="server" show="true"><br />
This example displays a chat message when a player enters the colshape and allows the colshape to be created using a console function ''set_zone''.<br />
<syntaxhighlight lang="lua"><br />
theZone = false<br />
<br />
function shapeHit ( thePlayer ) <br />
outputChatBox ( getPlayerName ( thePlayer ) .. " is in the zone!" ) -- display a message in everyone's chat box<br />
end<br />
<br />
function setZone ( playerSource, commandName, fX, fY, fX1, fY1, fX2, fY2, fX3, fY3 ) --Remember that after the 3rd position you <br />
--can have as many points as you require to <br />
--create the colshape.<br />
<br />
if ( fY and fX and fX1 and fY1 and fX2 and fX3 and fY3 ) then -- check we've got the 8 args we need<br />
local tempCol = createColPolygon ( fX, fY, fX1, fY1, fX2, fY2, fX3, fY3 ) -- create a col<br />
if ( tempCol == false ) then -- did the col get created successfully?<br />
outputConsole ("Syntax is: set_zone <X> <Y> <X1> <Y1> <X2> <Y2> <X3> <Y3>")-- inform the user what the valid syntax is<br />
else<br />
if ( theZone ~= false ) then -- did we already have a zone?<br />
destroyElement ( theZone ) -- if so, destroy it<br />
else<br />
addEventHandler ( "onColShapeHit", theZone, shapeHit ) -- add a handler for the onColShapeHit event<br />
end<br />
theZone = tempCol -- and store the new zone we've made<br />
outputChatBox ( "Zone has moved!" ) -- and tell everyone<br />
end<br />
end<br />
end<br />
addCommandHandler ( "set_zone", setZone ) -- add a console function called set_zone that will trigger the function setZone<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Collision shape functions}}<br />
[[Category:Needs Example]]</div>Arsehttps://wiki.multitheftauto.com/index.php?title=CreateColPolygon&diff=22115CreateColPolygon2009-12-30T16:22:55Z<p>Arse: /* Example */</p>
<hr />
<div>__NOTOC__ <br />
{{Server client function}}<br />
This function creates a collision polygon. See [http://en.wikipedia.org/wiki/Polygon Wikipedia] for a definition of a polygon. The first set of X Y of this shape is not part of the colshape bounds, so can set anywhere in the game world, however for performance, place it somewhere within the polygon. It should be noted this shape is '''2D'''. There should be at least 3 bound points set. <br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
colshape createColPolygon ( float fX, float fY, float fX1, float fY1, float fX2, float fY2, float fX3, float fY3, ... )<br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''fX:''' The X position of the collision polygon's dummy point<br />
*'''fY:''' The Y position of the collision polygon's dummy point<br />
*'''fX1:''' The 1st X position of the collision polygon's bound point<br />
*'''fY1:''' The 1st Y position of the collision polygon's bound point<br />
*'''fX2:''' The 2nd X position of the collision polygon's bound point<br />
*'''fY2:''' The 2nd Y position of the collision polygon's bound point<br />
*'''fX3:''' The 3rd X position of the collision polygon's bound point<br />
*'''fY3:''' The 3rd Y position of the collision polygon's bound point<br />
*'''...''' From the 3rd position you can have as many points as you require to create the colshape.<br />
<br />
===Returns===<br />
Returns a [[colshape]] element if successful, ''false'' if invalid arguments were passed to the function.<br />
<br />
==Example== <br />
<section name="Server" class="server" show="true"><br />
This example displays a chat message when a player enters the colshape and allows the colshape to be created using a console function ''set_zone''.<br />
<syntaxhighlight lang="lua"><br />
theZone = false<br />
<br />
function shapeHit ( thePlayer ) <br />
outputChatBox ( getPlayerName ( thePlayer ) .. " is in the zone!" ) -- display a message in everyone's chat box<br />
end<br />
<br />
function setZone ( playerSource, commandName, fX, fY, fX1, fY1, fX2, fY2, fX3, fY3 ) --Remember that after the 3rd position you <br />
--can have as many points as you require to <br />
--create the colshape.<br />
<br />
if ( fY and fX and fX1 and fY1 and fX2 and fX3 and fY3 ) then -- check we've got the 8 args we need<br />
local tempCol = createColPolygon ( fX, fY, fX1, fY1, fX2, fY2, fX3, fY3 ) -- create a col<br />
if ( tempCol == false ) then -- did the col get created successfully?<br />
outputConsole ("Syntax is: set_zone <X> <Y> <X1> <Y1> <X2> <Y2> <X3> <Y3>")-- inform the user what the valid syntax is<br />
else<br />
if ( theZone ~= false ) then -- did we already have a zone?<br />
destroyElement ( theZone ) -- if so, destroy it<br />
else<br />
addEventHandler ( "onColShapeHit", theZone, shapeHit ) -- add a handler for the onColShapeHit event<br />
end<br />
theZone = tempCol -- and store the new zone we've made<br />
outputChatBox ( "Zone has moved!" ) -- and tell everyone<br />
end<br />
end<br />
end<br />
addCommandHandler ( "set_zone", setZone ) -- add a console function called set_zone that will trigger the function setZone<br />
</syntaxhighlight><br />
</section><br />
<section name="Client" class="client" show="true"><br />
<syntaxhighlight lang="lua">--To Do.</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Collision shape functions}}<br />
[[Category:Needs Example]]</div>Arse