Jump to content

TheMtaUser555

Members
  • Posts

    35
  • Joined

  • Last visited

Everything posted by TheMtaUser555

  1. This is a mode, which a crook tries to escape the cops. What I can't get to work is the leaveMarker function. A cylinder is attached to the crook when it spawns(it's suposed to be invisible, I didn't add the alpha thing yet tho), when the crook gets far away from the cops( all the cops) and they leave the marker, after 10 secs a message should appear, like "escaped" or something. And another thing I wanted to do is when the crook gets surrounded by the cops(another marker attached to the crook, a smaller one), wich when a cop stays within the marker, for atleast 10 secs, a message should appear, like "busted". I would really appreciate your help! I just can't figure out what I'm suposed to do. ---this part works fine: policeVehicles = { [416]=true,[574]=true, [433]=true, [427]=true, [490]=true, [528]=true, [407]=true, [544]=true, [523]=true, [470]=true, [598]=true, [596]=true, [597]=true, [599]=true, [432]=true, [601]=true, [428]=true, [497]=true, [510]=true, [564]=true} function enterspawn (theVehicle, seat, jacked) local copVehicle = ( policeVehicles[getElementModel(theVehicle)] ) if not copVehicle then createBlipAttachedTo ( theVehicle, 55, 1 ) local name = getPlayerName ( source ) local r, g, b = getPlayerNametagColor ( source ) outputChatBox("***"..name.." is the crook***", getRootElement(), r, g, b, true ) local x, y, z = getElementPosition ( theVehicle ) local theMarker = createMarker ( x , y , z, "cylinder", 20, 255, 255, 0, 170 ) attachElements ( theMarker, theVehicle,0,0,0 ) else cancelEvent() end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), enterspawn ) ---here doesn't, I don't understand why, I tried: function MarkerLeave( leaveElement, matchingDimension ) if getElementType( leaveElement ) == "vehicle" and copVehicle then setTimer(MarkerLeave,10000,0, "escaped") else cancelEvent() end end addEventHandler( "onMarkerLeave",getRootElement(), MarkerLeave )function
  2. to CrystalMV thanks alot! it works the way I wanted to
  3. I want to display an image for all players when I type a certain command. My problem now is that I don't know how to mix client/server functions together to make it work.. This is client-side..It works client side wise, but of course it only shows the images to the player who typed the command. Please help me if you can! function showClientImage() myWindow = guiCreateStaticImage( 500, 50, 350, 150, "busted.png", false ) playSound ( "badboys.mp3") end addCommandHandler("busted", showClientImage) function changeVisibility ( ) if guiGetVisible ( mygui ) then guiSetVisible ( mygui, false ) else guiSetVisible ( mygui, true ) end end setTimer ( changeVisibility, 50, 0) function showClientImage2() mygui2 = guiCreateStaticImage( 500, 50, 350, 150, "escaped.png", false ) end addCommandHandler("escaped", showClientImage2) function changeVisibility2 ( ) if guiGetVisible ( mygui2 ) then guiSetVisible ( mygui2, false ) else guiSetVisible ( mygui2, true ) end end setTimer ( changeVisibility2, 50, 0)
  4. thanks JR10, but that's not what I wanted. What I want is to display a message on the chatbox when the crook drives far away from the cops. I don't understand what I'm doing wrong on my script
  5. policeVehicles = { [416]=true,[574]=true, [433]=true, [427]=true, [490]=true, [528]=true, [407]=true, [544]=true, [523]=true, [470]=true, [598]=true, [596]=true, [597]=true, [599]=true, [432]=true, [601]=true, [428]=true, [497]=true, [510]=true, [564]=true} x,y,z = getElementPosition( not policeVehicles[getElementModel(source)] ) function enterVehicle (loss) if ( not policeVehicles[getElementModel(source)] ) then blip = createBlipAttachedTo ( source, 55, 1 ) end if ( policeVehicles[getElementModel(source)] ) and (x+10, y+10, z+10, 0, 0, 0, getElementAttachedOffsets (x,y,z)) then outputChatBox ( "#FF0000Crook Escaped!", getRootElement(), 255, 255, 255, true ) end end addEventHandler ( "onVehicleDamage", getRootElement(), enterVehicle ) it's all serverside What I want to do is if a player inside a regular vehicle damages his vehicle and gets far away from a player inside a police vehicle, appears a message on the chatbox. log: [2011-09-09 14:19:00] SCRIPT ERROR: [scripts]\crookblip\crookblip.lua:8: ')' expected near ',' [2011-09-09 14:19:00] WARNING: Loading script failed: [scripts]\crookblip\crookblip.lua:8: ')' expected near ',' please help and thanks
  6. thanks for the help, it's working now.(serverside)
  7. I want the person that reaches the 5th cp to have his ghostmode disabled, not everyone..I'll will try serverside then but I don't think it's gonna work the way I want to tho
  8. -- client-side [code]addEvent("enableHover",true) addEventHandler("enableHover",root, function (enable) setWorldSpecialPropertyEnabled("hovercars",enable) for k,thePlayer in ipairs(getElementsByType('player')) do setElementData( thePlayer, "overrideCollide.uniqueblah", 255, false ) --i tried 'true', didn't work, i tried to set 255 to 0, still nothing and tried nil, nothing. outputChatBox ( "GhostMode Disabled!", getRootElement(), 255, 0, 0, true ) end end ) addEvent('onClientMapStarting', true) function GhostMode() for k,thePlayer in ipairs(getElementsByType('player')) do setElementData( thePlayer, "overrideCollide.uniqueblah", 0, true) end end addEventHandler('onClientMapStarting', getRootElement(), GhostMode) [/code] -- server-side [code]addEvent("onPlayerReachCheckpoint") addEventHandler("onPlayerReachCheckpoint",root, function (cp) if cp == 5 then triggerClientEvent(source,"enableHover",root,true) end end )[/code] The only thing that doesn't work is when I reach the 5th checkpoint, the ghostmode it's still on..and Id'like to disable it when the player reaches there, please help and thanks.
  9. SO here's the code policeVehicles = { [416]=true, [433]=true, [427]=true, [490]=true, [528]=true, [407]=true, [544]=true, [523]=true, [470]=true, [598]=true, [596]=true, [597]=true, [599]=true, [432]=true, [601]=true, [428]=true, [497]=true} function enterVehicle ( theVehicle, seat, jacked ) if ( not policeVehicles[getElementModel(source)] ) then blip = createBlipAttachedTo ( source, 55, 1 ) setBlipOrdering(blip, getBlipOrdering(blip) + 5) end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), enterVehicle ) Now the problem. it worked well with the older version of Race resource (https://community.multitheftauto.com/index.php?p=resources&s=details&id=35) but now for some reason it won't work with the latest one (the one included with the mta 1.0.5) When the Race starts, the player that doesn't have a cop car doesn't have a blip attached to him..And like I said before, it worked with the older version. I tried to use the funtion onPlayerSpawn, but it only worked when the player respawned.. I guess the new version doesn't "spawn" the player inside the vehicle? instead it teleports him inside the car? I'm confused..Please help and thanks!
×
×
  • Create New...