AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Plugin connect script help (https://forums.alliedmods.net/showthread.php?t=27376)

kmal2t 04-21-2006 02:09

Plugin connect script help
 
asdf

FatalisDK 04-21-2006 03:16

1. You can't check if file exists on client.
2. You can't precache zip files.

kmal2t 04-21-2006 04:03

Ok, wait. Isn't that what that plugin above does? !if file_exists()? What's that then? How does STEAM know to make you download the file if it doesn't know whether or not you have the file?

And if you can't use sv_downloadurl with zip files that doesn't matter since I can still add an empty ini or cfg or something in the zip that when extracted I can use to for detection.

Zenith77 04-21-2006 17:36

file_exists() checks to see if the server has the file. The engine decides when a client needs to download a file if a file has been precached, and the file is not found in the specifed location.


Based on the statement above, I think you mis-understood EKS's code.

Code:
if(!file_exists(OverViewFile))     {         log_amx("Missing overview file for %s ( should be in: %s )",MapName,OverViewFile)             }

The following code checks to see if the file exists on the server. If the file is not detected, then the plugin will make output a message to the log file (log_amx()) The reason for this if-statement is to make sure the file exists before precaching it, or else if we do this and the file isn't there, the server will crash.


Code:
else         precache_generic(OverViewFile)

If the if-statement's requirements above are not meet, it then go to the else statement, meaning the file was found. The plugin then tells the engine to precache the file. As stated before, if the engine does not detect the file on a connecting client, it will download it.

Hope this clears everything up

kmal2t 04-21-2006 20:23

brawr

v3x 04-21-2006 22:43

To precache a sprite you would use precache_model.

kmal2t 04-22-2006 00:26

???

I don't want to precache a sprite. Since apparently you can't use zip files for sv_downloadurl I want to be able to give people a message before they try to download shit so I can redirect them to download the zip. There must be some way to do this.

Twilight Suzuka 04-22-2006 00:34

Sorry. There isn't an easy way.


All times are GMT -4. The time now is 05:14.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.