SA-MP Forums Archive
errors help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: errors help (/showthread.php?tid=345241)



errors help - kepa333 - 24.05.2012

heelo i have a problem with error 010: invalid function or declaration..

My Code:
Код:
#define FILTERSCRIPT
#include <a_samp>
new HasKokain[MAX_PLAYERS];

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(!strcmp("/loadkokain",cmdtext))
    {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, 951.5397, 2073.1101, 10.8203))
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                SendClientMessage(playerid,0xFFFFFFFF,"You Loaded heroin !");
                GetPlayerMoney(playerid);
                GivePlayerMoney(playerid, -6000);
				HasKokain[playerid] = 1;
            }
        }
    }
    return 1;
    }
	if (strcmp("/sellheroin", cmdtext))
    {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, 1423.9703, -1317.9305, 13.5547))
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                SendClientMessage(playerid,0xFFFFFFFF,"You Unloaded heroin !");
                GetPlayerMoney(playerid);
                GivePlayerMoney(playerid, 20000);
				HasKokain[playerid] = 0;
        }
        return 1;
    }
	return 0;
}
#endif
Error:
Код:
C:\Users\MaticKepa\Desktop\Raven's Roleplay 0.3d R2 V4.2\pawno\new.pwn(34) : error 010: invalid function or declaration
C:\Users\MaticKepa\Desktop\Raven's Roleplay 0.3d R2 V4.2\pawno\new.pwn(36) : error 010: invalid function or declaration
C:\Users\MaticKepa\Desktop\Raven's Roleplay 0.3d R2 V4.2\pawno\new.pwn(38) : error 010: invalid function or declaration
C:\Users\MaticKepa\Desktop\Raven's Roleplay 0.3d R2 V4.2\pawno\new.pwn(45) : error 010: invalid function or declaration
C:\Users\MaticKepa\Desktop\Raven's Roleplay 0.3d R2 V4.2\pawno\new.pwn(47) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.



Re: errors help - kepa333 - 24.05.2012

ANy ONE?


Re: errors help - Jarnu - 24.05.2012

pawn Код:
if (strcmp("/sellheroin", cmdtext))
replace it with
pawn Код:
if(strcmp("/sellheroin", cmdtext, true, 10) == 0)
same do with other. Edit: remove ";" as Romel Said ;p


Re: errors help - JaKe Elite - 24.05.2012

Jarnu you almost near to have the answer

replace

pawn Код:
if(strcmp("/sellheroin", cmdtext, true, 10) == 0);
with this

pawn Код:
if(strcmp("/sellheroin", cmdtext, true, 10) == 0)
i remove the ';'


Re: errors help - miley1 - 24.05.2012

lol 2 easy I didnt saw what was wrong otherwise i wouldt understand it lol


Re: errors help - SuperViper - 24.05.2012

You forgot a bracket on

pawn Код:
if(IsPlayerInAnyVehicle(playerid))
            {
                SendClientMessage(playerid,0xFFFFFFFF,"You Unloaded heroin !");
                GetPlayerMoney(playerid);
                GivePlayerMoney(playerid, 20000);
                HasKokain[playerid] = 0;
in your second command.

Also, to the posters above, you don't need to use that strcmp syntax but the poster did have it wrong. strcmp returns 1 when the strings don't match and it returns 0 when they do, so you should add a ! before your strcmp or a == 0 at the end.


Re: errors help - miley1 - 24.05.2012

ty !