View Single Post
  #4  
Old 08-24-2005, 01:15 AM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
Keep the money that's in that safe in a serverr. string.

NPC Code:
if (playerchats && strequals(#c,/paycheck)) {



Ok, so

NPC Code:
if (playerchats ...



This is detected when enter is hit entering a message.

NPC Code:
&& strequals(#c,/paycheck)) {



&& is just another way of saying and in scripting. So far we have 'if the player enters a message and'. strequals is used to determine what a player has. In this case, it's looking for something the player is saying (notice #c). So, if the player enters a message and the player's chat text is '/paycheck', what is written in the bracers will take place.

NPC Code:
if (playerchats && strequals(#c,/paycheck)) {
playerrupees += 250;
setstring 'serverr.strings',strtofloat(#s('serverr.strings') ) - 250;
}



Of course, you will have to add another flag in there to test whether the safe has 250g or not; but that's your job.
Reply With Quote