Jump to content

help


yMassai

Recommended Posts

local policeCars = { } -- We create a table. 
  
--Create Stuff 
function testCreateTrainStuff ( ) 
    test_marker_request = createMarker( 1543.98962, -1670.46398, 12.55753, "cylinder", 1.5, 255, 0, 0, 170) 
    createBlip ( 1543.98962, -1670.46398, 13.55753, 41) 
    ped = createPed (280,1543.98962,-1670.46398,13.55753, 90) 
    setElementFrozen ( ped, true ) 
end 
addEventHandler ( "onResourceStart", resourceRoot, testCreateTrainStuff ) 
addEventHandler ( "onClientPedDamage", ped, function ( ) cancelEvent ( ) end ) 
  
addEventHandler ( 'onMarkerHit', root, 
    function ( uElement ) 
        if source == myMarker then 
            local uTeam = getPlayerTeam ( uElement ) 
            if uTeam and getTeamName( uTeam ) == 'Policia' and getElementModel ( uElement ) == 280 then 
                outputChatBox 'TODO' 
            end 
        end 
    end 
) 
  
--Create Vehicle 
function testCreateTest ( ) 
    if ( isElement ( policeCars[ source ] ) ) then -- We check if the player already has a car spawned. 
        destroyElement ( policeCars[ source ] ) -- If so, we destroy it. 
    end 
    policeCars[ source ] = createVehicle ( 596, 1535.05615, -1675.60766, 13.56008 ) -- We create the vehicle stored in 'policeCars' table. 
    outputChatBox ("Você virou Policial", source, 255, 0, 0 ) 
end 
addEvent ( "testCreateTest", true ) 
addEventHandler ( "testCreateTest", root, testCreateTest ) 
  
--Test Gui 
function testCreateTestGUI ( hitElement ) 
    if ( source == test_marker_request ) then 
        triggerClientEvent ( hitElement, "testCreateTestGUI", hitElement ) 
    end 
end 
addEventHandler ( "onMarkerHit", root, testCreateTestGUI ) 

How do I get to get a team and a skin, I try but I can not.

Link to comment

maybe

local policeCars = { } -- We create a table. 
  
--Create Stuff 
function testCreateTrainStuff ( ) 
    test_marker_request = createMarker( 1543.98962, -1670.46398, 12.55753, "cylinder", 1.5, 255, 0, 0, 170) 
    createBlip ( 1543.98962, -1670.46398, 13.55753, 41) 
    ped = createPed (280,1543.98962,-1670.46398,13.55753, 90) 
    setElementFrozen ( ped, true ) 
end 
addEventHandler ( "onResourceStart", resourceRoot, testCreateTrainStuff ) 
addEventHandler ( "onClientPedDamage", ped, function ( ) cancelEvent ( ) end ) 
  
addEventHandler ( 'onMarkerHit', root,) 
  
function teamName ( source, key, uElement) 
            local playerTeam = getPlayerTeam ( source ) 
            if ( Policia ) then 
            local oldTeamName = getTeamName ( Policia ) 
        setTeamName ( Policia, uElement )  
else 
            local id = getElementModel ( uElement ) 
            if id == 280 then 
end 
  
--Create Vehicle 
function testCreateTest ( ) 
    if ( isElement ( policeCars[ source ] ) ) then -- We check if the player already has a car spawned. 
        destroyElement ( policeCars[ source ] ) -- If so, we destroy it. 
    end 
    policeCars[ source ] = createVehicle ( 596, 1535.05615, -1675.60766, 13.56008 ) -- We create the vehicle stored in 'policeCars' table. 
    outputChatBox ("Você virou Policial", source, 255, 0, 0 ) 
end 
addEvent ( "testCreateTest", true ) 
addEventHandler ( "testCreateTest", root, testCreateTest ) 
  
--Test Gui 
function testCreateTestGUI ( hitElement ) 
    if ( source == test_marker_request ) then 
        triggerClientEvent ( hitElement, "testCreateTestGUI", hitElement ) 
    end 
