English Fry the meat using the pan - script

2 replies
Goto Page
To the start Previous 1 Next To the start
Up
RrR2010
User
Offline Off
I'm modifying a script that has two conditions to be met. He refers to the cooking of meat. I built a model gostariade pan and do the following process:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
//Fry!
     on:use {
     if ((count_inrange("state",5,50)+count_inrange("state",4,50))>0){
          if (getplayerweapon()==504){
               process "frying",500;
               fry;
               alteritem 1,10;
          }else{
               msg "I need fire and get pan in my hand to fry this!",3;

          }
     }
}


But when I press the button to use the item (E), mensangem only appears if I'm near the fire. If I'm away from the fire the message is not shown.

Note: The ID of my pan is 504

Write the correct script and explain it please

Model:
19.07.11 11:21:12 pm
Up
Hurri04
Super User
Offline Off
of course the message isnt shown when you are away from the fire since you didnt write an option for this case into the script.

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//Fry!
     on:use {
     if((count_inrange("state",5,50)+count_inrange("state",4,50))>0) {
          if(getplayerweapon()==504) {
               process "frying",500;
               fry;
               alteritem 1,10;
          }else{
                msg "I need to take the pan into my hand!", 3;
          }
     }else{
          msg "I need to be close to fire in order to cook!", 3;
     }
}


I divided both messages for the two possible cases for you to show you the difference.
also I fixed some little things in the syntax like the on:use in order to make it better readable.


More >
20.07.11 02:25:37 am
Up
RrR2010
User
Offline Off
Thanks bro. Its worked.

Im new to using scripts, but I want to know more about it.
If anyone have hints, send messages to me pls.
To the start Previous 1 Next To the start