errors help
#1

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.
Reply
#2

ANy ONE?
Reply
#3

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
Reply
#4

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 ';'
Reply
#5

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

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.
Reply
#7

ty !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)