Jump to content

need little help with this code


Recommended Posts

Posted

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) 

Posted
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

Posted
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 ?

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

Posted
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 
) 
  

Posted
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

Posted

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!

Posted (edited)

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
Posted

it works but the message show for everyone in the chat also I want to know how to make two messages one for the people who are allowed to use the marker and another one for the people who can't use it

Posted

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 ) ) 
Posted
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 !

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