Jump to content

I Dont Know


botshara

Recommended Posts

Posted

client-side

-- HERE WILL BE SCRIPT 
local startJOB = createMarker ( 2208.328125, -2284.1962890625, 13.764669418335, "cylinder", 1.5, 255, 255, 0, 170 ) 
  
function startTheJob() 
    setElementModel(getLocalPlayer(), 27) 
    nextMarker = createMarker ( 2230.3369140625, -2283.4921875, 13.391557693481, "cylinder", 1.5, 255, 255, 0, 170 ) 
    addEventHandler ( "onClientMarkerHit", nextMarker, nextStage ) 
    destroyElement(startJOB) 
end 
addEventHandler ( "onClientMarkerHit", startJOB, startTheJob ) 

What the fuck, when hit on marker then changes player clothes but the problem is that clothes changes else to players who is nearby at me. Please help to fix this script

Posted

You have to check is the player who hit the marker is the local player.

Try this:

local startJOB = createMarker ( 2208.328125, -2284.1962890625, 13.764669418335, "cylinder", 1.5, 255, 255, 0, 170 ) 
  
function startTheJob(hitElement) 
     if (hitElement == localPlayer) then 
         setElementModel(localPlayer, 27) 
         nextMarker = createMarker ( 2230.3369140625, -2283.4921875, 13.391557693481, "cylinder", 1.5, 255, 255, 0, 170 ) 
         addEventHandler ( "onClientMarkerHit", nextMarker, nextStage ) 
         destroyElement(startJOB) 
    end 
end 
addEventHandler ( "onClientMarkerHit", startJOB, startTheJob ) 

A unique GangWar gamemode waiting for you!
Click here for more information.

560x95_FFFFFF_FF9900_000000_000000.png

Posted
You have to check is the player who hit the marker is the local player.

Try this:

local startJOB = createMarker ( 2208.328125, -2284.1962890625, 13.764669418335, "cylinder", 1.5, 255, 255, 0, 170 ) 
  
function startTheJob(hitElement) 
     if (hitElement == localPlayer) then 
         setElementModel(localPlayer, 27) 
         nextMarker = createMarker ( 2230.3369140625, -2283.4921875, 13.391557693481, "cylinder", 1.5, 255, 255, 0, 170 ) 
         addEventHandler ( "onClientMarkerHit", nextMarker, nextStage ) 
         destroyElement(startJOB) 
    end 
end 
addEventHandler ( "onClientMarkerHit", startJOB, startTheJob ) 

Now skin changes only for me, the other players didnt see that I changed skin and I didnt see them is changed skin

Posted (edited)

It's because it's made on client side and only the local player can see it.

You have to create a custom event on server side to change the player's skin.

This should work fine:

Server:

addEvent('setPlayerSkin', true) 
addEventHandler ('setPlayerSkin', root, 
function (model) 
    if (model and tonumber(model)) then 
        setElementModel(client,model)    
    end  
end) 

Client:

function startTheJob(hitElement) 
     if (hitElement == localPlayer) then 
         triggerServerEvent('setPlayerSkin',hitElement,27) 
         nextMarker = createMarker ( 2230.3369140625, -2283.4921875, 13.391557693481, "cylinder", 1.5, 255, 255, 0, 170 ) 
         addEventHandler ( "onClientMarkerHit", nextMarker, nextStage ) 
         destroyElement(startJOB) 
    end 
end 
addEventHandler ( "onClientMarkerHit", startJOB, startTheJob ) 

Edited by Guest

A unique GangWar gamemode waiting for you!
Click here for more information.

560x95_FFFFFF_FF9900_000000_000000.png

Posted

Change the event name "onPlayerSkin" to: "setPlayerSkin".

Please do not PM me with scripting related question nor support, use the forums instead.

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