AR/takePlayerMoney

From Multi Theft Auto: Wiki
Revision as of 16:46, 7 February 2016 by MrRajo (talk | contribs) (Created page with "==Syntax== <section name="Server" class="server" show="true"> <syntaxhighlight lang="lua"> bool takePlayerMoney ( player thePlayer, int amount ) </syntaxhighlight> {{OOP||player:takeMoney|money|}...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Syntax

Click to collapse [-]
Server
bool takePlayerMoney ( player thePlayer, int amount )

OOP Syntax Help! I don't understand this!

Method: player:takeMoney(...)
Variable: .money


الارقمنتات المطلوبة

  • thePlayer: the player الاعب اللي تبي تاخذ فلوس منه.
  • amount: عدد صحيح محدد يسلب من الاعب اللذي تم تعريفه او تم اختياره لفعل شئ.
Click to collapse [-]
Client
bool takePlayerMoney ( int amount )

OOP Syntax Help! I don't understand this!

Method: Player.takeMoney(...)


الارقمنتات المطلوبة

  • amount: عدد صحيح محدد يسلب من الاعب اللذي تم تعريفه او تم اختياره لفعل شئ.

Returns

Returns true if تم اخذ الفلوس, or false if اذا تم اختيار باراميترز غير صحيحه.

أمثله

Click to collapse [-]
Server

هذا المثال يأخذ فلوس من الاعب اذا كتب في "takecash number" in الكونسول (F8).

function takeCash ( thePlayer, command, amount )     -- عندما يتم استدعاء takeCash
     takePlayerMoney ( thePlayer, tonumber(amount) ) -- اخذ مبلغ من مال الاعب
end
addCommandHandler ( "takecash", takeCash )           -- اضافة دالة معالج للامر takeCash"