Jump to content

2 Questions/Problems HELP PLEASE !


Recommended Posts

1.When i set my team to police or another team by the admin panel it change my team for few seconds then i back without team .

2.Need help with Create Vehicle when player hitmarker

function policecarsmarkeronStartup () 
    policecarsChangeMarker = createMarker (1567.0947265625, -1607.6402587891, 13.3828125, "cylinder", 1.5, 0, 0, 0, 255, getRootElement()) 
    setElementInterior (policecarsChangeMarker, 0) 
end 
addEventHandler("onResourceStart", getRootElement(), policecarsmarkeronStartup) 
function policecarsmarker (hitPlayer, matchingDimension) 
    if (source == policecarsChangeMarker) then 
        outputChatBox ("Press 1,2,3,4 to select a Police car from 4 cars", hitPlayer, 255, 0, 0, false) 
        outputChatBox ("And press 'enter' when you find a good one", hitPlayer, 255, 0, 0, false) 
        toggleAllControls (hitPlayer, false, true, false) 
        bindKey (hitPlayer, "1", "down", policecarsChangeMarkerBindKeys) 
        bindKey (hitPlayer, "2", "down", policecarsChangeMarkerBindKeys) 
        bindKey (hitPlayer, "3", "down", policecarsChangeMarkerBindKeys) 
        bindKey (hitPlayer, "4", "down", policecarsChangeMarkerBindKeys) 
        bindKey (hitPlayer, "enter", "down", policecarsChangeMarkerBindKeys)    
    end 
end      
addEventHandler("onMarkerHit", getRootElement(), policecarsmarker) 
  
function policecarsChangeMarkerBindKeys (vehicle, key, keystate) 
    if (key == "1") and (keystate == "down") then    
        local vehicle = createVehicle (vehicle) 
        createVehicle (vehicle, 60000) 
    end 
    if (key == "2") and (keystate == "down") then    
        local vehicle = createVehicle (vehicle) 
        createVehicle (vehicle, 404) 
    end 
    if (key == "3") and (keystate == "down") then    
        local vehicle = createVehicle (vehicle) 
        createVehicle (vehicle, 505,65000) 
    end 
    if (key == "4") and (keystate == "down") then    
        local vehicle = createVehicle (vehicle) 
        createVehicle {442,45000} 
    end 
    if (key == "enter") and (keystate == "down") then 
        toggleAllControls (thePlayer, true, true, true) 
        unbindKey (thePlayer, "1", "down", policecarsChangeMarkerBindKeys) 
        unbindKey (thePlayer, "2", "down", policecarsChangeMarkerBindKeys) 
        unbindKey (thePlayer, "3", "down", policecarsChangeMarkerBindKeys) 
        unbindKey (thePlayer, "4", "down", policecarsChangeMarkerBindKeys) 
        unbindKey (thePlayer, "enter", "down", policecarsChangeMarkerBindKeys) 
    end 
end 

as you see here i wrote create vehicle and tried every thing .. but still not working.

3.4. When i die on LS i respawn on LS hospital but when i die in SF or LV i respawn in LS hospital !!

any one can help me ? or give me a link for hospital respawn ? ( i dont mean script one for me .. i mean if you know one please give me the link )

Sorry :D am new on scripting ( NOOB )

Link to comment

Seriously... what is this? do you even read what the wiki says? or you just copy & paste the function names and think it'll work? this is a mess, I'll try to fix your errors, but try to concentrate a bit more.

Here:

function policecarsmarkeronStartup () 
    policecarsChangeMarker = createMarker (1567.0947265625, -1607.6402587891, 13.3828125, "cylinder", 1.5, 0, 0, 0, 255, getRootElement()) 
    setElementInterior (policecarsChangeMarker, 0) 
end 
addEventHandler("onResourceStart", getRootElement(), policecarsmarkeronStartup) 
function policecarsmarker (hitPlayer, matchingDimension) 
    if (source == policecarsChangeMarker) then 
        outputChatBox ("Press 1,2,3,4 to select a Police car from 4 cars", hitPlayer, 255, 0, 0, false) 
        outputChatBox ("And press 'enter' when you find a good one", hitPlayer, 255, 0, 0, false) 
        toggleAllControls (hitPlayer, false, true, false) 
        bindKey (hitPlayer, "1", "down", policecarsChangeMarkerBindKeys) 
        bindKey (hitPlayer, "2", "down", policecarsChangeMarkerBindKeys) 
        bindKey (hitPlayer, "3", "down", policecarsChangeMarkerBindKeys) 
        bindKey (hitPlayer, "4", "down", policecarsChangeMarkerBindKeys) 
        bindKey (hitPlayer, "enter", "down", policecarsChangeMarkerBindKeys)   
    end 
end     
addEventHandler("onMarkerHit", getRootElement(), policecarsmarker) 
  
function policecarsChangeMarkerBindKeys (thePlayer, key, keystate) 
local x, y, z = getElementPosition(thePlayer) 
    if (key == "1") and (keystate == "down") then 
        local vehicle = createVehicle (404, x, y, z) 
    end 
    if (key == "2") and (keystate == "down") then    
        local vehicle = createVehicle (404, x, y, z) 
    end 
    if (key == "3") and (keystate == "down") then    
        local vehicle = createVehicle (505, x, y, z) 
    end 
    if (key == "4") and (keystate == "down") then    
        local vehicle = createVehicle (442, x, y, z) 
    end 
    if (key == "enter") and (keystate == "down") then 
        toggleAllControls (thePlayer, true, true, true) 
        unbindKey (thePlayer, "1", "down", policecarsChangeMarkerBindKeys) 
        unbindKey (thePlayer, "2", "down", policecarsChangeMarkerBindKeys) 
        unbindKey (thePlayer, "3", "down", policecarsChangeMarkerBindKeys) 
        unbindKey (thePlayer, "4", "down", policecarsChangeMarkerBindKeys) 
        unbindKey (thePlayer, "enter", "down", policecarsChangeMarkerBindKeys) 
    end 
end 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...