What have i done wrong?
#1

i found a fly script called fly.inc. It is very nice, but i only want to allowed it when i want to allow it so... i made some changes in the script. Now i get a Error: ...\fly.pwn(41) : error 029: invalid expression, assumed zero.
what have i done wrong? here is the wrole code:
Код:
#include <a_samp>
#include <fly>

new adminfly;
public OnFilterScriptInit()
{
	print("=========================================\n");
	print("Fly include demo FS by Norck");
	print(" ");
	print("=========================================\n");
	return 1;
}
public OnGameModeInit()
{
	adminfly = 1;
	return 1;
}
public OnPlayerConnect(playerid)
{
	InitFly(playerid);
	return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(!strcmp(cmdtext,"/enablefly",true))
	{
	    if(IsPlayerAdmin(playerid))
		{
			adminfly = 2;
  			return 1;
		}
	}
	if(!strcmp(cmdtext,"/disablefly",true))
	{
	    adminfly = 1;
	    return 1;
	}
	if(!strcmp(cmdtext,"/fly",true))
	{
	    if adminfly == 2
	    {
			StartFly(playerid);
			return 1;
		}
  		else SendClientMessage(playerid, 0xFFFFFFAA, "ERROR: You have to ask a owner to enable /fly!");
		return 1;
	}
	if(!strcmp(cmdtext,"/stopfly",true))
	{
	    StopFly(playerid);
	    return 1;
	}
	return 0;
}
Line 41:
Код:
	if(!strcmp(cmdtext,"/fly",true))
	{
	    if adminfly == 2 //I think the mistake is here
	    { //This is line 41
			StartFly(playerid);
			return 1;
		}
  		else SendClientMessage(playerid, 0xFFFFFFAA, "ERROR: You have to ask a owner to enable /fly!");
		return 1;
	}
Please help me i cant get it to work.
Reply
#2

On line 41 you made a mistake. It should be
pawn Код:
if (adminfly == 2)
Reply
#3

Ty that was very needed
Now it is compiled
Reply
#4

Now i have a new problem. This is how the script looks like now.
Код:
#include <a_samp>
#include <fly>

new adminfly;
public OnFilterScriptInit()
{
	print("=========================================\n");
	print("Fly include demo FS by Norck");
	print(" ");
	print("=========================================\n");
	return 1;
}
public OnGameModeInit()
{
	adminfly = 1;
	return 1;
}
public OnPlayerConnect(playerid)
{
	InitFly(playerid);
	return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(!strcmp(cmdtext,"/enablefly",true))
	{
	    if(IsPlayerAdmin(playerid))
		{
			adminfly = 2;
  			return 1;
		}
	}
	if(!strcmp(cmdtext,"/disablefly",true))
	{
	    adminfly = 1;
	    return 1;
	}
	if(!strcmp(cmdtext,"/fly",true))
	{
	    if (adminfly == 2)
	    {
			StartFly(playerid);
			return 1;
		}
  		else SendClientMessage(playerid, 0xFFFFFFAA, "ERROR: You have to ask a owner to enable /fly!");
		return 1;
	}
	if(!strcmp(cmdtext,"/stopfly",true))
	{
	    StopFly(playerid);
	    return 1;
	}
	return 0;
}
When i go ingame and type "/enablefly" then i get a unknow command message back whats wrong?
Reply
#5

I guess its because

pawn Код:
if(IsPlayerAdmin(playerid))
and you need to login from rcon.
Reply
#6

no i found out why it was because i saved it the wrong place but ty anyway
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)