Author |
Topic: Weapons to specified ppl (GUID) |
LiQ.HeaDShOt |
|
General Member Since: Jun 1, 2010 Posts: 51 Last: Feb 21, 2011 [view latest posts] |
|
|
Category: CoD4 Scripting Posted: Monday, Aug. 2, 2010 02:25 pm |
|
Hi..
Another topic asking for help ^^
Here's the "deal": I have a server with a Sniper Only mod. Actually it's pretty simple cuz it just won't allow you to choose any weapon but snipers.
My doubt is: Is it possible to give weapons to specified ppl by GUID (like in BTD)? I mean, is there a script to allow this?
What I need: To know if it's possible to give weapons to specified ppl by GUID and I need the script xD
Mod that I use: http://forum.i3d.net/downloads.php?do=file&id=826
Plz help me :)
Very Important o.O
Thank you
edited on Aug. 2, 2010 12:08 pm by LiQ.HeaDShOt
BTW, if you are a scripter, plz comment your script in the lines where I have to fill in the GUID and some other info.
Thank you
|
|
|
|
Uzumakibro93 |
General Member Since: Sep 6, 2009 Posts: 118 Last: Jul 5, 2011 [view latest posts] |
|
|
|
LiQ.HeaDShOt |
|
General Member Since: Jun 1, 2010 Posts: 51 Last: Feb 21, 2011 [view latest posts] |
|
|
Category: CoD4 Scripting Posted: Monday, Aug. 2, 2010 06:58 pm |
|
Uzumakibro93 writes...Quote: Do you mean by using an administrative command? Such as
/rcon set [GUID] [GUN]
?
If so, yes. You can create a script to do so fairly simply, just by running a GUID check upon the function being called. Then, if your GUID matches, it will give you the specified gun. You could also use slot numbers. It would work better :D
hmm.. I understand..
but i would like the 2 ways.
When a player spawns, he receives the specified guns and if an admin executes that command, the player with that GUID that is inserted in the command would receive the gun.
Is that possible?
Can you make it?
sry but idk scripting and that's why i'm asking for help :) |
|
|
|
Uzumakibro93 |
General Member Since: Sep 6, 2009 Posts: 118 Last: Jul 5, 2011 [view latest posts] |
|
|
|
LiQ.HeaDShOt |
|
General Member Since: Jun 1, 2010 Posts: 51 Last: Feb 21, 2011 [view latest posts] |
|
|
Category: CoD4 Scripting Posted: Monday, Aug. 2, 2010 08:51 pm |
|
Uzumakibro93 writes...Quote: I can't promise I'll have much time to work on it, so no... If I do get the time, I'll be sure to tell you. Thank you, Kyle Mulliger.
Ok.
Anyway thank you.
If someone could help me, please post the script here ^^
Thank you. |
|
|
|
LiQ.HeaDShOt |
|
General Member Since: Jun 1, 2010 Posts: 51 Last: Feb 21, 2011 [view latest posts] |
|
|
|
LiQ.HeaDShOt |
|
General Member Since: Jun 1, 2010 Posts: 51 Last: Feb 21, 2011 [view latest posts] |
|
|
|
Xylozi |
General Member Since: Jul 12, 2008 Posts: 218 Last: Mar 1, 2012 [view latest posts] |
|
|
|
Category: CoD4 Scripting Posted: Wednesday, Aug. 4, 2010 06:53 am |
|
This script checks the GUID of a player on spawn and if it matches the chosen ones, they are given the special gun. It also allows you to use a custom command ( scr_giveWeapon) to give any weapon to any player ( uses slot numbers to define player)
Code:
setupWeapons()
{
// For each seperate guid, add a space between them
level.allowedGUIDS = "guidONE guidTWO";
// Change "ak47_mp" to the weapon of your choice
level.specialWeapon = "ak47_mp";
level thread monitorDvar();
level thread onPlayerConnect();
}
onPlayerConnect()
{
for(;;)
{
level waittill( "connected", player );
player thread OnSpawn();
}
}
OnSpawn()
{
self endon( "disconnect" );
for(;;)
{
self waittill( "spawned" );
self thread checkGUID();
}
}
checkGUID()
{
self.isSpecial = false;
allowedGUIDs = strTok( level.allowedGUIDS, " " );
for( i = 0; i < allowedGUIDs.size; i++ )
{
guid = allowedGUIDs[i];
if( ToLower( self GetGUID() ) == ToLower( guid ) )
self.isSpecial = true;
}
if( self.isSpecial )
{
// Should be primary on spawn
self TakeWeapon();
self GiveWeapon( level.specialWeapon );
self GiveStartAmmo( level.specialWeapon );
}
}
monitorDvar()
{
setDvar( "scr_giveWeapon", "" );
while(1)
{
if( getDvar( "scr_giveWeapon" ) != "" )
thread giveWeapon();
wait 0.05;
}
}
giveWeapon()
{
// When typing in the command, do /rcon scr_giveWeapon PLAYERID WEAPONNAME
string = strTok( getDvar( "scr_giveWeapon" ), " " );
setDvar( "scr_giveWeapon", "" );
if( !isDefined( string[0] ) ||!isDefined( string[1] ) )
return;
players = getEntArray( "player", "classname" );
for( i = 0; i < players.size; i++ )
{
player = players[i];
if( player getEntityNumber() == int( string[0] ) )
{
player TakeWeapon();
player giveWeapon( string[1] );
player giveStartAmmo( string[1] );
}
}
}
|
|
|
|
LiQ.HeaDShOt |
|
General Member Since: Jun 1, 2010 Posts: 51 Last: Feb 21, 2011 [view latest posts] |
|
|
Category: CoD4 Scripting Posted: Wednesday, Aug. 4, 2010 11:44 am |
|
Xylozi writes...Quote: This script checks the GUID of a player on spawn and if it matches the chosen ones, they are given the special gun. It also allows you to use a custom command ( scr_giveWeapon) to give any weapon to any player ( uses slot numbers to define player)
Code:
setupWeapons()
{
// For each seperate guid, add a space between them
level.allowedGUIDS = "guidONE guidTWO";
// Change "ak47_mp" to the weapon of your choice
level.specialWeapon = "ak47_mp";
level thread monitorDvar();
level thread onPlayerConnect();
}
onPlayerConnect()
{
for(;;)
{
level waittill( "connected", player );
player thread OnSpawn();
}
}
OnSpawn()
{
self endon( "disconnect" );
for(;;)
{
self waittill( "spawned" );
self thread checkGUID();
}
}
checkGUID()
{
self.isSpecial = false;
allowedGUIDs = strTok( level.allowedGUIDS, " " );
for( i = 0; i < allowedGUIDs.size; i++ )
{
guid = allowedGUIDs[i];
if( ToLower( self GetGUID() ) == ToLower( guid ) )
self.isSpecial = true;
}
if( self.isSpecial )
{
// Should be primary on spawn
self TakeWeapon();
self GiveWeapon( level.specialWeapon );
self GiveStartAmmo( level.specialWeapon );
}
}
monitorDvar()
{
setDvar( "scr_giveWeapon", "" );
while(1)
{
if( getDvar( "scr_giveWeapon" ) != "" )
thread giveWeapon();
wait 0.05;
}
}
giveWeapon()
{
// When typing in the command, do /rcon scr_giveWeapon PLAYERID WEAPONNAME
string = strTok( getDvar( "scr_giveWeapon" ), " " );
setDvar( "scr_giveWeapon", "" );
if( !isDefined( string[0] ) ||!isDefined( string[1] ) )
return;
players = getEntArray( "player", "classname" );
for( i = 0; i < players.size; i++ )
{
player = players[i];
if( player getEntityNumber() == int( string[0] ) )
{
player TakeWeapon();
player giveWeapon( string[1] );
player giveStartAmmo( string[1] );
}
}
}
thx!! I <3 u! :D :D :D
Question: Can i add like:
// Change "ak47_mp" to the weapon of your choice
level.specialWeapon = "ak47_mp";
level.specialWeapon = "ak74u_mp";
If there are two weapons, can i add this 2nd line?
Question: How do I install it? Do I have to edit globallogic?
If yes, plz tell me which line to find and what line to add..
Thank You |
|
|
|
Xylozi |
General Member Since: Jul 12, 2008 Posts: 218 Last: Mar 1, 2012 [view latest posts] |
|
|
|
|