Jump to content

استفسار عن كود بسيط


Recommended Posts

--- Server side . 

local saveTimer = { } ;


addCommandHandler ( "money" , function ( player ) 
if ( isTimer ( saveTimer [ getPlayerSerial ( player ) ] ) ) then return end 
givePlayerMoney ( player , 100000 ) ; 
saveTimer [ getPlayerSerial ( player ) ] = setTimer ( function ( ) end,4*60*1000,1) ; 
end ) 

هذا الكود لو كتب الأمر يعطيه فلوس ولو طلع ودخل وكتب الأمر والتايمر لسى ماخلص مايعطيه انت شوف الطريقة وسويها بالي تبيه

Edited by -Ilker.
Link to comment
On 04/05/2020 at 03:04, -Ilker. said:

--- Server side . 

local saveTimer = { } ;


addCommandHandler ( "money" , function ( player ) 
if ( isTimer ( saveTimer [ getPlayerSerial ( player ) ] ) ) then return end 
givePlayerMoney ( player , 100000 ) ; 
saveTimer [ getPlayerSerial ( player ) ] = setTimer ( function ( ) end,4*60*1000,1) ; 
end ) 

هذا الكود لو كتب الأمر يعطيه فلوس ولو طلع ودخل وكتب الأمر والتايمر لسى ماخلص مايعطيه انت شوف الطريقة وسويها بالي تبيه

اخوي ممكن أعرف شلون اضبطها ع الكلنت ؟

لاني ابي استخدم الامر onClientGUIClick

اذا تقدر اكتب لي التريقر ل سيرفر سايد

وعطني فقط فكرة عن الكلنت سايد

Edited by Taken'
توضيح اكتر
Link to comment
button = guiCreateButton ( 300 , 300 , 100 , 30 , "Money" , false ) 

addEventHandler ( "onClientGUIClick" , root , function ( ) 
if ( source == button ) then 
triggerServerEvent ( "giveMoney" , localPlayer ) 
end
end ) ; 

-- Server side 

local timer = { }

addEvent ( "giveMoney" , true )
addEventHandler ( "giveMoney" , root , function ( ) 
if ( not isTimer ( timer [ getPlayerSerial ( source ) ] ) ) then 
givePlayerMoney ( source , 1000 ) 
timer[getPlayerSerial(source)] = setTimer ( function ( ) end,3*60*1000,1)
else 
outputChatBox("* Please Wait.",source,255,0,0,true)
end
end ) ; 

سويت لك تقريبًا 95% من طلبك بس باقي عليك تقفل الازرار

Link to comment
3 hours ago, -Ilker. said:

button = guiCreateButton ( 300 , 300 , 100 , 30 , "Money" , false ) 

addEventHandler ( "onClientGUIClick" , root , function ( ) 
if ( source == button ) then 
triggerServerEvent ( "giveMoney" , localPlayer ) 
end
end ) ; 

-- Server side 

local timer = { }

addEvent ( "giveMoney" , true )
addEventHandler ( "giveMoney" , root , function ( ) 
if ( not isTimer ( timer [ getPlayerSerial ( source ) ] ) ) then 
givePlayerMoney ( source , 1000 ) 
timer[getPlayerSerial(source)] = setTimer ( function ( ) end,3*60*1000,1)
else 
outputChatBox("* Please Wait.",source,255,0,0,true)
end
end ) ; 

سويت لك تقريبًا 95% من طلبك بس باقي عليك تقفل الازرار

كودك لو انه سوا ريستارت للمود بيروح :) 

الافضل انه يسويه بالسكل

  • Like 1
Link to comment
11 hours ago, -Ilker. said:

button = guiCreateButton ( 300 , 300 , 100 , 30 , "Money" , false ) 

addEventHandler ( "onClientGUIClick" , root , function ( ) 
if ( source == button ) then 
triggerServerEvent ( "giveMoney" , localPlayer ) 
end
end ) ; 

-- Server side 

local timer = { }

addEvent ( "giveMoney" , true )
addEventHandler ( "giveMoney" , root , function ( ) 
if ( not isTimer ( timer [ getPlayerSerial ( source ) ] ) ) then 
givePlayerMoney ( source , 1000 ) 
timer[getPlayerSerial(source)] = setTimer ( function ( ) end,3*60*1000,1)
else 
outputChatBox("* Please Wait.",source,255,0,0,true)
end
end ) ; 

سويت لك تقريبًا 95% من طلبك بس باقي عليك تقفل الازرار

يعطيك العافية♥️

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...