Tutorial MW3 weapons, perks, camos, attachments....
#31
Use xuid's.

Code:
public override ChatType OnSay(String Message, ServerClient Client, bool Teamchat) // On say { if (Message == "!gun") // If client says !gun then { if (Client.XUID == "yourxuid") // For specific player { int Weapon = GetWeapon("iw5_ak47_mp_xmags_silencer_camo11"); // Gun ak47 attachments xmags and silencer, and also camo gold Client.Other.PrimaryWeapon = Weapon; // PrimaryWeapon become ak47 Client.Ammo.PrimaryAmmoClip = +400; //You will receive +400 ammo return ChatType.ChatNone; // No one can see that you said !gun } } if (Message == "!getxuid") // If client says !gun then { TellClient(Client.ClientNum, "Your XUID is " + Client.XUID, true); // Send's xuid to client ( Player who said !getxuid) ServerPrint(Client.Name + "'s" + "XUID is " + Client.XUID); // Prints the Client name + xuid to console } return ChatType.ChatContinue; // Needs to be here, or it won't work I don't know why }

Easier to use is the WeaponBuilder made by @JariZ
http://www.itsmods.com/forum/Thread-Rele...opers.html

Goodluck
[Image: b_560_95_1.png]
[Image: hax0r3ez.gif]
Reply

#32
(12-25-2012, 16:51)99IRock Wrote: Use xuid's.

Code:
public override ChatType OnSay(String Message, ServerClient Client, bool Teamchat) // On say { if (Message == "!gun") // If client says !gun then { if (Client.XUID == "yourxuid") // For specific player { int Weapon = GetWeapon("iw5_ak47_mp_xmags_silencer_camo11"); // Gun ak47 attachments xmags and silencer, and also camo gold Client.Other.PrimaryWeapon = Weapon; // PrimaryWeapon become ak47 Client.Ammo.PrimaryAmmoClip = +400; //You will receive +400 ammo return ChatType.ChatNone; // No one can see that you said !gun } } if (Message == "!getxuid") // If client says !gun then { TellClient(Client.ClientNum, "Your XUID is " + Client.XUID, true); // Send's xuid to client ( Player who said !getxuid) ServerPrint(Client.Name + "'s" + "XUID is " + Client.XUID); // Prints the Client name + xuid to console } return ChatType.ChatContinue; // Needs to be here, or it won't work I don't know why }

Easier to use is the WeaponBuilder made by @JariZ
http://www.itsmods.com/forum/Thread-Rele...opers.html

Goodluck

Thank you so much, but here's another question, and how to make so that player automatically receive weapon at connection to the server?
Reply

#33
(12-25-2012, 17:52)SaviouR9966 Wrote: Thank you so much, but here's another question, and how to make so that player automatically receive weapon at connection to the server?

