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


Messages In This Thread
What have i done wrong? - by Frede - 05.12.2012, 17:51
Re: What have i done wrong? - by Mr.Anonymous - 05.12.2012, 17:54
Re: What have i done wrong? - by Frede - 05.12.2012, 17:56
Re: What have i done wrong? - by Frede - 05.12.2012, 18:11
Re: What have i done wrong? - by Mr.Anonymous - 05.12.2012, 18:39
Re: What have i done wrong? - by Frede - 05.12.2012, 18:42

Forum Jump:


Users browsing this thread: 1 Guest(s)