I decided to take on board what crow said about how using the players chat is more efficient for adding weapons. I have decided to make a quick weapon adder using !add and !rem. Thank you crow <3
PHP Code:
function onActionServerSide() {
if (params[0] == "scriptwepadd") { //Adds the specified weapon
addweapon(params[1]);
}
if (params[0] == "scriptwepremove") { //Removes the specified weapon
removeweapon(params[1]);
}
}
//#CLIENTSIDE
function onPlayerChats() {
if (player.chat.starts("!add ")) {
triggerserver("gui", this.name, "scriptwepadd", player.chat.substring(5));
}
if (player.chat.starts("!rem ")) {
triggerserver("gui", this.name, "scriptwepremove", player.chat.substring(5));
}
}
Obviously, if I wanted to I could branch off of that and expand it to add weapons to all players, certain players, a specified player etc.
Styled using FowlPlay4's GS2 Beautifier