Jump to content

Взять координаты машины


Recommended Posts

...в которой сидит игрок в переменную

local doctorX, doctorY, doctorZ = getElementPosition ( player ) 
function onDoctorMode ( theVehicle, seat, jacked ) 
    if ( getElementModel ( theVehicle ) == 416 ) then -- доктормобиль 
        outputChatBox("Now You Are Doctor [+]", source, 255, 0, 0, true) 
        bindKey ( source, "lshift", "down", createFirstAid ) 
    end 
end 
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), onDoctorMode ) 
  
function offDoctorMode ( theVehicle, seat, jacked ) 
    if ( getElementModel ( theVehicle ) == 416 ) then -- доктормобиль 
        outputChatBox("Now You're not a doctor [x]", source, 91, 127, 0, true) 
        unbindKey ( source, "lshift", "down", createFirstAid ) 
    end 
end 
addEventHandler ( "onPlayerVehicleExit", getRootElement(), offDoctorMode ) 
  
function createFirstAid ( source ) 
firstAid = createPickup ( doctorX, doctorY, doctorZ, 0, 1240, 10000, 100 ) 
end 

Link to comment

7a0c04bb72c6.png

local theVehicle = getPedOccupiedVehicle ( thePlayer ) 
local doctorX, doctorY, doctorZ = getElementPosition ( theVehicle ) 
function onDoctorMode ( theVehicle, seat, jacked ) 
    if ( getElementModel ( theVehicle ) == 416 ) then -- доктормобиль 
        outputChatBox("Now You Are Doctor [+]", source, 255, 0, 0, true) 
        bindKey ( source, "lshift", "down", createFirstAid ) 
    end 
end 
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), onDoctorMode ) 
  
function offDoctorMode ( theVehicle, seat, jacked ) 
    if ( getElementModel ( theVehicle ) == 416 ) then -- доктормобиль 
        outputChatBox("Now You're not a doctor [x]", source, 91, 127, 0, true) 
        unbindKey ( source, "lshift", "down", createFirstAid ) 
    end 
end 
addEventHandler ( "onPlayerVehicleExit", getRootElement(), offDoctorMode ) 
  
function createFirstAid ( source ) 
firstAid = createPickup ( doctorX, doctorY, doctorZ, 0, 1240, 10000, 100 ) 
end 
  

Link to comment

я не знаю от куда ее брать, в других скриптах её тоже из воздуха берут

вот fstyle к примеру

function getPlayerFightStyle ( thePlayer, commandName ) 
  
        local playerstyle = getPedFightingStyle ( thePlayer )   -- store the fighting style in a variable 
        outputChatBox ( tostring(playerstyle), thePlayer )         -- output it to the player 
end 
addCommandHandler ( "style", getPlayerFightStyle ) 
  
function consoleSetFightingStyle ( thePlayer, commandName, id ) 
  
        if ( thePlayer and id ) then                                                 -- If player and ID are specified 
                local status = setPedFightingStyle ( thePlayer, tonumber(id) )    -- set the fighting style 
                if ( not status ) then                                               -- if that failed 
                        outputConsole ( "Failed to set fighting style.", thePlayer ) -- show a message 
                end 
        end 
end 
addCommandHandler ( "setstyle",  consoleSetFightingStyle ) 

Link to comment

Ладно придется искать всякие исходники в чужих скриптах

Сделал! Дебагскрипт не ругается, но всеравно пикап не создаётся

function initial(thePlayer) 
    docCar_x, docCar_y, docCar_z = getElementPosition(thePlayer) 
end 
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), initial ) 
  
function onDoctorMode ( theVehicle, seat, jacked ) 
    if ( getElementModel ( theVehicle ) == 416 ) then -- доктормобиль 
        outputChatBox("Now You Are Doctor [+]", source, 255, 0, 0, true) 
        bindKey ( source, "lshift", "down", createFirstAid ) 
    end 
end 
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), onDoctorMode ) 
  
function offDoctorMode ( theVehicle, seat, jacked ) 
    if ( getElementModel ( theVehicle ) == 416 ) then -- доктормобиль 
        outputChatBox("Now You're not a doctor [x]", source, 91, 127, 0, true) 
        unbindKey ( source, "lshift", "down", createFirstAid ) 
    end 
end 
addEventHandler ( "onPlayerVehicleExit", getRootElement(), offDoctorMode ) 
  
function createFirstAid (source) 
firstAid = createPickup ( docCar_x, docCar_y, docCar_z, 0, 1240, 10000, 100 ) 
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...