Jump to content

New Event .. it's useful


Recommended Posts

NOTE : هذا مو فنكشن لكنه ايفينت وما لقيت مواضيع وما يلزم موضوع جديد مشان ايفنت فقلت اطرححه هنا

---------------------------

onClientPlayerMoneyChange

ClientSide event

الايفينت يتنفذ لما تتغير فلوس الاعب المحلي فيه

Parameters

_________________________________________________________

int OldMoney, int NewMoney 

• OldMoney : الفلوس اللي كانت مع الاعب قبل التغيير

• NewMoney : الفلوس اللي مع الاعب بعد التغيير

Source

_________________________________________________________

(المصدرهو الاعب المحلي (اللي تغيرت فلوسه

Source Code

_________________________________________________________

local EventPlayerMoney = getPlayerMoney(localPlayer) 
  
addEventHandler("onClientRender", root,  
function () 
    if EventPlayerMoney ~= getPlayerMoney(localPlayer) then 
        triggerEvent("onClientPlayerMoneyChange", localPlayer, tonumber(EventPlayerMoney), tonumber(getPlayerMoney(localPlayer))) 
        EventPlayerMoney = getPlayerMoney(localPlayer) 
    end 
end 
) 
  
addEvent "onClientPlayerMoneyChange" 

Example

_________________________________________________________

المثال ذا يتحقق كل مرة لما تتغير فلوسه اذا كانت فوق 8000 ويطلع نص بلشات

VehiclePrice = 8000 
  
addEventHandler("onClientPlayerMoneyChange", root,  
function (OldMoney, NewMoney) 
    if NewMoney >= VehiclePrice then 
        outputChatBox("Now you can buy the vehicle !", 0, 255, 0) 
    elseif OldMoney < VehiclePrice then 
        outputChatBox("get more money to buy the vehicle", 255, 0, 0) 
    end 
end 
) 

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...