05.12.2012, 17:51
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:
Line 41:
Please help me i cant get it to work.
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;
}
Код:
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;
}

