+Source|> Posted August 17, 2017 Share Posted August 17, 2017 ما يشتغل --server addEvent("weapon", true) addEventHandler("weapon", root, function( action, ID, ammo ) if ( action == "wpp" ) then if tonumber( getPlayerMoney ( source ) ) >= tonumber( mm ) then takePlayerMoney( source, tonumber ( mm ) ) giveWeapon( source, ID, ammo, true ) else outputChatBox( " #2B60DE# [ JIZ Shop ] #ff0000 أنت لا تملك مـآل كـافي ", source, 0, 0, 0, true ) end end end ) local wep = { -- { Weapon / ID / Ammo / Money } -- {"M4", "31", "1000", 11}, {"Minigun", "38", "1000", 11}, } function refreesh () guiGridListClear( wpgrd ) for i, v in ipairs ( wep ) do local rowwp = guiGridListAddRow( wpgrd ) guiGridListSetItemText( wpgrd, rowwp, 1, tostring( v[1] ), false, false ) guiGridListSetItemData( wpgrd, rowwp, 1,{ ID = v[2], ammo = v[3], mm = v[4] } ) end end addEventHandler("onClientGUIClick", wshroot, function() local ss = guiGridListGetSelectedItem( wpgrd ) local tt = guiGridListGetItemText( wpgrd, ss, 1 ) local dd = guiGridListGetItemData( wpgrd, ss, 1 ) local nn = guiGridListGetItemText( wpgrd, guiGridListGetSelectedItem ( wpgrd ), 1 ) if ( source == GUIEditor.button[1] ) then if ( ss ~= -1 ) then triggerServerEvent ( "weapon" , localPlayer , localPlayer, "wpp", ss, dd, mm ) else outputChatBox( " #2B60DE# [ JIZ Shop ] #ff0000 الرجاء اختيار سلاح لشرآئه ", 0, 0, 0, true ) end end end ) Link to comment
Omoi Posted August 17, 2017 Share Posted August 17, 2017 32 minutes ago, A7MEDENO said: ما يشتغل --server addEvent("weapon", true) addEventHandler("weapon", root, function( action, ID, ammo ) if ( action == "wpp" ) then if tonumber( getPlayerMoney ( source ) ) >= tonumber( mm ) then takePlayerMoney( source, tonumber ( mm ) ) giveWeapon( source, ID, ammo, true ) else outputChatBox( " #2B60DE# [ JIZ Shop ] #ff0000 أنت لا تملك مـآل كـافي ", source, 0, 0, 0, true ) end end end ) local wep = { -- { Weapon / ID / Ammo / Money } -- {"M4", "31", "1000", 11}, {"Minigun", "38", "1000", 11}, } function refreesh () guiGridListClear( wpgrd ) for i, v in ipairs ( wep ) do local rowwp = guiGridListAddRow( wpgrd ) guiGridListSetItemText( wpgrd, rowwp, 1, tostring( v[1] ), false, false ) guiGridListSetItemData( wpgrd, rowwp, 1,{ ID = v[2], ammo = v[3], mm = v[4] } ) end end addEventHandler("onClientGUIClick", wshroot, function() local ss = guiGridListGetSelectedItem( wpgrd ) local tt = guiGridListGetItemText( wpgrd, ss, 1 ) local dd = guiGridListGetItemData( wpgrd, ss, 1 ) local nn = guiGridListGetItemText( wpgrd, guiGridListGetSelectedItem ( wpgrd ), 1 ) if ( source == GUIEditor.button[1] ) then if ( ss ~= -1 ) then triggerServerEvent ( "weapon" , localPlayer , localPlayer, "wpp", ss, dd, mm ) else outputChatBox( " #2B60DE# [ JIZ Shop ] #ff0000 الرجاء اختيار سلاح لشرآئه ", 0, 0, 0, true ) end end end ) اخوي لما تحط مشكله , اشرح وش المشكله بالضبط عشان نساعدك بها Link to comment
+Source|> Posted August 17, 2017 Author Share Posted August 17, 2017 9 minutes ago, Omoi said: اخوي لما تحط مشكله , اشرح وش المشكله بالضبط عشان نساعدك بها لما احدد عالسلاح واضغط شراء ما يصير شي Link to comment
|M.r|LooFe| Posted August 17, 2017 Share Posted August 17, 2017 25 minutes ago, A7MEDENO said: لما احدد عالسلاح واضغط شراء ما يصير شي الديبق ؟ Link to comment
' A F . Posted August 17, 2017 Share Posted August 17, 2017 (edited) local wep = { -- { Weapon / ID / Ammo / Money } -- {"M4", "31", "1000", 11}, {"Minigun", "38", "1000", 11}, } function refreesh () guiGridListClear( wpgrd ) for i, v in ipairs ( wep ) do local rowwp = guiGridListAddRow( wpgrd ) guiGridListSetItemText( wpgrd, rowwp, 1, tostring( v[1] ), false, false ) guiGridListSetItemData( wpgrd, rowwp, 1,{ ID = v[2], ammo = v[3], mm = v[4] } ) end end addEventHandler("onClientGUIClick", root, function() if ( source == GUIEditor.button[1] ) then local ss = guiGridListGetSelectedItem( wpgrd ) if ( ss ~= -1 ) then local tt = guiGridListGetItemText( wpgrd, ss, 1 ) local dd = guiGridListGetItemData( wpgrd, ss, 1 ) triggerServerEvent ( "weapon" , localPlayer , "wpp", dd ) else outputChatBox( " #2B60DE# [ JIZ Shop ] #ff0000 الرجاء اختيار سلاح لشرآئه ", 0, 0, 0, true ) end end end ) ; --- Server addEvent("weapon", true) addEventHandler("weapon", root, function( action , data ) if ( action == "wpp" ) then if tonumber( getPlayerMoney ( source ) ) >= tonumber( data['mm'] ) then takePlayerMoney( source, tonumber ( data['mm'] ) ) giveWeapon( source, data['ID'], data['ammo'], true ) else outputChatBox( " #2B60DE# [ JIZ Shop ] #ff0000 أنت لا تملك مـآل كـافي ", source, 0, 0, 0, true ) end end end ) Edited August 17, 2017 by Default Link to comment
+Source|> Posted August 17, 2017 Author Share Posted August 17, 2017 4 hours ago, Default said: local wep = { -- { Weapon / ID / Ammo / Money } -- {"M4", "31", "1000", 11}, {"Minigun", "38", "1000", 11}, } function refreesh () guiGridListClear( wpgrd ) for i, v in ipairs ( wep ) do local rowwp = guiGridListAddRow( wpgrd ) guiGridListSetItemText( wpgrd, rowwp, 1, tostring( v[1] ), false, false ) guiGridListSetItemData( wpgrd, rowwp, 1,{ ID = v[2], ammo = v[3], mm = v[4] } ) end end addEventHandler("onClientGUIClick", root, function() if ( source == GUIEditor.button[1] ) then local ss = guiGridListGetSelectedItem( wpgrd ) if ( ss ~= -1 ) then local tt = guiGridListGetItemText( wpgrd, ss, 1 ) local dd = guiGridListGetItemData( wpgrd, ss, 1 ) triggerServerEvent ( "weapon" , localPlayer , "wpp", dd ) else outputChatBox( " #2B60DE# [ JIZ Shop ] #ff0000 الرجاء اختيار سلاح لشرآئه ", 0, 0, 0, true ) end end end ) ; --- Server addEvent("weapon", true) addEventHandler("weapon", root, function( action , data ) if ( action == "wpp" ) then if tonumber( getPlayerMoney ( source ) ) >= tonumber( data['mm'] ) then takePlayerMoney( source, tonumber ( data['mm'] ) ) giveWeapon( source, data['ID'], data['ammo'], true ) else outputChatBox( " #2B60DE# [ JIZ Shop ] #ff0000 أنت لا تملك مـآل كـافي ", source, 0, 0, 0, true ) end end end ) شكرا اشتغل 4 hours ago, Default said: local wep = { -- { Weapon / ID / Ammo / Money } -- {"M4", "31", "1000", 11}, {"Minigun", "38", "1000", 11}, } function refreesh () guiGridListClear( wpgrd ) for i, v in ipairs ( wep ) do local rowwp = guiGridListAddRow( wpgrd ) guiGridListSetItemText( wpgrd, rowwp, 1, tostring( v[1] ), false, false ) guiGridListSetItemData( wpgrd, rowwp, 1,{ ID = v[2], ammo = v[3], mm = v[4] } ) end end addEventHandler("onClientGUIClick", root, function() if ( source == GUIEditor.button[1] ) then local ss = guiGridListGetSelectedItem( wpgrd ) if ( ss ~= -1 ) then local tt = guiGridListGetItemText( wpgrd, ss, 1 ) local dd = guiGridListGetItemData( wpgrd, ss, 1 ) triggerServerEvent ( "weapon" , localPlayer , "wpp", dd ) else outputChatBox( " #2B60DE# [ JIZ Shop ] #ff0000 الرجاء اختيار سلاح لشرآئه ", 0, 0, 0, true ) end end end ) ; --- Server addEvent("weapon", true) addEventHandler("weapon", root, function( action , data ) if ( action == "wpp" ) then if tonumber( getPlayerMoney ( source ) ) >= tonumber( data['mm'] ) then takePlayerMoney( source, tonumber ( data['mm'] ) ) giveWeapon( source, data['ID'], data['ammo'], true ) else outputChatBox( " #2B60DE# [ JIZ Shop ] #ff0000 أنت لا تملك مـآل كـافي ", source, 0, 0, 0, true ) end end end ) ممكن طلب اخر if ( getPedWeapon( source ) == data['ID'] ) then outputChatBox( " لديك هذا السلاح بالفعل ", source, 0, 0, 0, true ) return end ما اشتغلت Link to comment
' A F . Posted August 18, 2017 Share Posted August 18, 2017 function getPedWeapons(ped) local playerWeapons = {} if ped and isElement(ped) and getElementType(ped) == "ped" or getElementType(ped) == "player" then for i=2,9 do local wep = getPedWeapon(ped,i) if wep and wep ~= 0 then table.insert(playerWeapons,wep) end end else return false end return playerWeapons end سوي لوب قبل لايشتري اللاعب السلآح وتحقق ان الايدي ماهو موجود بالجدول حآول وبنسآعدك . 1 Link to comment
+Source|> Posted August 18, 2017 Author Share Posted August 18, 2017 function wepons () for i, v in ipairs ( getElementsByType('player')) do local we = getPedWeapon( v ) if we == data['ID'] then return end end end شكلي جبت العيد صح Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now