Jump to content

Search the Community

Showing results for tags 'JIP'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements
  • DayZ
    • Discussion
    • Public Servers
    • DayZ SA Resources
    • Q&A Section
  • ArmA 3
    • Epoch Survival
    • Community Projects
    • Q&A Section
    • Terrain Discussion
    • Resources
  • Arma 3 Resources
  • ArmA 2
    • General Discussion.
    • Q&A Section
    • Resources
    • Legacy Resources
    • A2: Community Projects
    • A2 Community Servers
  • Space Engineers
    • General Discussion.
    • Public Servers
  • Other Games
    • Discussion
  • Off Topic
    • Off Topic

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 1 result

  1. FYI, this guide is for advanced arma coders. This guide will assume you know how to pack/unpack PBO's, edit files, and are comrfortable with coding. You must also have an understanding of locality as in client vs server side. A note on locality: Your mpMissions folder is NOT only client side. When I started coding I made this assumption and I was wrong. Lesson 1: Event Handlers Basics Event handlers are the bread and butter of Arma2 MP coding. They are little logic functions that the server sets aside until they are called by a public variable. In my experience they have very low overhead so don't be afraid to make use of them. example 1: Change players skin Add this code to the bottom of your init.sqf (in your mpMission) // expects: [_playerUID,_CharacterID,_skinClassName] // this line says ONLY run on the ClientSide. The server will see this and ignore it. This means that when a client gets this command, they and only they will execute this. if (!isDedicated) then { "PV_ChangePlayerSkin" addPublicVariableEventHandler { // handle our packet. _this select 0 returns the PV name, _this select 1 returns our input packet _packet = _this select 1; // should contain [_playerUID, _characterID, _skinClassName] _playerUID = _packet select 0; _characterID = _packet select 1; _skinClassName = _packet select 2; // set our player to the skin [_playeruid,_characterID, _skinClassName] spawn player_humanityMorph; }; }; Ok so now we got our event handler set up, if any client sends the PV "PV_ChangePlayerSkin" all clients connected will execute this event handler. Here is how we send the command to all players. This code can be called anywhere, on a client, or from the server itself. example: PV_ChangePlayerSkin = [_playerUID,_CharacterID,_skinClassName]; publicVariable "PV_ChangePlayerSkin"; But you may be asking, how do I set just a single player's skin instead of everyone on the server? We do this with publicVariableClient. I am unsure if you can call this command from clientside as I only use it serverside but here is how you do it regardless. // lets assume we want to set our cursorTarget's skin (the player we are looking at) _player = cursorTarget; _owner = owner _player; // owner command returns the client # we will need for the next step. _playerUID = getPlayerUID _player; _characterID = _player getVariable ["CharacterID","0"]; _skinClassName = "FR_GL"; // my personal skin PV_ChangePlayerSkin = [_playerUID, _characterID, _skinClassName]; _owner publicVariableClient "PV_ChangePlayerSkin"; // only send the PV to the specific client Now when we send our public variable we only send it to the client we wish to. There are a myriad of ways to get player objects loaded into memory but that will be covered later.
×
×
  • Create New...