Quote:
Originally Posted by Mark Sir Link
one of the first things you should do is verify who is actually sending this trigger to the server since it's incredibly insecure otherwise
and then while you're at it you should prefix addweapon and removeweapon with the proper object (player)
|
Don't understand how to verify that. But here is it prefixed...
PHP Code:
function onActionServerSide() {
if (params[0] == "scriptwepadd") { //Adds the specified weapon
player.addweapon(params[1]); //Prefixed player.addweapon
}
if (params[0] == "scriptwepremove") { //Removes the specified weapon
player.removeweapon(params[1]); //Prefixed player.removeweapon
}
}
//#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));
}
}