Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    Money...

    What problem? money problem?
  2. local vehicle = getPedOccupiedVehicle ( localPlayer ) if ( vehicle ) then local vehicleName = getVehicleName ( vehicle ) local vehicleModel = getElementModel ( vehicle ) guiSetText ( veh, 'Vehicle: '.. vehicleName .. ' (( '.. vehicleModel ..' )) ' ) end function updateLabel ( thePlayer ) if ( thePlayer == localPlayer ) then local vehicleName = getVehicleName ( source ) local vehicleModel = getElementModel ( source ) guiSetText ( veh, 'Vehicle: '.. vehicleName .. ' (( '.. vehicleModel ..' )) ' ) end end addEventHandler ( "onClientVehicleEnter", root, updateLabel ) addEventHandler ( "onClientVehicleExit", root, updateLabel )
  3. weap = guiCreateLabel( 0.2, 0.2, 0.1, 0.1, 'Weapon: ', true ) setTimer ( function ( ) local weaponType = getPedWeapon ( localPlayer ) if ( weaponType ) then guiSetText ( weap, 'Weapon: '.. getWeaponNameFromID ( weaponType ) ) end end ,50, 0 )
  4. getPedWeapon getWeaponNameFromID
  5. Castillo

    Zone help

    function zonename ( ) local x, y, z = getElementPosition ( localPlayer ) zone = guiCreateLabel ( 0.305, 0.005, 0.2, 0.05, "Zone: ".. getZoneName( x, y, z, true ), true ) setTimer ( function ( ) local x, y, z = getElementPosition ( localPlayer ) guiSetText ( zone, "Zone: ".. getZoneName( x, y, z, true ) ) end ,1000, 0 ) end addEventHandler ( 'onClientResourceStart', resourceRoot, zonename ) That'll update it every second.
  6. Castillo

    Help

    Meaning findPlayer did not found that player.
  7. Try this: for i,v in pairs ( Gridlists ) do local column = guiGridListAddColumn ( v, "Column", 85 ) for k, c in ipairs ( Texts ) do local row = guiGridListAddRow ( v ) guiGridListSetItemText ( v, row, column, c, false, false ) end end
  8. Castillo

    Help

    What returns false?
  9. Try this: function handling ( ) if ( getElementModel ( source ) == 541 ) then setVehicleHandling ( source, "handlingFlags", 0x284020 ) end end addEventHandler ( "onVehicleEnter", getRootElement(), handling )
  10. Castillo

    Help

    function findPlayer(name, player) if name == "*" and getElementType(player) == "player" then return player else local matches = {} for i,v in ipairs(getElementsByType("player")) do if getPlayerName(v) == name and not isGuestAccount ( getPlayerAccount ( v ) ) then return v end local playerName = getPlayerName(v):gsub("#%x%x%x%x%x%x", "") playerName = playerName:lower() if playerName:find(name:lower(), 0) and not isGuestAccount ( getPlayerAccount ( v ) ) then table.insert(matches, v) end end if #matches == 1 then return matches[1] end return false end end addEvent("onClientPlayerSerialRequested", true) addEventHandler("onClientPlayerSerialRequested", root, function(player, row) local target = findPlayer(player, source) if target then triggerClientEvent(source, "onClientPlayerSerialFetched", source, getPlayerSerial(getPlayerFromName(target)), row) else outputChatBox("DEBUG: 'onClientPlayerSerialRequested' returned false.", source, 245, 40, 40, false) end end )
  11. Castillo

    Help

    Why are you using a function that does not exist?
  12. Well, he can use this as well: addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, vehicle in ipairs ( getElementsByType ( "vehicle" ) ) do local model = getElementModel ( vehicle ) if ( model == 411 ) or ( model == 495 ) then setVehicleDamageProof ( vehicle, true ) end end end )
  13. I don't really understand you correctly, that's why I'll ask you if you want this: You have a table with texts, and you want to insert all these texts in your grid list, but what is the 1 to 15 for-loop doing there?
  14. Castillo

    Help

    Means you don't have the function: "isLogged" defined anywhere.
  15. That's what he wants if I read correctly.
  16. function setsalud4 ( ) local PlayerMoney = getPlayerMoney ( source ) if ( PlayerMoney >= 5000) then setElementHealth ( source, 500 ) setPedStat ( source, 22, 999 ) setPedStat ( source, 23, 999 ) setPedStat ( source, 24, 999 ) setPedStat ( source, 225, 999 ) --bucear takePlayerMoney ( source, 5000 ) outputChatBox ( "*Has comprado virus Génesis por $5000*", source, 255, 0, 0 ) outputChatBox ( "*El virus te da +salud, +fuerza, +resistencia +resistencia de buceo. Durante 1 sesión*", source, 255, 0, 0 ) setTimer ( function ( thePlayer ) if ( isElement ( thePlayer ) ) then setElementHealth ( thePlayer, getElementHealth ( thePlayer ) + 1 ) end end ,1000, 0, source ) else outputChatBox ( "*No tienes suficiente dinero*", source, 255, 0, 0, true ) end end addEvent ( "salud4", true ) addEventHandler ( "salud4", getRootElement(), setsalud4 )
  17. 1: onResourceStart has no player element. 2: getPedOccupiedVehicle returns the element userdata, not the vehicle model. addEventHandler ( "onVehicleEnter", root, function ( thePlayer ) local model = getElementModel ( source ) if ( model == 411 ) or ( model == 495 ) then setVehicleDamageProof ( source, true ) else setVehicleDamageProof ( source, false ) end setPlayerBlurLevel ( thePlayer, 0 ) end )
×
×
  • Create New...