Jump to content
Sign in to follow this  
ablueman

Clan specific script.

Recommended Posts

Hi, apologies if this is posted somewhere else, I did search for a few things but didnt get anything to do with what im trying.

I am trying to make a basic script that a Clan can use on their server to identify if a player is a member. It would act alot like the squad.xml file and this may even be the answer.

What I want is a way to say

if player= "WBG" {Do exiting and intelligent things}

if player!= "WBG" {Exit};

I didnt take the time to do this example properly its just to give an idea what I need. Now obviously I could just script it with .. "if playername = " and list every member. But this could fast become a problem with people faking the name or updating each map that we include the file in. I could also use the player ID ok so less likely people could fake it but it would need to be a server script not a map script or potentially id have to update 20 maps each time someone joins?

Is there any way I can just check a variable from the xml script to see if someone is a member or not?

I have lots of ideas that would be great for clan members to make the experience of being in the clan better, but I cant impliment or experiment till I can come up with a good solution.

I just want to #include clanscript.sql and have one file to update should members join. Or even better if I can get it to check the xml file .. id just need to include my script and forget about it.

Thanks

Andy

Edited by ablueman

Share this post


Link to post
Share on other sites

I'm working on the same thing..

What I've found so far, is you can execute a script that isn't in the map pbo. It saves you from having to update every map everytime you want to change something in the script.

I'm working on the best way to run the script, right now I just have it in a radio trigger for testing:

null=[] execVM "\rearm.sqf";

notice the \ before the script name. that tells it in the root of the server. i.e. where the arma2.exe is.

rearm.sqf:

private ["_playername"];
_playername = toLower (name player);

switch(_playername)do 
{ 
case "big daddy":
{
	removeAllWeapons player;
	{player addmagazine "10Rnd_127x99_m107";} forEach [1,2,3,4,5,6,7,8];
	player addWeapon "m107"; 
	{player addmagazine "SMAW_HEAA";} forEach [1,2,3,4];
	player addWeapon "SMAW";
	{player addmagazine "pipebomb";} forEach [1,2];
	player addweapon "binocular"; player addweapon "NVGoggles";

};
case "another player name":
{
	removeAllWeapons player;
	{player addmagazine "10Rnd_127x99_m107";} forEach [1,2,3,4,5,6,7,8];
	player addWeapon "m107"; 
	{player addmagazine "SMAW_HEAA";} forEach [1,2,3,4,5,6,7,8];
	player addWeapon "SMAW";
	{player addmagazine "pipebomb";} forEach [1,2];
	player addweapon "binocular"; player addweapon "NVGoggles";
};
};

So far, this works great. I'm when finished I'll add it to the init.sqf, and when my guys join, they'll have their favorite load outs, and not have to spend time choosing their weapons.

Share this post


Link to post
Share on other sites
I'm working on the same thing..

What I've found so far, is you can execute a script that isn't in the map pbo. It saves you from having to update every map everytime you want to change something in the script.

I'm working on the best way to run the script, right now I just have it in a radio trigger for testing:

null=[] execVM "\rearm.sqf";

notice the \ before the script name. that tells it in the root of the server. i.e. where the arma2.exe is.

rearm.sqf:

private ["_playername"];
_playername = toLower (name player);

switch(_playername)do 
{ 
case "big daddy":
{
	removeAllWeapons player;
	{player addmagazine "10Rnd_127x99_m107";} forEach [1,2,3,4,5,6,7,8];
	player addWeapon "m107"; 
	{player addmagazine "SMAW_HEAA";} forEach [1,2,3,4];
	player addWeapon "SMAW";
	{player addmagazine "pipebomb";} forEach [1,2];
	player addweapon "binocular"; player addweapon "NVGoggles";

};
case "another player name":
{
	removeAllWeapons player;
	{player addmagazine "10Rnd_127x99_m107";} forEach [1,2,3,4,5,6,7,8];
	player addWeapon "m107"; 
	{player addmagazine "SMAW_HEAA";} forEach [1,2,3,4,5,6,7,8];
	player addWeapon "SMAW";
	{player addmagazine "pipebomb";} forEach [1,2];
	player addweapon "binocular"; player addweapon "NVGoggles";
};
};

So far, this works great. I'm when finished I'll add it to the init.sqf, and when my guys join, they'll have their favorite load outs, and not have to spend time choosing their weapons.

Nice and thanks for the reply. Only 1 problem I can see would be that someone comes in using your or someone in your clans name .. Might be better to use the UID ?

Share this post


Link to post
Share on other sites

There could be something along the lines of

