Jump to content

تصحيح كود الفلوس بالقريد لسيت


Recommended Posts

Where Big here / وين الخطاء هنا

-- Client Side 
GridList = guiCreateGridList(9, 20, 183, 248, false, Window) 
guiGridListAddColumn(GridList, "vehicle", 0.5) 
guiGridListAddColumn(GridList, "$ money", 0.5) 
  
Vehilce = { 
    { "v1",30000}, 
    { "V2",50000}, 
} 
  
for i, v in ipairs ( Vehilce ) do 
    row = guiGridListAddRow(GridList) 
    guiGridListSetItemText ( GridList, row, 1, v [ 1 ], false, false ) 
    guiGridListSetItemText ( GridList, row, 2, v [ 2 ], false, false ) 
end 
  
function onUp ( ) 
    guiGridListSetItemColor(GridList, row, 2, 0, 255, 0, 0) 
end 
  
addEvent( "onUpMoney", true ) 
addEventHandler( "onUpMoney", localPlayer, onUp ) 
  
function onDown ( ) 
    guiGridListSetItemColor(GridList, row, 2, 0, 255, 0, 255) 
end 
  
addEvent( "onDownMoney", true ) 
addEventHandler( "onDownMoney", localPlayer, onDown ) 

-- Server Side 
function GetAllMoney ( ) 
    local playername = getPlayerName ( source ) 
        if ( getPlayerMoney ( source ) >=30000 ) then 
        triggerClientEvent ( source,"onUpMoney",source ) 
    elseif ( getPlayerMoney ( source ) <=30000 ) then 
        triggerClientEvent ( source,"onDownMoney",source ) 
    end 
end 

debugscript - side nothing / الديبوق سكربت مايقول شيء

edit / عدلته

المشكلة مايغير لون الرو بالقريد لسيت

Edited by Guest
Link to comment

#Client

GridList = guiCreateGridList ( 9, 20, 183, 248, false, Window ) 
guiGridListAddColumn ( GridList, "vehicle", 0.5 ) 
guiGridListAddColumn ( GridList, "$ money", 0.5 ) 
  
Vehilce = { 
  [ 1 ] = { "Savana", 30000 }, -- هنا حط اسم السياره + السعر 
  [ 2 ] = { "Bobcat", 50000 }, 
} 
  
for i,v in ipairs ( Vehilce ) do 
    Row = guiGridListAddRow ( GridList ) 
    guiGridListSetItemText ( GridList, Row, 1, v[ 1 ], false, false ) 
    guiGridListSetItemText ( GridList, Row, 2, "$"..v[ 2 ], false, false ) 
    guiGridListSetItemData ( GridList, Row, 1, v[2] ) 
end 
  
addEvent ( "onUpMoney", true ) 
addEventHandler ( "onUpMoney", root, function onUp(    ) 
    guiGridListSetItemColor ( GridList, Row, 2, 0, 255, 0, 0 ) 
end ) 
  
addEvent ( "onDownMoney", true ) 
addEventHandler ( "onDownMoney", root, function onDown(    ) 
    guiGridListSetItemColor ( GridList, Row, 2, 0, 255, 0, 255 ) 
end ) 

#Server

function (    ) 
    local PlayerMoney = getPlayerMoney ( source ) 
        if ( PlayerMoney ( source ) >= 30000 ) then 
        triggerClientEvent ( source ,"onUpMoney", source ) 
    elseif ( PlayerMoney ( source ) <= 30000 ) then 
        triggerClientEvent ( source ,"onDownMoney", source ) 
    end 
end 

debugscript 3 < جرب كذا واذا فيه اي مشكله شف الديبوق وش يقول

وعطني خبر ^

Edited by Guest
Link to comment
:oops: سويت الي قلته وماصار شيء

والله مادري شف المشكله الي قلت لك عنها حاول فيها لان مصدر المشكله هناك

وبسألك سؤال اكوادك الي طرحتها بالموضوع فوق كانت تشتغل بشكل صحيح بس الروات ماتتلون ؟

Link to comment

الي ابي اسويه ان اذا فلوس الاعب + اكثر من 30 الف يصير لون الروات الي في عمود اخضر

واذا اقل من 30 الف يصير لون الروات الي في عمود احمر

نص الاكواد ماخذها من سكربت قديم لقيته وقليت نفس الفكره لكن قلت اطورها

Link to comment

ما يحتاج ملف سيرفر اصلا

بس لو تخليه يساوي لوب لما تفتح له الوحه عشين يجدد الاوان

GridList = guiCreateGridList ( 9, 20, 183, 248, false, Window ) 
guiGridListAddColumn ( GridList, "vehicle", 0.5 ) 
guiGridListAddColumn ( GridList, "$ money", 0.5 ) 
  
Vehilce = { 
  [ 1 ] = { "Savana", 30000 }, -- هنا حط اسم السياره + السعر 
  [ 2 ] = { "Bobcat", 50000 }, 
} 
  
for i,v in ipairs ( Vehilce ) do 
    Row = guiGridListAddRow ( GridList ) 
    guiGridListSetItemText ( GridList, Row, 1, v[ 1 ], false, false ) 
    guiGridListSetItemText ( GridList, Row, 2, "$"..v[ 2 ], false, false ) 
    guiGridListSetItemData ( GridList, Row, 1, v[2] ) 
    if getPlayerMoney() >= 30000  ) then 
        guiGridListSetItemColor ( GridList, Row, 2, 0, 255, 0 ) 
    else 
        guiGridListSetItemColor ( GridList, Row, 2, 255, 0, 0 ) 
    end 
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...