I Came up with the idea to make a mob play a certian song a user wants, i want to make it so they cant play wavs or big files to lag the game
could anyone tell me how to do this or point me in the right direction? Thank you.
ID:268020
![]() Feb 16 2004, 9:14 am
|
|
![]() Feb 16 2004, 9:14 am
|
|
Nope. You can't check file sizes. Of course, in reality, this thing doesn't add anything to the game, and is a great tool for being annoying, so why even bother?
|
If you're going to be making a game and playing it with an untrustable crowd, its best to leave uploading of files out totally. There are always people who just want to ruin the game, and allowing them to upload files provides an easy means of doing that.
BYOND doesn't have any way to check filesizes that I'm aware of. |
well if i cant block off a certian size is there a way to make it so they cant play a certian file such as .wav's?
|
You can use findtext() to check if .mid is found in the filename. But a malicious player will just change the name of a large .wav and play it anyway.
|
However, I can't think of any way for a player to check the size of a file without uploading it first :P
|
Foomer wrote:
However, I can't think of any way for a player to check the size of a file without uploading it first :P well then can you help me with the code i posted above? :) |
Vash_616 wrote:
> if(findtext("[S].mid")) Ok, what is the first thing you do when the compiler says there's an error? Especially when it tells you exactly what's wrong? Right, you press F1 to go to the built in help file. There we will find that findtext does indeed take two to four arguments. The required two are the text to search, and the text to search for. In other words, findtext looks for text_to_find in text_to_search. Let's look at an example using those variable names: findtext(text_to_search,text_to_find) Seem a bit clearer now? You'll want to use findtext("[S]",".mid") However, even then I don't think it will work. S as sound is calling for a file object, not a text value. Try using file(), a text variable for a file name, and the sound() proc. Also, as a side note, you'll want to close all those open HTML tags in the text, and possible keep your capital letters restricted to the beginning of a sentence and proper nouns. |
its clear and its now working thank you so much sapphiremagus. but one last thing
for(var/mob/M in world) i want all the players in the worlds vars to change and that code isnt doing it,any ideas why? |
Vash_616 wrote:
its clear and its now working thank you so much sapphiremagus. but one last thing > for(var/mob/M in world) i want all the players in the worlds vars to change and that code isnt doing it,any ideas why? run time errors or what? |
Vash_616 wrote:
not an error or anything its just the var wont change please help if you can no clue lol sorry. |
I rememeber when you posted your code (which I can't see for some reason??), just below that for loop you had another one which made it set back to 0 so it would be 1 for about... 0.001 seconds or so.So that means that it wouldn't change, that's your problem.
|
Wanabe wrote:
I rememeber when you posted your code (which I can't see for some reason??), just below that for loop you had another one which made it set back to 0 so it would be 1 for about... 0.001 seconds or so.So that means that it wouldn't change, that's your problem. M.musicplaying=1 i dont believe thats 0.001 seconds =/ |