-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
You can get the amount of players with this too: #getElementsByType ( "player" ) Should work as good as getPlayerCount, but also client side.
-
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
-
function buyCar(thePlayer) triggerServerEvent ( "buyVeh", getLocalPlayer(), "greetingHandler" ) end end ) Remove that ")" after the last "end".
-
I told you on my first post, check if the element that entered the vehicle is a player. getElementType
-
You are saying that a random marker is generated again because the ped enters the vehicle, that's what I got at least.
-
Check the element type of "thePlayer" at "inVEH" function.
-
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
-
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 )
-
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
-
"onPlayerDamage" no se puede cancelar ( como dice en la pagina de la wiki ).
-
Is an script error. The function was expecting a string, but got a boolean instead.
-
Use: getPlayerAccount getAccountName isObjectInACLGroup
-
Well, to make such script you need only some functions & basic lua knowledge: bindKey getElementsByType getPedOccupiedVehicle setElementDimension
-
Yes, that's right, the lower the number, the faster it'll move. You're welcome.
-
You should start from scratch, it would be easier.
-
No, that element data is required to store the random animation when the zombie spawns.
-
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.
-
setElementVelocity isn't for this. The second argument of moveObject is the speed, in this case "971".
-
I'm not sure, but slothbots and zombies aren't meant to work together if I'm right.
