error 010: invalid function or declaration
#1

I have a problem when compiling my script :/
Please help me, thanks

Код:
	    if(PlayerPaintballing[playerid] == 1)
	    {
			SetPlayerInterior(playerid, 0);
			SetPlayerVirtualWorld(playerid, 0);
	        GunsBeingRemoved[playerid] = 1;
         	ResetPlayerWeapons(playerid);
         	DestroyPickup(pbHealth);
          	SetPlayerHealth(playerid, 100);
    		SetPlayerArmour(playerid, 100);
		    new rand = random(sizeof(PaintballSpawns));
			SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
   			for (new i = 0; i < 13; i++)
			{
				GiveDodWeapon(playerid, pbGuns[2][0], 99999);
				GiveDodWeapon(playerid, pbGuns[3][0], 99999);
				GiveDodWeapon(playerid, pbGuns[4][0], 99999);
				GiveDodWeapon(playerid, pbGuns[5][0], 99999);
				GiveDodWeapon(playerid, pbGuns[6][0], 99999);
			}
			SetCameraBehindPlayer(playerid);
	    }
	}
	return 1;
}
Reply
#2

What is the problem ? What errors show you ?
Reply
#3

Код:
C:\Users\Bruker\Desktop\wow-yo\gamemodes\wwrp.pwn(32185) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

pawn Код:
forward playerpaintballing(playerid);
public playerpaintballing(playerid)
{

if(PlayerPaintballing[playerid] == 1)
        {
            SetPlayerInterior(playerid, 0);
            SetPlayerVirtualWorld(playerid, 0);
            GunsBeingRemoved[playerid] = 1;
            ResetPlayerWeapons(playerid);
            DestroyPickup(pbHealth);
            SetPlayerHealth(playerid, 100);
            SetPlayerArmour(playerid, 100);
            new rand = random(sizeof(PaintballSpawns));
            SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
            for (new i = 0; i < 13; i++)
            {
                GiveDodWeapon(playerid, pbGuns[2][0], 99999);
                GiveDodWeapon(playerid, pbGuns[3][0], 99999);
                GiveDodWeapon(playerid, pbGuns[4][0], 99999);
                GiveDodWeapon(playerid, pbGuns[5][0], 99999);
                GiveDodWeapon(playerid, pbGuns[6][0], 99999);
            }
            SetCameraBehindPlayer(playerid);
        }
}
Try this.

Usage EXAMPLE::
pawn Код:
CMD:paintball(playerid,params[])
{
    playerpaintballing(playerid);
    return 1;
}
Reply
#5

Posting the line that gave the error would be helpful..
Reply
#6

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Posting the line that gave the error would be helpful..
Код:
	    if(PlayerPaintballing[playerid] == 1)
	    {
			SetPlayerInterior(playerid, 0);
			SetPlayerVirtualWorld(playerid, 0);
	        GunsBeingRemoved[playerid] = 1;
         	ResetPlayerWeapons(playerid);
         	DestroyPickup(pbHealth);
          	SetPlayerHealth(playerid, 100);
    		SetPlayerArmour(playerid, 100);
		    new rand = random(sizeof(PaintballSpawns));
			SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
   			for (new i = 0; i < 13; i++)
			{
				GiveDodWeapon(playerid, pbGuns[2][0], 99999);
				GiveDodWeapon(playerid, pbGuns[3][0], 99999);
				GiveDodWeapon(playerid, pbGuns[4][0], 99999);
				GiveDodWeapon(playerid, pbGuns[5][0], 99999);
				GiveDodWeapon(playerid, pbGuns[6][0], 99999);
			}
			SetCameraBehindPlayer(playerid);
	    }
	}
	return 1; // This is the line which made the error.
}
Reply
#7

Post the whole block of code. If the closed brackets are more than the opened, it will give that error.
Reply
#8

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Post the whole block of code. If the closed brackets are more than the opened, it will give that error.
Pretty long....