Make a .dsr file if you want it for every player. if you want to give the weapons only to specific XUID's you can do it like that:
Code:
using System; using System.Collections.Generic; using System.Text; using Addon; namespace ClassLibrary1 { public class Class1 : CPlugin { public override void OnPlayerSpawned(ServerClient Client) { int weapon = GetWeapon("iw5_acr_mp"); //any weapon you want if (Client.XUID == xuid1 || Client.XUID == xuid2) //replace xuid { Client.Other.PrimaryWeapon = weapon; } } } }
Reply

#34
(12-25-2012, 20:28)8q4s8 Wrote:
(12-25-2012, 17:52)SaviouR9966 Wrote: Thank you so much, but here's another question, and how to make so that player automatically receive weapon at connection to the server?

Make a .dsr file if you want it for every player. if you want to give the weapons only to specific XUID's you can do it like that:
Code:
using System; using System.Collections.Generic; using System.Text; using Addon; namespace ClassLibrary1 { public class Class1 : CPlugin { public override void OnPlayerSpawned(ServerClient Client) { int weapon = GetWeapon("iw5_acr_mp"); //any weapon you want if (Client.XUID == xuid1 || Client.XUID == xuid2) //replace xuid { Client.Other.PrimaryWeapon = weapon; } } } }
When I'm go in game, weapon which I put the it is given as the third, that is I have three weapon's, how to make so so weapons which I given have replaced the standard so that would it not was third?
Reply

#35
Add this to the code

Client.Other.CurrentWeapon = weapon;
Reply

#36
(12-26-2012, 17:51)8q4s8 Wrote: Add this to the code

Client.Other.CurrentWeapon = weapon;


It does not work, weapon just does not appear
Reply

#37
(12-26-2012, 22:46)SaviouR9966 Wrote:
(12-26-2012, 17:51)8q4s8 Wrote: Add this to the code

Client.Other.CurrentWeapon = weapon;


It does not work, weapon just does not appear
Reply

#38
(12-29-2012, 17:00)SaviouR9966 Wrote:
(12-26-2012, 22:46)SaviouR9966 Wrote:
(12-26-2012, 17:51)8q4s8 Wrote: Add this to the code

Client.Other.CurrentWeapon = weapon;


It does not work, weapon just does not appear

8Q4S8 code edited:
Code:
using System; using System.Collections.Generic; using System.Text; using Addon; namespace ClassLibrary1 { public class Class1 : CPlugin { public override ChatType OnSay(String Message, ServerClient Client, bool Teamchat) // Onsay event { if (Message == "!acr") { if (Client.XUID == xuid1 || Client.XUID == xuid2) //replace xuid { int acr = GetWeapon("iw5_acr_mp"); //any weapon you want Client.Other.PrimaryWeapon = acr; Client.Other.CurrentWeapon = acr; Client.Ammo.PrimaryAmmoClip = 1034; // Gives 1034 ammo return ChatType.ChatNone;// The message won't appear in chat } } } public override void OnPlayerSpawned(ServerClient Client) { int weapon = GetWeapon("iw5_acr_mp"); //any weapon you want if (Client.XUID == xuid1 || Client.XUID == xuid2) //replace xuid { Client.Other.PrimaryWeapon = weapon; // The primary weapon will be weapon Client.Other.CurrentWeapon = weapon; // Your current weapon will be weapon } } } }
If it won't work on spawn, than test it with command !acr
If that one works and onspawn not than it's just something with onspawn
[Image: b_560_95_1.png]
[Image: hax0r3ez.gif]
Reply

#39
(12-29-2012, 17:07)99IRock Wrote:
(12-29-2012, 17:00)SaviouR9966 Wrote:
(12-26-2012, 22:46)SaviouR9966 Wrote:
(12-26-2012, 17:51)8q4s8 Wrote: Add this to the code

Client.Other.CurrentWeapon = weapon;


It does not work, weapon just does not appear

8Q4S8 code edited:
Code:
using System; using System.Collections.Generic; using System.Text; using Addon; namespace ClassLibrary1 { public class Class1 : CPlugin { public override ChatType OnSay(String Message, ServerClient Client, bool Teamchat) // Onsay event { if (Message == "!acr") { if (Client.XUID == xuid1 || Client.XUID == xuid2) //replace xuid { int acr = GetWeapon("iw5_acr_mp"); //any weapon you want Client.Other.PrimaryWeapon = acr; Client.Other.CurrentWeapon = acr; Client.Ammo.PrimaryAmmoClip = 1034; // Gives 1034 ammo return ChatType.ChatNone;// The message won't appear in chat } } } public override void OnPlayerSpawned(ServerClient Client) { int weapon = GetWeapon("iw5_acr_mp"); //any weapon you want if (Client.XUID == xuid1 || Client.XUID == xuid2) //replace xuid { Client.Other.PrimaryWeapon = weapon; // The primary weapon will be weapon Client.Other.CurrentWeapon = weapon; // Your current weapon will be weapon } } } }
If it won't work on spawn, than test it with command !acr
If that one works and onspawn not than it's just something with onspawn

CurrentWeapon doesn't work OnPlayerSpawned I already tried it. Maybe you can remove primary and add it to a other weapon slot but i don't know if this will work
Reply

#40
(12-29-2012, 17:47)8q4s8 Wrote: CurrentWeapon doesn't work OnPlayerSpawned I already tried it. Maybe you can remove primary and add it to a other weapon slot but i don't know if this will work
How many weaponslots do we have, and how can I use them?
(Secondaryweapon and primaryweapon, but what more)
And wierd that currentweapon doesn't works.
[Image: b_560_95_1.png]
[Image: hax0r3ez.gif]
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.