Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   headexists(); (https://forums.graalonline.com/forums/showthread.php?t=79983)

Frankie 06-08-2008 02:08 AM

headexists();
 
there's a function used in our personal head system on Era that checks if the "headexists" obviously. I don't know if this is a default function or a public function that was scripted into Era, because I'm trying to make personal hats but I only want people able to set their hat if the hat exists in our hat folder, this way people can't load hats off their computer harddrive.

cbk1994 06-08-2008 02:28 AM

headexists(str) - returns boolean

from the Wiki.

You'd have to make your own system to detect hats.

I recommend something like this:

PHP Code:

function hatExistshat )
{
  
temp.hats.loadFolder"levels/images/hats/*"false );
  return 
hats.index( @ hat ) != -1;


That should work, though I haven't tested it.

The NPC-server will need read rights to the hats folder.

DustyPorViva 06-08-2008 02:36 AM

There is a fileexists, and a bodyexists. I believe Stefan recommended bodyexists for detecting hats... either way, both have to be done on the serverside. Mess around with them to see which one you want to use.

Frankie 06-08-2008 04:21 AM

the one chris provided works fine.
thanks

DustyPorViva 06-08-2008 04:21 AM

Why use a custom system when are are already functions for it?

cbk1994 06-08-2008 04:24 AM

Quote:

Originally Posted by Frankie (Post 1395367)
the one chris provided works fine.
thanks

You're welcome, but if there is already a function for it, I recommend that since it is likely to be less laggy.


All times are GMT +2. The time now is 10:57 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.