Jump to content

please help fix script.


Kenix

Recommended Posts

Posted

I have made a script that when the player dies at it there is other weather but it works on all players. How to make that it worked only on one player???

server

  
addEventHandler( "onPlayerWasted", getRootElement( ), 
    function() 
        triggerClientEvent ("playerw", getRootElement()) 
    end 
) 
  

client

  
localPlayer = getLocalPlayer() 
  
addEvent("playerw",true) 
addEventHandler( "playerw", localPlayer, 
    function( ) 
        setSkyGradient (100,50,0,70,0,0); 
    end 
) 
  

Please help to correct my script.=(

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

try this,

addEventHandler( "onPlayerWasted", getRootElement( ), 
    function() 
        triggerClientEvent (source,"playerw", source) 
    end 
) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • Moderators
Posted

Isn't quite redundant to do this serverside if you're only going to set weather for the player?

clientside:

  
addEventHandler ('onClientPlayerWasted', root, 
    function () 
        if (source == getLocalPlayer()) then 
            setSkyGradient (100,50,0,70,0,0) 
        end 
    end 
) 
  

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