z24d Posted November 2, 2015 Share Posted November 2, 2015 for ia,xMonsterlist in ipairs(xMonsterUpgrades) do rows = guiGridListAddRow(itemGridlist) guiGridListSetItemData(itemGridlist,rows,1,xMonsterlist[1],false,false) guiGridListSetItemText(itemGridlist,rows,1,xMonsterlist[2],false,false) end addEventHandler("onClientGUIClick",root, function() wawd = guiGridListGetSelectedItem(itemGridlist) if source == btnItemsz then if wawd ~= -1 then dsad = guiGridListGetItemData(itemGridlist,wawd,1) triggerServerEvent("changeWheels",localPlayer,dsad) end end end ) سيرفر addEvent("changeWheels",true) addEventHandler("changeWheels",root, function (dsad) if isElement(veh[source]) then addVehicleUpgrade(veh[source],dsad) outputChatBox("[VIP System] Your Vehicle has succesfuly Upgraded.",source,0,255,0) else outputChatBox("[VIP System] You dont have vehicle.",source,255,0,0) end end ) -- Link to comment
z24d Posted November 2, 2015 Author Share Posted November 2, 2015 وش المشكلة بالكود اي احد يرد | Link to comment
Rockyz Posted November 2, 2015 Share Posted November 2, 2015 -- Client Side # for i, v in ipairs ( xMonsterUpgrades ) do rows = guiGridListAddRow ( itemGridlist ) guiGridListSetItemText ( itemGridlist, rows, 1, v[1], false, false ) guiGridListSetItemData ( itemGridlist, rows, 1, v[2] ) end addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == btnItemsz ) then if ( guiGridListGetSelectedItem ( itemGridlist ) ~= -1 ) then local Seel = guiGridListGetItemData ( itemGridlist, guiGridListGetSelectedItem ( itemGridlist ), 1 ) triggerServerEvent ( "changeWheels", localPlayer, Seel ) end end end ) -- Server Side # veh = { } addEvent( "changeWheels", true ) addEventHandler ( "changeWheels", root, function ( Seel ) if ( isElement ( veh [ source ] ) ) then destroyElement ( veh [ source ] ) end addVehicleUpgrade ( veh [ source ], Seel ) x, y, z = getElementPosition ( source ) veh [ source ] = createVehicle ( 400, x, y, z ) outputChatBox( "[VIP System] Your Vehicle has succesfuly Upgraded.", source, 0, 255, 0, true ) end ) Link to comment
Rockyz Posted November 2, 2015 Share Posted November 2, 2015 Client Side : -- Client Side # for i, v in ipairs ( xMonsterUpgrades ) do rows = guiGridListAddRow ( itemGridlist ) guiGridListSetItemText ( itemGridlist, rows, 1, v[1], false, false ) guiGridListSetItemData ( itemGridlist, rows, 1, v[2] ) end addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == btnItemsz ) then if ( guiGridListGetSelectedItem ( itemGridlist ) ~= -1 ) then local Seel = guiGridListGetItemData ( itemGridlist, guiGridListGetSelectedItem ( itemGridlist ), 1 ) triggerServerEvent ( "changeWheels", localPlayer, Seel ) end end end ) Server Side : -- Server Side # veh = { } addEvent( "changeWheels", true ) addEventHandler ( "changeWheels", root, function ( Seel ) if ( isPedInVehicle ( source ) ) then local getVh = getPedOccupiedVehicle ( soure ) local setVh = addVehicleUpgrade ( getVh, Seel ) if ( ( getVh ) and ( setVh ) ) then outputChatBox ( "[VIP System] Your Vehicle has succesfuly Upgraded.", source, 0, 255, 0, true ) else outputChatBox ( "[VIP System] Failed", source, 0, 255, 0, true ) end outputChatBox ( "[VIP System] You dont have a vehicle.", source, 255, 0, 0, true ) 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