I need help on scripting.
#1

Hello, this is my first thread so first time doing this, so bare with me.

I am getting am error from the /spawnnpc command on vortex.

Error:
Quote:

error 017: undefined symbol "file_actually_exists"

Full script:
Код:
command(spawnnpc, playerid, params[])
{
	new string[128], NPCName[128];
	if(sscanf(params, "z", NPCName))
	{
	    if(Player[playerid][AdminLevel] >= 1)
	    {
			SendClientMessage(playerid, WHITE, "SYNTAX: /spawnnpc [script name]");
		}
	}
	else
	{
	    if(Player[playerid][AdminLevel] >= 5)
	    {
		    format(string, sizeof(string), "npcmodes/recordings/%s.rec", NPCName);

		    if(file_actually_exists(string))
		    {
		        format(string, sizeof(string), "NPC_%d", NPCs+1);
		        ConnectNPC(string, NPCName);
		    }
		    else
		    {
		        SendClientMessage(playerid, WHITE, "That recording / script doesn't exist.");
		    }
	    }
	}
	return 1;
}
Reply
#2

Define this
PHP код:
file_actually_exists 
Reply
#3

I did and now I get this

Код:
 error 033: array must be indexed (variable "string")
From this line
Код:
if(file_actually_exists(string))
Reply
#4

Anything?
Reply
#5

Bump
Reply
#6

How have you defined "file_actually_exists"?
Reply
#7

PHP код:
#define                 file_actually_exists 
That's what I have
Reply
#8

https://sampwiki.blast.hk/wiki/Fexist
Reply
#9

Quote:
Originally Posted by ChromeMenu
Посмотреть сообщение
PHP код:
#define                 file_actually_exists 
That's what I have
Right, now it's found "file_actually_exists" It's taking that file_actually_exists has a parameter, but you've defined it as nothing. What it's looking for is for you to define it as a function using stock or public. What Conroy has given you would be the most viable change, or you could create a function which requires a parameter.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)