end 
addEventHandler ( "onMarkerHit", root, testCreateTestGUI ) 

Edited by Guest
Link to comment
local policeCars = { } -- We create a table. 
  
--Create Stuff 
function testCreateTrainStuff ( ) 
    test_marker_request = createMarker( 1543.98962, -1670.46398, 12.55753, "cylinder", 1.5, 255, 0, 0, 170 ) 
    createBlip ( 1543.98962, -1670.46398, 13.55753, 41 ) 
    ped = createPed (280,1543.98962,-1670.46398,13.55753, 90 ) 
    addEventHandler ( 'onMarkerHit', test_marker_request, teamName ) 
    setElementFrozen ( ped, true ) 
end 
addEventHandler ( "onResourceStart", resourceRoot, testCreateTrainStuff ) 
   
function teamName ( source, key, uElement) 
    local id = getElementModel ( source ) 
    if ( id == 280 ) then 
        -- Your code here. 
    end 
end 
  
--Create Vehicle 
function testCreateTest ( ) 
    if ( isElement ( policeCars[ source ] ) ) then -- We check if the player already has a car spawned. 
        destroyElement ( policeCars[ source ] ) -- If so, we destroy it. 
    end 
    policeCars[ source ] = createVehicle ( 596, 1535.05615, -1675.60766, 13.56008 ) -- We create the vehicle stored in 'policeCars' table. 
    outputChatBox ("Você virou Policial", source, 255, 0, 0 ) 
end 
addEvent ( "testCreateTest", true ) 
addEventHandler ( "testCreateTest", root, testCreateTest ) 
  
--Test Gui 
function testCreateTestGUI ( hitElement ) 
    if ( source == test_marker_request ) then 
        triggerClientEvent ( hitElement, "testCreateTestGUI", hitElement ) 
    end 
end 
addEventHandler ( "onMarkerHit", root, testCreateTestGUI ) 

Link to comment
local policeCars = { } -- We create a table. 
  
--Create Stuff 
function testCreateTrainStuff ( ) 
    test_marker_request = createMarker( 1543.98962, -1670.46398, 12.55753, "cylinder", 1.5, 255, 0, 0, 170 ) 
    createBlip ( 1543.98962, -1670.46398, 13.55753, 41 ) 
    ped = createPed (280,1543.98962,-1670.46398,13.55753, 90 ) 
    addEventHandler ( 'onMarkerHit', test_marker_request, onMarkerHit ) 
    setElementFrozen ( ped, true ) 
end 
addEventHandler ( "onResourceStart", resourceRoot, testCreateTrainStuff ) 
  
function onMarkerHit ( thePlayer ) 
    local id = getElementModel ( thePlayer ) 
    local teamName = getPlayerTeam ( thePlayer ) and getTeamName ( getPlayerTeam ( thePlayer ) ) or false 
    if ( teamName == "Police" and id == 280 ) then 
        -- Your code here. 
    end 
end 
  
--Create Vehicle 
function testCreateTest ( ) 
    if ( isElement ( policeCars[ source ] ) ) then -- We check if the player already has a car spawned. 
        destroyElement ( policeCars[ source ] ) -- If so, we destroy it. 
    end 
    policeCars[ source ] = createVehicle ( 596, 1535.05615, -1675.60766, 13.56008 ) -- We create the vehicle stored in 'policeCars' table. 
    outputChatBox ("Você virou Policial", source, 255, 0, 0 ) 
end 
addEvent ( "testCreateTest", true ) 
addEventHandler ( "testCreateTest", root, testCreateTest ) 
  
--Test Gui 
function testCreateTestGUI ( hitElement ) 
    if ( source == test_marker_request ) then 
        triggerClientEvent ( hitElement, "testCreateTestGUI", hitElement ) 
    end 
end 
addEventHandler ( "onMarkerHit", root, testCreateTestGUI ) 

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...