![]() |
How to drop items?
This works fine ofline for me,
but what do I need to do to make it work with npc server? if (strtofloat(#s(client.stuff)) >=1) { if (playerchats && strequals(#c,drop)) { putnpc potion.gif,bpotion.txt,playerx,playery; setplayerprop #c,Dropped; sleep 0.1; setstring client.stuff, #v(strtofloat(#s(client.stuff))-1); } Also should the npc txt. file be saved to levels/scripts or am I a complete idiot? :frown: |
script it serverside with
triggeraction 0,0,serverside,npcname,param1,p2,p3,p4...etc... and a if ( actionserverside ) if ( strequals( #p(1),drop ) putnpc2 playerx,playery,{ script or class like join thiscalss;}; etc... well not sure about the syntax of #p(1) havent scripter far a while of course.. |
The document is placed where the level is. (same folder)
|
putnpc is deprecated. Don't use it.
Sigh. Oh, and Es - the first argument sent is read as #p(0) serverside. :) I'll further note that what Es described is the script of a weapon. |
Yes, if you want it for a non-NPCW (non-weapon) then have it something like:
NPC Code:if (created) setshape 1,1,1; That is just an example though ^^; You can tweak it how you want (for the script part I suggest just having the script a one line command called "join classname;" and then put your script of the npc you drop into a class called "classname") [EDIT] Quote:
IF putnpc where to be used (which it shouldn't be) you would save it in a folder with the levels folder (or levels it self) and then put into the folder options: "file *.txt" Or if it was in a sub folder in levels: "file subfoldername/*.txt" Notice you DON'T include the levels/ part as everything in folder ops automaticly includes that for you ;) [/EDIT] |
Quote:
Also, you're telling him to join 'classname' and to make a class called 'callname'. These should not be differently named... Edit: Thank you for fixing. ^_^ |
Quote:
|
Quote:
|
Quote:
Hehe. It's a paradox typo. It's wrong either way. |
Quote:
|
Eh eh eh?
Whats the
if ( strequals( #p(1),drop ) part for exactly? I cant get it to work, I cant get anything to work. You people confuse me. :eek: |
Quote:
For example, NPC Code: In the clientside part it would just be: NPC Code:triggeraction 0,0,serverside,WEAPONNAME,drop; NOTE: This will only work for weapons. And you don't NEED to use a parameter for this one, just that you asked so I answered ;). |
Quote:
|
It gives me error "expected format if (flag) command"
When I use if (strequals(#p(1),drop)) And its not a weapon anyhow... I tried this: if (strtofloat(#s(client.potions)) >=1) { if (playerchats && strequals(#c,drop)) { triggeraction 0,0,Bpotion,; } } if (actionBpotion){ setplayerprop #c,Dropped; sleep 0.1; setstring client.potions, #v(strtofloat(#s(client.potions))-1); putnpc2 potion.gif,playerx,playery,{if (created) {setshape 1,2,1;} if (playetouchsme){ setstring client.potions, #v(strtofloat(#s(client.potions))+1); destroy;}}} It doesnt even work ofline meh... |
if(actionserverside){
if(strequals(#p(1),wan)){ stuff } if(strequals(#p(2),wan2)){ more stuff here } } //#CLIENTSIDE if(weaponfired){ triggeraction 0,0,serverside,#w,wan,wan2; } #p = param triggeraction x,y,serverside,weaponame,param1,param2,param3,etc, etc,etc; |
I'll give it a shot.
NPC Code: This could all be done serverside though, and you wouldn't have to worry about triggeraction. NPC Code: Haven't tested it on a server so there is no guarantee that it will work. I do know that putnpc2 does not work offline. Not sure about triggeraction though. |
First learn to walk before trying to run, buddy.
|
| All times are GMT +2. The time now is 02:30 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.