Quote:
Originally posted by emortylone
o_O! Like can you give me a quick example of how things are to be changed?
---Shifter
|
Lets say you have an npc like this:
NPC Code:
if (playertouchsme) say2 say "stuff" to buy me!;
if (playerchats && strequals(#c,Stuff)) {playerrupees-=100;toweapons stuff;}
It would have to change to this:
NPC Code:
if (actionserverside) {
playerrupees-=100;
addweapon stuff;
}
//#CLIENTSIDE
if (playertouchsme) say2 say "stuff" to buy me!;
if (playerchats && strequals(#c,Stuff)) triggeraction 0,0,serverside,;
Is probably more what you would be doing. Also something that displays server. striungs will have to be changed like this:
used to be:
NPC Code:
if (playerchats) {
tokenize #c;
if (strequals(What is "#t(2)")) setplayerprop #c,#s(server.#t(2));
}
will have to be:
NPC Code:
if (actionserverside) {
setplayerprop #c,#s(server.#p(0));
}
//#CLIENTSIDE
if (playerchats) {
tokenize #c;
if (strequals(What is "#t(2)")) triggeraction 0,0,serverside,#t(2);
}
this is not precise, because I think if you wish to triggeraction on a database npc or otherwise it has to be assigned a name. But its a lot like what you would have to do. Also the stuff weapon would need to be added into the weapons database, although I believe toweapons still works if you have it in the weapons database, it is a lot easier to make changes on it. However there are a lot of benefits you also get, for example:
NPC Code:
if (actionservergetfromothernpc) {
with(getnpc(databasenpcname)) {
thiso.vars = this.var;
setstring thiso.stuff,#s(this.stuff);
}
setplayerprop #c,#v(this.vars) - #s(this.stuff);
}
//CLIENTSIDE
if (weaponfired) triggeraction 0,0,servergetfromothernpc;
This will go to the specified database npc, look for the this.var variable and this.stuff string and set them on this npcw and set the player's prop, so you can have many npcs on the server all addstring or deletestring or lindex of on one string a lot like server strings, however one of my favorite part is that only people with NC (hopefully only the admins) will be able to edit it so that you don't get gps who (for some reason) have access to server vars deleting your flags, etc. (very nice).