AR/takePlayerMoney

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

This function subtracts money from a player's current money amount.

[[{{{image}}}|link=|]] Note: Using this function client side (not recommended) will not change a players money server side.

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: اللاعب الذي تريد سحب المال منه .
  • 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 )           -- أنشاء امر"