if (isServer) then {

check XML = true
if XML = "true"

check Player UID = true
if UID = "true"

null=[] execVM "script"

or something along those lines, in the init.sqf file.

Not sure on the actual lines that would be used for eg. checking the XML ect, or even if you could check, but this 'seems' like the most reasonable way of going about it. But, as we all know, theres no reasonable in scripting :rolleyes:

I mean, this SHOULD be possible, because the game already does it in some way for the clan xml files, adding logo's etc.

Edit: thinking about it, would it not be possible to change Big Daddy's

null=[] execVM "\rearm.sqf";

notice the \ before the script name. that tells it in the root of the server. i.e. where the arma2.exe is.

to detect the XML etc files inside the directory, and work from there ? This could be possible then if we can detect player UID's

p.s. Hey Easy :D

Edited by Fenrir

Share this post


Link to post
Share on other sites
There could be something along the lines of

if (isServer) then {

check XML = true
if XML = "true"

check Player UID = true
if UID = "true"

null=[] execVM "script"

or something along those lines, in the init.sqf file.

Not sure on the actual lines that would be used for eg. checking the XML ect, or even if you could check, but this 'seems' like the most reasonable way of going about it. But, as we all know, theres no reasonable in scripting :rolleyes:

I mean, this SHOULD be possible, because the game already does it in some way for the clan xml files, adding logo's etc.

Edit: thinking about it, would it not be possible to change Big Daddy's

to detect the XML etc files inside the directory, and work from there ? This could be possible then if we can detect player UID's

p.s. Hey Easy :D

Well the XML script is kinda like a database. So it should be possible to call the information from the XML script which is of course ideal. But im not sure about how to do it or if the scripting language is even capable of it .. will look at it more tommorow .. " hey fen ;) "

Share this post


Link to post
Share on other sites

Well sure, using the UID would be more secure. I didn't really have to worry about it cause we play on a private server.

Share this post


Link to post
Share on other sites
Well sure, using the UID would be more secure. I didn't really have to worry about it cause we play on a private server.

Just in case anyone finds this old thread I finally got around to doing it.

This allows you to give permissions to people based on their UID or as part of a group. It sits in the main Armour folder (almost like a mod) so all you should need to do is add one line of code to init.sqf. And then add whatever you want to the sections for that member or group or in the missions itself based on the global variable. All three files go in the main folder in your armour folder.

Init.sqf

null=[] execVM "\wbg\wbg.sqf";

wbg.sqf in /wbg/

// addAction to eject player from MHQ / Lock or Unlock MHQ / If no WBG present = remove lock.

WaitUntil{not isNull player};
waitUntil {(getPlayerUID player) != ""};

_uid 	= getPlayerUID player;
_title  = "";
_text   = "";
wbg	="";

#include "wbgmembers.sqf";
#include "wbggroup.sqf";


sleep 1;
hint parseText (_title + _text);

wbgmembers.sqf in /wbg/

switch(_uid)do 
{ 
case "111111": // EasyTarget
{
wbg = "Admin"; 
_title  = "<t color='#ff0000' size='1.2' shadow='1' shadowColor='#000000' align='center'>Welcome Back</t><br />";
_text = format["<t color='#ffffff' size='1.2' shadow='1' shadowColor='#000000' align='left'>%1</t><t  align='right'> [%2]</t><br />", name player, wbg];
};

case "222222": // cpt_custard
{
wbg = "Admin";
_title  = "<t color='#ff0000' size='1.2' shadow='1' shadowColor='#000000' align='center'>Welcome Back</t><br />";
_text = format["<t color='#ffffff' size='1.2' shadow='1' shadowColor='#000000' align='left'>%1</t><t  align='right'> [%2]</t><br />", name player, wbg];
};

case "333333": // KHCloud
{
wbg = "Member";
_title  = "<t color='#ff0000' size='1.2' shadow='1' shadowColor='#000000' align='center'>Welcome Back</t><br />";
_text = format["<t color='#ffffff' size='1.2' shadow='1' shadowColor='#000000' align='left'>%1</t><t  align='right'> [%2]</t><br />", name player, wbg];
};

default
   	{
_title = "<t color='#ff0000' size='1.2' shadow='1' shadowColor='#000000' align='center'>Welcome to WBG</t><br />";
_text = format["%1, please take a second to read the rules, you cant fly the aircraft unless your a pilot and on TeamSpeak", name player];
};

};

wbggroup.sqf in /wbg/

switch(wbg)do 
{ 
case "Admin":
{
	_aa1 = Player addAction ["Teleport1", "base.sqf",["base_spawn_2"],1,false];

};

case "Mod":
{

};

case "Member":
{
};

case "Regular":
{
};

default
   	{
};
};

Edited by ablueman

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×