Код:
stock SpawnChar(playerid)
{
    if(IsPlayerLoggedIn(playerid))
	{
	    // Legit Loyalty
	    if(!PlayerInfo[playerid][pLoyal] && PlayerInfo[playerid][pHours] < 24) {PlayerInfo[playerid][pLoyal] = 1;}
	    // Safe Admin
		if(PlayerInfo[playerid][pAdmin] && !PlayerInfo[playerid][pSafeAdmin] && !aDuty[playerid])
		{
		    new string[128];
		    format(string, sizeof(string), "%s (%s) has been flagged as an unsafe admin.", RPN(playerid), RPIP(playerid));
		    Log("logs/safeadmin.log", string);
		    Kick(playerid);
		}
	    // Tutorial
	    if(!PlayerInfo[playerid][pTutorial])
	    {
	        SetDodMoney(playerid, 0);
            GiveDodMoney(playerid, 10000);
            SetPlayerPos(playerid, 958.9146,-1411.4772,13.3833); // THE SPAWN
	        SetPlayerFacingAngle(playerid, 93.3274);
	        SetCameraBehindPlayer(playerid);
	        SetPlayerInterior(playerid, 0);
	        SetPlayerVirtualWorld(playerid, 0);
            ShowDialog(playerid, 0);
	        return 1;
	    }
	    TogglePlayerControllable(playerid, 1);
	    // Family Strikes
	    if(PlayerInfo[playerid][pFam])
	    {
	        new idx = PlayerInfo[playerid][pFam];
			if(FamInfo[idx][fStrikes] >= 3)
			{
			    PlayerInfo[playerid][pFam] = 0;
				PlayerInfo[playerid][pFamRank] = 0;
				SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your family has been disbanded due to having 3 strikes, you have been autokicked from the family.");
			}
	    }
	    // Website
	    TextDrawShowForPlayer(playerid, WebTD);
	    //C4
	    PreloadAnimLib(playerid, "BOMBER");
	    PreloadAnimLib(playerid, "PED");
		Pspawned[playerid] = 1;
		//neons
		neon[playerid] = 1;
		topened[playerid] = 0;
		CarHop[playerid] = 0;
		SpeedHack[playerid] = 0;
		sellgunlowmats[playerid] = 0;
		sellgunmedmats[playerid] = 0;
		sellgunhighmats[playerid] = 0;
		blowgun[playerid] = 0;
		fMeter[playerid] = 1;
	    //loginscreen exit
	    TextDrawHideForPlayer(playerid,Title);
	    TextDrawHideForPlayer(playerid,Box1);
	    TextDrawHideForPlayer(playerid,Box2);
	    TextDrawHideForPlayer(playerid,Bbox1);
	    TextDrawHideForPlayer(playerid,Bbox2);
	    TextDrawHideForPlayer(playerid,Sbox);
	    TextDrawHideForPlayer(playerid,Subtitle);
	    TextDrawHideForPlayer(playerid,message);
	    TextDrawHideForPlayer(playerid,GenMOTD);
	    TextDrawHideForPlayer(playerid,MainMenuTxtdraw[0]);
        TextDrawHideForPlayer(playerid,MainMenuTxtdraw[1]);
        TextDrawHideForPlayer(playerid,MainMenuTxtdraw[2]);
        TextDrawHideForPlayer(playerid,MainMenuTxtdraw[3]);
        TextDrawHideForPlayer(playerid,MainMenuTxtdraw[4]);
        TextDrawHideForPlayer(playerid,MainMenuTxtdraw[5]);
        TextDrawHideForPlayer(playerid,MainMenuTxtdraw[6]);
        TextDrawHideForPlayer(playerid,MainMenuTxtdraw[7]);
        TextDrawHideForPlayer(playerid,MainMenuTxtdraw[8]);
        TextDrawHideForPlayer(playerid,MainMenuTxtdraw[9]);
	    // Time
	    TextDrawShowForPlayer(playerid, TimeTD);
	    // Name Color & Level & Wanted Level
		SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
	    SetPlayerColor(playerid, TRANSPARENT_WHITE);
	    SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWanted]);
	    // Download bar
		Download[playerid] = CreateProgressBar(499.00, 103.00, 107.50, 3.20, -16776961, 100.0);
		SetProgressBarMaxValue(Download[playerid], 100);
		SetProgressBarColor(Download[playerid], COLOR_GREEN);
		// Custom Int
		if(PlayerInfo[playerid][pSpawnFreeze])
		{
		    SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
		}
	    // Business, House and Gates Checking
	    if(PlayerInfo[playerid][pBiz] != 0 && strcmp(RPNU(playerid), BizInfo[PlayerInfo[playerid][pBiz]][bOwner]) || PlayerInfo[playerid][pBiz] != 0 && !strlen(BizInfo[PlayerInfo[playerid][pBiz]][bOwner]))
	    {
			PlayerInfo[playerid][pBiz] = 0;
			SendClientMessage(playerid, COLOR_WHITE, " An administrator has sold your business while you were offline.");
	    }
	    if(PlayerInfo[playerid][pHouse] != 0 && strcmp(RPNU(playerid),  HouseInfo[PlayerInfo[playerid][pHouse]][hOwner]) || PlayerInfo[playerid][pHouse] != 0 && !strlen(HouseInfo[PlayerInfo[playerid][pHouse]][hOwner]))
	    {
			PlayerInfo[playerid][pHouse] = 0;
			SendClientMessage(playerid, COLOR_WHITE, " An administrator has sold your house while you were offline.");
	    }
	    new idx; idx = PlayerInfo[playerid][pGate][0]; // Gate slot 1
	    if(idx && !GateInfo[idx][gModel])
	    {
	        PlayerInfo[playerid][pGate][0] = 0;
	        SendClientMessage(playerid, COLOR_WHITE, " An administrator has deleted your gate in slot 1 while you were offline.");
	    }
	    idx = PlayerInfo[playerid][pGate][1]; // Gate slot 2
	    if(idx && !GateInfo[idx][gModel])
	    {
	        PlayerInfo[playerid][pGate][1] = 0;
	        SendClientMessage(playerid, COLOR_WHITE, " An administrator has deleted your gate in slot 2 while you were offline.");
	    }
	    idx = PlayerInfo[playerid][pGate][2]; // Gate slot 3
	    if(idx && !GateInfo[idx][gModel])
	    {
	        PlayerInfo[playerid][pGate][2] = 0;
	        SendClientMessage(playerid, COLOR_WHITE, " An administrator has deleted your gate in slot 3 while you were offline.");
	    }
	    // Spawning
	    if(PlayerInfo[playerid][pX] == 0 && PlayerInfo[playerid][pY] == 0 && PlayerInfo[playerid][pZ] == 0)
	    {
	        SetPlayerPos(playerid, 958.9146,-1411.4772,13.3833); // THE SPAWN D
	        SetPlayerFacingAngle(playerid, 93.3274);
	        SetCameraBehindPlayer(playerid);
	        SetPlayerInterior(playerid, 0);
	        SetPlayerVirtualWorld(playerid, 0);
	    }
	    else
	    {
		    SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
		    SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
		    SetCameraBehindPlayer(playerid);
		    SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
		    // HP and Armor
			if(PlayerInfo[playerid][pHealth] <= 0) PlayerInfo[playerid][pHealth] = 1;
			SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
			SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
	    }
	    // Skin
	    SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
	    // Guns
		for(new i = 0; i < 13; i++)
		{
		    if(PlayerInfo[playerid][pWeapon][i]) GiveDodWeapon(playerid, PlayerInfo[playerid][pWeapon][i], PlayerInfo[playerid][pWeaponAmmo][i]);
		}
		// Hospital
		if(!PlayerInfo[playerid][pPrison])
		{
			if(PlayerInfo[playerid][pHospital])
			{
			    if(eventdeath[playerid] == 1)
			    {
					SetPlayerPos(playerid, eX, eY, eZ);
					SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
					SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
					PlayerInfo[playerid][pHospital] = 0;
					SetPlayerHealth(playerid, eHP);
					SetPlayerArmour(playerid, eARMOR);
					SendClientMessage(playerid, COLOR_LIGHTRED, "*** You have died in the event,beter luck next time. ***");
					GunsBeingRemoved[playerid] = 1;
					ResetPlayerWeapons(playerid);
					GunsBeingRemoved[playerid] = 1;
					for(new w = 0; w < 13; w++)
					{
						GiveDodWeapon(playerid, PlayerInfo[playerid][pWeapon][w], PlayerInfo[playerid][pWeaponAmmo][w]);
					}
					eventdeath[playerid] = 0;
					return 1;
				}
				Hospital[playerid] = random(2);
				if(Hospital[playerid] == 0) // AllSaints
				{

				    SetPlayerPos(playerid, 1177.5485,-1323.5773,11.0761);
				    SetPlayerCameraPos(playerid,1223.2250,-1289.4913,31.9257);
				    SetPlayerCameraLookAt(playerid,1177.5485,-1323.5773,14.0761);
				}
				else if(Hospital[playerid] == 1) // County General
				{
				    SetPlayerPos(playerid, 2034.0833,-1404.6536,14.2539);
				    SetPlayerCameraPos(playerid,1997.1254,-1457.8685,34.8850);
				    SetPlayerCameraLookAt(playerid,2034.0833,-1404.6536,17.2539);
				}
				ResetDodWeapons(playerid);
				PlayerInfo[playerid][pFacDuty] = 0;
				SetPlayerInterior(playerid, 0);
			 	SetPlayerVirtualWorld(playerid, 0);
			    TogglePlayerControllable(playerid, 0);
				HospitalTime[playerid] = 30;
				if(PlayerInfo[playerid][pVIP] >= 2) HospitalTime[playerid] = 1;
				HospitalCountDown[playerid] = SetTimerEx("HospitalTimer", 1000, false, "d", playerid);
				}
			}
		}
		// LSPD Duty
        if(PlayerInfo[playerid][pFacDuty] && PlayerInfo[playerid][pFac] == 1)
        {
	    	SetPlayerColor(playerid, TRANSPARENT_BLUE);
		}
		// LSPD-Prison
		if(PlayerInfo[playerid][pPrison] == 1)
		{
		    ResetDodWeapons(playerid);
		    SetPlayerColor(playerid, TRANSPARENT_ORANGE);
			SetPlayerInterior(playerid, 1);
			new RandomCell = random(sizeof(RandomPrison));
			SetPlayerFacingAngle(playerid, RandomPrison[RandomCell][3]);
			TogglePlayerControllable(playerid, 0);
			SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
			SetPlayerPos(playerid, RandomPrison[RandomCell][0], RandomPrison[RandomCell][1], RandomPrison[RandomCell][2]);
			SetCameraBehindPlayer(playerid);
		}
		// Admin-Prison
		if(PlayerInfo[playerid][pPrison] == 2)
		{
			ResetDodWeapons(playerid);
		    SetPlayerColor(playerid, TRANSPARENT_ORANGE);
			SetPlayerInterior(playerid, 2);
			SetPlayerVirtualWorld(playerid, 1);
			new RandomCell = random(sizeof(RandomPrison));
			SetPlayerFacingAngle(playerid, RandomPrison[RandomCell][3]);
			TogglePlayerControllable(playerid, 0);
			SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
			SetPlayerPos(playerid, RandomPrison[RandomCell][0], RandomPrison[RandomCell][1], RandomPrison[RandomCell][2]);
			SetCameraBehindPlayer(playerid);
		}
		// Bank Robbery
		if(PlayerInfo[playerid][pFac] == 1 && RobberyStarted)
	    {
	        TextDrawShowForPlayer(playerid, Textdraw0);
			TextDrawShowForPlayer(playerid, Textdraw1);
	    	if(BankRobbersCount == 2) {TextDrawShowForPlayer(playerid, Textdraw2);}
			else if(BankRobbersCount == 3) {TextDrawShowForPlayer(playerid, Textdraw3);}
			else if(BankRobbersCount == 4) {TextDrawShowForPlayer(playerid, Textdraw4);}
			else if(BankRobbersCount == 5) {TextDrawShowForPlayer(playerid, Textdraw5);}
	    }
	    if(PlayerPaintballing[playerid] == 1)
	    {
			SetPlayerInterior(playerid, 0);
			SetPlayerVirtualWorld(playerid, 0);
	        GunsBeingRemoved[playerid] = 1;
         	ResetPlayerWeapons(playerid);
         	DestroyPickup(pbHealth);
          	SetPlayerHealth(playerid, 100);
    		SetPlayerArmour(playerid, 100);
		    new rand = random(sizeof(PaintballSpawns));
			SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
   			for (new i = 0; i < 13; i++)
			{
				GiveDodWeapon(playerid, pbGuns[2][0], 99999);
				GiveDodWeapon(playerid, pbGuns[3][0], 99999);
				GiveDodWeapon(playerid, pbGuns[4][0], 99999);
				GiveDodWeapon(playerid, pbGuns[5][0], 99999);
				GiveDodWeapon(playerid, pbGuns[6][0], 99999);
			}
			SetCameraBehindPlayer(playerid);
	    }
	}
	return 1;
}
Reply
#9

32 opened and 33 closed brackets. You got 1 more extra closed bracket and it's probably the one above return line (above the error line).
Reply
#10

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
32 opened and 33 closed brackets. You got 1 more extra closed bracket and it's probably the one above return line (above the error line).
Oh I got it now, thanks! I will +rep you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)