Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. local military = { [ 520 ] = true, [ 425 ] = true, [ 447 ] = true } local teams = { [ "Military" ] = true, [ "AirForce" ] = true, [ "MARSOC" ] = true } function pAccess ( thePlayer, seat ) if ( military [ getElementModel ( source ) ] and not teams [ getTeamName ( getPlayerTeam ( thePlayer ) ) ] and seat == 0 ) then cancelEvent ( ) outputChatBox ( "you are not part of the Military", thePlayer ) end end addEventHandler ( "onVehicleStartEnter", root, pAccess )
  2. Anything on the debugscript?
  3. "woltlab" is a resource?
  4. Castillo

    Get players

    Are you talking about a vehicle element or a vehicle model? if it's an element, then you can use: getVehicleOccupants
  5. Castillo

    tables

    Yes, but table.remove needs the index of the item you want to remove.
  6. Castillo

    tables

    Well, if you are going to use that table format, then you must loop the table to remove the other upgrade.
  7. Change 'source' to 'localPlayer'.
  8. Castillo

    tables

    Well, you can do something like this: local myTable = { } myTable [ 1 ] = 1010 Or you can use table.insert: table.insert ( myTable, 1010 )
  9. Castillo

    tables

    local myTable = {} local myTable = 1010 You are overwritting the 'myTable' variable with a number.
  10. That's because the function has few errors, you could have spotted them if you used the debugscript. function populateGridList ( ) local file = xmlLoadFile ( "vehs.xml" ) if ( not file ) then assert ( file, "Fail to load vehs.xml" ) else local children = xmlNodeGetChildren ( file ) for _,child in ipairs ( children ) do if ( string.lower ( xmlNodeGetName ( child ) ) == "item" ) then local attrs = xmlNodeGetAttributes ( child ) local Name, Price, ID = attrs.Name, attrs.Price, attrs.ID if ( not Name ) then outputDebugString ( "name attribute not set for item", 2 ) end if ( not Price ) then outputDebugString ( "cash attribute not set for item", 2 ) end if ( not ID ) then outputDebugString ( "score attribute not set for item", 2 ) end local itemRow = guiGridListAddRow ( gridlistVehicleShop ) guiGridListSetItemText ( gridlistVehicleShop, itemRow, Name, Name, false, false ) guiGridListSetItemText ( gridlistVehicleShop, itemRow, Price, Price, false, true ) guiGridListSetItemText ( gridlistVehicleShop, itemRow, ID, ID, false, true ) end end xmlUnloadFile ( file ) end end
  11. local playheight = 2 local players = getElementsByType ( "player" ) local playas = 0 for amt, player in pairs(players) do playas = playas + 1 if (playas <= 20) then local ping = getPlayerPing(player) if (ping >= 250) then r,g,b = 200,20,25 elseif (ping >= 120) then r,g,b = 255,149,4 else r,g,b = 50,200,50 end dxDrawText(getPlayerName ( player ), (screenW- 2)/3.15,(screenH + 12)+ playheight, screenW/2,screenH/4, tocolor(255,255,255), 1 , "default","center", "center",false, false,true,true) playheight = ( playheight + 5 ) end end
  12. Castillo

    tables

    Remember that account data got a string limit, means that it can end cutting your JSON string.
  13. Same problem occurs with scroll panes.
  14. It must be something related to images, I tried too and it doesn't work.
  15. Castillo

    Problem

    addEvent ( "onClientPlayerOpenGroupsList", true ) addEventHandler ( "onClientPlayerOpenGroupsList", root, function ( groups, members ) guiSetVisible ( GUIGroup.window[1], true ) guiBringToFront ( GUIGroup.window[1] ) guiGridListClear ( GUIGroup.gridlist[1] ) local memberCount = { } for _, member in ipairs ( members ) do if ( not memberCount [ member.groupName ] ) then memberCount [ member.groupName ] = 0 end memberCount [ member.groupName ] = ( memberCount [ member.groupName ] + 1 ) end for _, group in ipairs ( groups ) do local groupName = ( group [ "groupName" ] or "N/A" ) local count = ( memberCount [ groupName ] or "N/A" ) local row = guiGridListAddRow ( GUIGroup.gridlist[1] ) guiGridListSetItemText ( GUIGroup.gridlist[1], row, 1, tostring ( groupName ), false, false ) guiGridListSetItemText ( GUIGroup.gridlist[1], row, 2, tostring ( count ), false, false ) end end )
  16. Castillo

    Problem

    Post the column names from "groupMembers" table.
  17. You can use getDistanceBetweenPoints3D
  18. Well, yes, but that's not a really good solution. All you had to do is this: if ( getTeamName ( police ) == "Police" ) then
  19. getPlayerTeam returns a team element, you must get the team name using getTeamName.
×
×
  • Create New...