Couple Errors
#1

hi im making some dm zones and in OnPlayerSpawn i made this code
Код:
public OnPlayerSpawn(playerid)
{
	if(minigun[playerid] == 1)
	{
	GivePlayerWeapon(playerid, 38, 9999);
	new iRandom = random(sizeof(MiniRandSpawn));
	SetPlayerPos(playerid, MiniRandSpawn[iRandom][0], MiniRandSpawn[iRandom][1],MiniRandSpawn[iRandom][2]);
	SetPlayerFacingAngle(playerid, MiniRandSpawn[iRandom][3]);
	}
	else if(cagedm[playerid] == 1)
	GivePlayerWeapon(playerid, 24, 9999);
	GivePlayerWeapon(playerid, 27, 9999);
	GivePlayerWeapon(playerid, 29, 9999);
	GivePlayerWeapon(playerid, 31, 9999);
	new iRandom = random(sizeof(CageRandSpawn));
	SetPlayerPos(playerid, CageRandSpawn[iRandom][0], CageRandSpawn[iRandom][1],CageRandSpawn[iRandom][2]);
	SetPlayerFacingAngle(playerid, CageRandSpawn[iRandom][3]);
	}
133	else if(area51[playerid] == 1);
	{
	GivePlayerWeapon(playerid, 24, 9999);
	GivePlayerWeapon(playerid, 27, 9999);
	GivePlayerWeapon(playerid, 29, 9999);
	GivePlayerWeapon(playerid, 31, 9999);
	GivePlayerWeapon(playerid, 16, 9999);
	SetPlayerPos(playerid, AreaRandSpawn[iRandom][0], AreaRandSpawn[iRandom][1],AreaRandSpawn[iRandom][2]);
	SetPlayerFacingAngle(playerid, AreaRandSpawn[iRandom][3]);
142  return 1;
}
and get these errors
Код:
C:\Users\Windows Vista\sampserver\gamemodes\Cranked.pwn(133) : error 010: invalid function or declaration
C:\Users\Windows Vista\sampserver\gamemodes\Cranked.pwn(142) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
anyone know anything?
Reply
#2

Change:
pawn Код:
else if(area51[playerid] == 1);
To:
pawn Код:
else if(area51[playerid] == 1)
Reply
#3

same errors same lines
Reply
#4

anyone? this seems simple to everyone else, not to me
Reply
#5

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(minigun[playerid] == 1)
    {
      GivePlayerWeapon(playerid, 38, 9999);
      new iRandom = random(sizeof(MiniRandSpawn));
      SetPlayerPos(playerid, MiniRandSpawn[iRandom][0], MiniRandSpawn[iRandom][1],MiniRandSpawn[iRandom][2]);
      SetPlayerFacingAngle(playerid, MiniRandSpawn[iRandom][3]);
    }
    else if(cagedm[playerid] == 1)
    { // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< this
      GivePlayerWeapon(playerid, 24, 9999);
      GivePlayerWeapon(playerid, 27, 9999);
      GivePlayerWeapon(playerid, 29, 9999);
      GivePlayerWeapon(playerid, 31, 9999);
      new iRandom = random(sizeof(CageRandSpawn));
      SetPlayerPos(playerid, CageRandSpawn[iRandom][0], CageRandSpawn[iRandom][1],CageRandSpawn[iRandom][2]);
      SetPlayerFacingAngle(playerid, CageRandSpawn[iRandom][3]);
    }
    else if(area51[playerid] == 1)
    {
      GivePlayerWeapon(playerid, 24, 9999);
      GivePlayerWeapon(playerid, 27, 9999);
      GivePlayerWeapon(playerid, 29, 9999);
      GivePlayerWeapon(playerid, 31, 9999);
      GivePlayerWeapon(playerid, 16, 9999);
      SetPlayerPos(playerid, AreaRandSpawn[iRandom][0], AreaRandSpawn[iRandom][1],AreaRandSpawn[iRandom][2]);
      SetPlayerFacingAngle(playerid, AreaRandSpawn[iRandom][3]);
    } // <<<<<<<<<<<<<<<<<<<<<<<<<<<< this
    return 1;
}
That's why you should indent your code .
Reply
#6

Thank You Very Much SAWC!!!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)