Jump to content

خطأ بالكود


z24d

Recommended Posts

    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

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

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

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