Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Another Question (https://forums.graalonline.com/forums/showthread.php?t=7589)

Silver Knight 07-18-2001 09:52 PM

Another Question
 
I am making a way to get money on my server (not mining, not fishing, not diving, not bird catching) and I was unsure about part of the script. The part I was having trouble with was checking how many items you had collected.

if (playersays(Check not saying name so idea isnt stolen)) {setplayerprop #c,You have #s(#v(name)) itemname!;}

Shard_IceFire 07-18-2001 09:53 PM

Try this:
NPC Code:

if (playerchats&&strequals(#c,Check not saying name so idea isnt stolen)) {
setplayerprop #c,You have #s(#v(name)) itemname!;
}


Silver Knight 07-18-2001 10:12 PM

I was thinking of doing that, but I can't really test it because it won't work offline

Brady2 07-18-2001 10:53 PM

Jadis:

-sigh-
NPC Code:

if (playerchats&&strequals(#c,hi)) setplayerprop #c,You have #s(name) items you !@#$#@;


konidias 07-18-2001 11:15 PM

NPC Code:

if (playerchats && strequals(#c,item count)) {
setplayerprop #c,You have #s(client.itemcount) itemname(s)!;
}



There you go..

Jadis, you left out the {} plus mine is neater =D

Silver Knight 07-19-2001 12:14 AM

isn't client.whatever a npc server string?

KJS 07-19-2001 12:44 AM

lol
 
Quote:

Originally posted by konidias
NPC Code:

if (playerchats && strequals(#c,item count)) {
setplayerprop #c,You have #s(client.itemcount) itemname(s)!;
}



There you go..

Jadis, you left out the {} plus mine is neater =D

you dont need {} if you only dealing with one thing like

if(playerchats&&strequals(#c,test))
say2 test;

see you wouldn't need them because you only have 1 thing in there but if you do more then 1 thing then you have to use the {}

like

if(playerchats&&strequals(#c,test)){
say2 test;
message test;
}

ownerofbabylon 07-19-2001 01:17 AM

LOL

konidias 07-19-2001 02:48 AM

It's always nice to have them though.. and "client.itemcount" means its a clientside variable.. its not serverside.. its a value stored on the clients side =)


All times are GMT +2. The time now is 08:55 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.