-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
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 )
-
Anything on the debugscript?
-
Yes, you can use: setTimer
-
"woltlab" is a resource?
-
Are you talking about a vehicle element or a vehicle model? if it's an element, then you can use: getVehicleOccupants
-
Yes, but table.remove needs the index of the item you want to remove.
-
Well, if you are going to use that table format, then you must loop the table to remove the other upgrade.
-
Change 'source' to 'localPlayer'.
-
Well, you can do something like this: local myTable = { } myTable [ 1 ] = 1010 Or you can use table.insert: table.insert ( myTable, 1010 )
-
local myTable = {} local myTable = 1010 You are overwritting the 'myTable' variable with a number.
-
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
-
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
-
Remember that account data got a string limit, means that it can end cutting your JSON string.
-
Same problem occurs with scroll panes.
-
It must be something related to images, I tried too and it doesn't work.
-
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 )
-
You can use getDistanceBetweenPoints3D
-
Well, yes, but that's not a really good solution. All you had to do is this: if ( getTeamName ( police ) == "Police" ) then
-
getPlayerTeam returns a team element, you must get the team name using getTeamName.
