Results 1 to 3 of 3

Thread: addaction depending on PlayerID

  1. #1

    addaction depending on PlayerID

    i want to make a script that will spawn a vehicle depending on the user's PlayerID


    Right now, all i have is a vehicle spawner that can be used for all players...
    spawner:
    Spoiler:


    Spawner.sqf:
    Spoiler:


    what i want to do is make it so that only certain users can spawn vehicles. like if playerid=""1234567" init="0 = [] execVm ""Spawner.SQF"";

    can someone help me out?

  2. #2
    There's been a bunch of "based on playerID" questions recently. Search for forum and you'll see the examples. The command you're looking for is getPlayerUID

  3. #3
    PHP Code:
    //assignActions.sqf
    _object _this select 0;
    _marker _this select 1;
    _availableVehicles = switch (getPlayerUID player) do
    {
       case 
    "111222"//Player with UID 111222
       
    {
           [
    "HMMWV_MK19""M1A2_TUSK_MG""TowingTractor""GAZ_Vodnik_HMG"]
       };
       case 
    "222333"//Player with UID 222333
       
    {
           [
    "HMMWV_MK19""TowingTractor""GAZ_Vodnik_HMG"]
       };
       default 
    //Everyone else
       
    {
           [
    "TowingTractor"]
       };
    };

    {
       
    _object addAction [format ["Spawn %1"getText(configFile >> "CfgVehicles" >> _x >> "displayName")], //Fetch the vehicle name from the config
          
    "spawner.sqf",
          [
    _marker_x]];
    } forEach 
    _availableVehicles
    Then add this to the buildings init field:
    PHP Code:
    = [this"MARKERNAME"execVM "assignActions.sqf" 

Similar Threads

  1. PlayerId change for Reinforcements / ArmA X users
    By Suma in forum ARMA 2 & OA - MULTIPLAYER
    Replies: 13
    Last Post: Aug 9 2012, 21:52
  2. Need help: setCurrentTask depending on taskComplete
    By h34dup in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 3
    Last Post: Jul 15 2012, 20:51
  3. unit in next mission depending...
    By ArmAriffic in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 2
    Last Post: Apr 21 2011, 21:00
  4. Marines v0.8 - Score based by playerid
    By Leeflet in forum ARMA 2 & OA : ADDONS - Configs & Scripting
    Replies: 4
    Last Post: Jul 6 2009, 18:16
  5. Special respawn rules depending on who
    By simonwa1 in forum ARMA - MISSION EDITING & SCRIPTING
    Replies: 6
    Last Post: Apr 4 2007, 10:45

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •