Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. You can get the amount of players with this too: #getElementsByType ( "player" ) Should work as good as getPlayerCount, but also client side.
  2. Team = createTeam("Taxi Driver", 0, 255, 0) busTeams = { [Team] = true } busVehs = { [420] = true } function enterVehicle ( thePlayer, seat, jacked ) -- when a player enters a vehicle if getElementType ( thePlayer ) == "player" then if ( busVehs[getElementModel ( source )] ) and ( not busTeams[getPlayerTeam( thePlayer )] ) then -- if the vehicle is one of 4 police cars, and the skin is not a police skin removePedFromVehicle( thePlayer )-- force the player out of the vehicle outputChatBox("Only Taxi Drivers can drive this vehicle!", thePlayer) end end end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle ) markers = { } blips = { } peds = { } function inVEH ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then if ( getElementModel ( source ) == 420 ) then local x, y, z = unpack ( dropoffs [ math.random ( #dropoffs ) ] ) markers [ thePlayer ] = createMarker ( x, y, z, "cylinder", 3.5, 255, 0, 0 ) local skins = unpack ( pedCus [ math.random ( #pedCus ) ] ) peds [ thePlayer ] = createPed( skins, x, y, z ) blips [ thePlayer ] = createBlipAttachedTo ( markers [ thePlayer ], 41 ) addEventHandler ( "onMarkerHit", markers [ thePlayer ], warpit ) end else if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) end if ( isElement ( blips [ thePlayer ] ) ) then destroyElement( blips [ thePlayer ] ) end end end addEventHandler ( "onVehicleEnter", getRootElement(), inVEH ) function warpit ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then local vehicle = getPedOccupiedVehicle ( thePlayer ) if ( getElementModel ( vehicle ) == 420 ) then warpPedIntoVehicle ( peds [ thePlayer ], vehicle, 2 ) pickMeUp ( thePlayer ) end end end function pickMeUp ( thePlayer ) if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) end if ( isElement ( blips [ thePlayer ] ) ) then destroyElement( blips [ thePlayer ] ) end end
  3. function buyCar(thePlayer) triggerServerEvent ( "buyVeh", getLocalPlayer(), "greetingHandler" ) end end ) Remove that ")" after the last "end".
  4. I told you on my first post, check if the element that entered the vehicle is a player. getElementType
  5. You are saying that a random marker is generated again because the ped enters the vehicle, that's what I got at least.
  6. Check the element type of "thePlayer" at "inVEH" function.
  7. You can't set the team of a ped. You can make a check when something enters the vehicle, if the type of element is a player, then remove him. Use: getElementType
  8. Si, pero ese evento es server side. @Plate: 'source' no esta definido, tenias que usar 'thePlayer'. function godmode ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "Admin" ) ) then exports.extra_health:setElementInvulnerable ( thePlayer, not exports.extra_health:isElementInvulnerable ( thePlayer ) ) end end addCommandHandler ( "godmode", godmode )
  9. Castillo

    GATE!

    Well, we don't accept requests here, so you either learn to do it by your own or pay someone to do it for you. Here's a list of functions required to do this: createObject/getElementByID addCommandHandler getPlayerTeam getTeamName moveObject
  10. "onPlayerDamage" no se puede cancelar ( como dice en la pagina de la wiki ).
  11. Is an script error. The function was expecting a string, but got a boolean instead.
  12. Castillo

    Question

    On a lua table? if so, I'm not sure if there's a limit.
  13. Use: getPlayerAccount getAccountName isObjectInACLGroup
  14. Well, to make such script you need only some functions & basic lua knowledge: bindKey getElementsByType getPedOccupiedVehicle setElementDimension
  15. Castillo

    Object speed

    Yes, that's right, the lower the number, the faster it'll move. You're welcome.
  16. You should start from scratch, it would be easier.
  17. No, that element data is required to store the random animation when the zombie spawns.
  18. I really don't understand why did you had to make the code for him at all, is not as helpful as letting him try to do it.
  19. Castillo

    Object speed

    setElementVelocity isn't for this. The second argument of moveObject is the speed, in this case "971".
  20. Castillo

    Maletero

    Podes usar XML, SQLite, MySQL. Si no necesitas conectarte externamente, te recomiendo SQLite.
  21. Castillo

    Maletero

    Vas a necesitar experiencia en MySQL o SQLite.
  22. I'm not sure, but slothbots and zombies aren't meant to work together if I'm right.
×
×
  • Create New...