Jump to content

[مساعدة]|


Doffy

Recommended Posts

في حدث مسويه الاخ دابل

Wind said:
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 
) 
 

 

بيساعدك كثير

  • Like 3
Link to comment
15 minutes ago, Abdul KariM said:

في حدث مسويه الاخ دابل

 

بيساعدك كثير

محاولتي ما اشتغلت
 

exports.scoreboard:addScoreboardColumn('Money')

addEventHandler("onResourceStart",root,
setTimer(function()
if getElementsByType ( "Money" ) then
getPlayerMoney( source )
setElementData ( source, "getPlayerMoney;players", Money )
end
end,500,1)

 

Link to comment
exports.scoreboard:addScoreboardColumn('Money')

addEventHandler ( "onResourceStart" , resourceRoot , function ( )
for index,values in ipairs ( getElementsByType ( "player" ) ) do 
setElementData ( values , "Money" , getPlayerMoney ( values ) );
end
--- # Timer
setTimer ( function ( )
for index,values in ipairs ( getElementsByType ( "player" ) ) do 
setElementData ( values , "Money" , getPlayerMoney ( values ) );
end
end,3000,0)
end );

 

  • Like 1
Link to comment
8 minutes ago, Default said:

exports.scoreboard:addScoreboardColumn('Money')

addEventHandler ( "onResourceStart" , resourceRoot , function ( )
for index,values in ipairs ( getElementsByType ( "player" ) ) do 
setElementData ( values , "Money" , getPlayerMoney ( values ) );
end
--- # Timer
setTimer ( function ( )
for index,values in ipairs ( getElementsByType ( "player" ) ) do 
setElementData ( values , "Money" , getPlayerMoney ( values ) );
end
end,3000,0)
end );

 

كيف اجيب جنبه علامة دولار الي هي كذا $

Link to comment
exports.scoreboard:addScoreboardColumn('Money')

addEventHandler ( "onResourceStart" , resourceRoot , function ( )
for index,values in ipairs ( getElementsByType ( "player" ) ) do 
setElementData ( values , "Money" , "$"..getPlayerMoney ( values ) );
end
--- # Timer
setTimer ( function ( )
for index,values in ipairs ( getElementsByType ( "player" ) ) do 
setElementData ( values , "Money" , "$"..getPlayerMoney ( values ) );
end
end,3000,0)
end );

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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