Forum

> > Stranded II > Scripts > Fry the meat using the pan - script
ForenübersichtStranded II-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Fry the meat using the pan - script

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Fry the meat using the pan - script

RrR2010
User Off Offline

Zitieren
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:
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:

alt Re: Fry the meat using the pan - script

Hurri04
Super User Off Offline

Zitieren
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.

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.


Mehr >
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtStranded II-ÜbersichtForenübersicht