That is not only horribly insecure but horribly inefficient as well. Instead of trying to circumvent the "No, you can't add any weapon you want clientside" security, you should try to do it right.
Perhaps instead you should use the standard put-the-npc-then-use-with-and-set-the-flag method. This is even easier in GS2.
gs1 example:
NPC Code:
setstring this.fruit,strawberry;
putnpc2 somex,somey,{ join fruits; };
with(npcs[npcscount-1]) {
setstring this.img,#s(thiso.fruit).png;
}
this.img in the placed NPC will be strawberry.png
Other than that, you were using a reserved action name (actionserverside is reserved for weapon npcs, actionserver[anythingelse] is reserved for control-npc). Please take the secure approach, though. Explicitly specify the weapon name, don't trust the client.