Jump to content

need little help with this code


Recommended Posts

how can I fix it?

local theSerial = "0396C6F543425FFE37A326883D73B4F4" 
  
local theMarker = createMarker ( -2756.43, 377.55, 4.335, 'cylinder', 2.0, 75, 182, 76, 150 )  
  
  
  
addEventHandler('onClientMarkerHit',theMarker, 
  
    function ( hit ) 
  
        if hit == localPlayer then 
  
           if getPlayerSerial(player) == theSerial then and not isPedInVehicle ( hit ) then 
            
                    setElementPosition( hit , 2253.50, 589.58, 10.66 ) 
                     
                end 
  
            end 
  
        end 
  
    end,false 
) 
  
  
  
  
addEventHandler('onClientMarkerHit',theMarker, 
  
function(player) 
        if (getPlayerSerial(player)~="0396C6F543425FFE37A326883D73B4F4")then 
            cancelEvent() 
            r,b,g = math.random(0, 255), math.random(0, 255), math.random(0, 255) 
            outputChatBox( "text", player,r,b,g, true ) 
        else 
            r,b,g = math.random(0, 255), math.random(0, 255), math.random(0, 255) 
            outputChatBox( "text", player,r,b,g, true )  
        end 
    end 
end) 

Link to comment
local theSerial = "0396C6F543425FFE37A326883D73B4F4" 
  
local theMarker = createMarker ( -2756.43, 377.55, 4.335, 'cylinder', 2.0, 75, 182, 76, 150 )  
  
  
  
addEventHandler('onClientMarkerHit',theMarker, 
    function ( hit ) 
        if hit == localPlayer then 
           if getPlayerSerial( ) == theSerial then and not isPedInVehicle ( hit ) then 
                    setElementPosition( hit , 2253.50, 589.58, 10.66 ) 
                    outputChatBox ( 'WHAT EVER',math.random ( 255 ),math.random ( 255 ),math.random ( 255 ) ) 
                else 
                    outputChatBox ( 'WHAT EVER',math.random ( 255 ),math.random ( 255 ),math.random ( 255 ) ) 
            end 
        end 
    end,false 
) 
  

Client

Link to comment
local theSerial = "0396C6F543425FFE37A326883D73B4F4" 
  
local theMarker = createMarker ( -2756.43, 377.55, 4.335, 'cylinder', 2.0, 75, 182, 76, 150 )  
  
  
  
addEventHandler('onClientMarkerHit',theMarker, 
    function ( hit ) 
        if hit == localPlayer then 
           if getPlayerSerial( ) == theSerial then and not isPedInVehicle ( hit ) then 
                    setElementPosition( hit , 2253.50, 589.58, 10.66 ) 
                    outputChatBox ( 'WHAT EVER',math.random ( 255 ),math.random ( 255 ),math.random ( 255 ) ) 
                else 
                    outputChatBox ( 'WHAT EVER',math.random ( 255 ),math.random ( 255 ),math.random ( 255 ) ) 
            end 
        end 
    end,false 
) 
  

Client

then and not ?

Link to comment
local theSerial = "0396C6F543425FFE37A326883D73B4F4" 
  
local theMarker = createMarker ( -2756.43, 377.55, 4.335, 'cylinder', 2.0, 75, 182, 76, 150 )  
  
  
  
addEventHandler('onClientMarkerHit',theMarker, 
    function ( hit ) 
        if hit == localPlayer then 
           if getPlayerSerial( ) == theSerial then and not isPedInVehicle ( hit ) then 
                    setElementPosition( hit , 2253.50, 589.58, 10.66 ) 
                    outputChatBox ( 'WHAT EVER',math.random ( 255 ),math.random ( 255 ),math.random ( 255 ) ) 
                else 
                    outputChatBox ( 'WHAT EVER',math.random ( 255 ),math.random ( 255 ),math.random ( 255 ) ) 
            end 
        end 
    end,false 
) 
  

Client

Not working.

Link to comment
local theSerial = "0396C6F543425FFE37A326883D73B4F4" 
  
local theMarker = createMarker ( -2756.43, 377.55, 4.335, 'cylinder', 2.0, 75, 182, 76, 150 )  
  
  
  
addEventHandler('onClientMarkerHit',theMarker, 
    function ( hit ) 
        if hit == localPlayer then 
           if getPlayerSerial( ) == theSerial and not isPedInVehicle ( hit ) then 
                    setElementPosition( hit , 2253.50, 589.58, 10.66 ) 
                    outputChatBox ( 'WHAT EVER',math.random ( 255 ),math.random ( 255 ),math.random ( 255 ) ) 
                else 
                    outputChatBox ( 'WHAT EVER',math.random ( 255 ),math.random ( 255 ),math.random ( 255 ) ) 
            end 
        end 
    end,false 
) 
  

Link to comment
local theSerial = "0396C6F543425FFE37A326883D73B4F4" 
  
local theMarker = createMarker ( -2756.43, 377.55, 4.335, 'cylinder', 2.0, 75, 182, 76, 150 )  
  
  
  
addEventHandler('onClientMarkerHit',theMarker, 
    function ( hit ) 
        if hit == localPlayer then 
           if getPlayerSerial( ) == theSerial and not isPedInVehicle ( hit ) then 
                    setElementPosition( hit , 2253.50, 589.58, 10.66 ) 
                    outputChatBox ( 'WHAT EVER',math.random ( 255 ),math.random ( 255 ),math.random ( 255 ) ) 
                else 
                    outputChatBox ( 'WHAT EVER',math.random ( 255 ),math.random ( 255 ),math.random ( 255 ) ) 
            end 
        end 
    end,false 
) 
  

still not working

Link to comment

As far as i know the on i gave it should work as it should!

local theName = "iFahad" 
local theMarker = createMarker ( -2756.43, 377.55, 4.335, 'cylinder', 2.0, 75, 182, 76, 150 )  
  
  
  
addEventHandler('onClientMarkerHit',theMarker, 
    function ( hit ) 
        if hit == localPlayer and getPlayerName ( hit ) == theName then 
            setElementPosition( hit , 2253.50, 589.58, 10.66 ) 
            outputChatBox ( 'Hello Hit!',math.random ( 255 ),math.random ( 255 ),math.random ( 255 ) ) 
        else 
            outputChatBox ( 'For Hit!',math.random ( 255 ),math.random ( 255 ),math.random ( 255 ) ) 
        end 
    end,false 
) 

Change the name! and add color codes if there's!

Link to comment

can you fit cancelEvent with the code?

cancelEvent() 
            r,b,g = math.random(0, 255), math.random(0, 255), math.random(0, 255) 
            outputChatBox( "text", player,r,b,g, true ) 
        else 
           r,b,g = math.random(0, 255), math.random(0, 255), math.random(0, 255) 
           outputChatBox( "text", player,r,b,g, true )  

Edit: in the code you gave me

===Edit: the marker shows up but it don't change my position.

Edited by Guest
Link to comment
In the outputChatBox :

outputChatBox ( 'text',math.random ( 255 ),math.random ( 255 ),math.random ( 255 ) ) 

change to :

outputChatBox ( 'text',hit,math.random ( 255 ),math.random ( 255 ),math.random ( 255 ) ) 

It's client dear the best please read the wiki KILL ME !

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