Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. The main problem right now is that you're doing everything clientside, which means it's running on the player's (the Events Team member's) computer. It can't interact very well with other players here (things like collecting other players' chat, etc.).
- In short, you need to move the important non-UI bits (storing the answer, checking the answer against player guesses) to serverside, and handle only the UI stuff (the interface where the ET inputs the question and answer) on clientside.
- You have to communicate using triggers. There's a reasonable explanation of triggers and serverside/clientside on [URL="http://forums.graalonline.com/forums/showpost.php?p=1579584&postcount=6"]this post[/URL]. [URL="http://forums.graalonline.com/forums/showpost.php?p=1541241&postcount=9"]This post[/URL] gives an example of communicating with an NPC (rather than, say, a weapon script).
- 2. The rough equivalent of PHP's explode is the tokenize function:
- [PHP]
- temp.str = "abc def ghi";
- temp.tokens = temp.str.tokenize(); // first parameter defaults to a space if not given
- echo(temp.tokens[1]); // echoes def
- temp.tokens = temp.str.tokenize("e"); // you can also specify the delimiter if you prefer
- echo(temp.tokens[1]); // echoes f ghi
- [/PHP]
- Note that there is an odd restriction that the delimiter can only be one character in length.
- 3. To show an image on a level, you use showimgs. You can either use the old-style syntax like showimg(idx, x, y, image) (and then changeimgpart to achieve what you want) or use findImg. I prefer the latter:
- [PHP]
- // 200 is the index; each image needs an index, which must be unique only
- // for the current script
- //
- // indexes below 200 are usually shown to other players (there are some restrictions
- // so this is not always true), indexes >= 200 are only shown to the current player
- with (findImg(200)) {
- image = "block.png";
- x = 32;
- y = 32;
- partx = 32; // x offset of the subimage relative to the top left corner
- party = 0; // y offset of the subimage
- partw = 32; // width of the subimage
- parth = 32; // height of the subimage
- }
- [/PHP]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement