(i) Problem Help
#1

Hello Guys i can't find where is the problem help me



Код:
C:\Documents and Settings\magnifique2012\Bureau\zm.pwn(365) : error 017: undefined symbol "i"
C:\Documents and Settings\magnifique2012\Bureau\zm.pwn(365) : warning 215: expression has no effect
C:\Documents and Settings\magnifique2012\Bureau\zm.pwn(365) : error 017: undefined symbol "i"
C:\Documents and Settings\magnifique2012\Bureau\zm.pwn(365) : warning 215: expression has no effect
C:\Documents and Settings\magnifique2012\Bureau\zm.pwn(365) : error 017: undefined symbol "i"
C:\Documents and Settings\magnifique2012\Bureau\zm.pwn(365) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Line 365:


Код:
function StartMap()
{
    new str[128];
    foreach(Player,i)
	{
        SetCameraBehindPlayer(i);
	    ClearAnimations(i);
		HumanSetup(i);
		SpawnPlayer(i);
		SetPlayerDrunkLevel(i,0);
		DisablePlayerCheckpoint(i);
		TextDrawHideForPlayer(i, ServerIntroOne[i]);
		TextDrawHideForPlayer(i, ServerIntroTwo[i]);
		DestroyPickup(meatDrops[i]);
		DestroyPickup(ammoDrops[i]);
		TogglePlayerControllable(i,1);
	}
i will + Rep
Reply
#2

pawn Код:
function StartMap()
{
    new str[128];
    for(new i=0;i <MAX_PLAYERS;i++)
    {
        SetCameraBehindPlayer(i);
        ClearAnimations(i);
        HumanSetup(i);
        SpawnPlayer(i);
        SetPlayerDrunkLevel(i,0);
        DisablePlayerCheckpoint(i);
        TextDrawHideForPlayer(i, ServerIntroOne[i]);
        TextDrawHideForPlayer(i, ServerIntroTwo[i]);
        DestroyPickup(meatDrops[i]);
        DestroyPickup(ammoDrops[i]);
        TogglePlayerControllable(i,1);
    }
}
Reply
#3

doesn't work
Reply
#4

Well you have to declare the variable i if you want to use it.
Also, I think you should use foreach like this:
pawn Код:
foreach (i : Player)
// or even better
foreach (new i : Player)
Reply
#5

Quote:
Originally Posted by samp_boy
Посмотреть сообщение
doesn't work
What errors u get?
Reply
#6

Quote:
Originally Posted by Madd92
Посмотреть сообщение
Well you have to declare the variable i if you want to use it.
Also, I think you should use foreach like this:
pawn Код:
foreach (i : Player)
// or even better
foreach (new i : Player)
still doesn't work :/
Reply
#7

Quote:
Originally Posted by JFF
Посмотреть сообщение
What errors u get?

same errors
Reply
#8

Quote:
Originally Posted by samp_boy
Посмотреть сообщение
same errors
That is not possible really, since you have declared i now.
So this error shouldn't occur anymore:
pawn Код:
C:\Documents and Settings\magnifique2012\Bureau\zm.pwn(365) : error 017: undefined symbol "i"
pawn Код:
function StartMap()
{
    new str[128];
    foreach(new i : Player)
    {
        SetCameraBehindPlayer(i);
        ClearAnimations(i);
        HumanSetup(i);
        SpawnPlayer(i);
        SetPlayerDrunkLevel(i,0);
        DisablePlayerCheckpoint(i);
        TextDrawHideForPlayer(i, ServerIntroOne[i]);
        TextDrawHideForPlayer(i, ServerIntroTwo[i]);
        DestroyPickup(meatDrops[i]);
        DestroyPickup(ammoDrops[i]);
        TogglePlayerControllable(i,1);
    }
}
Should work if you are using the right include.
Reply
#9

Код:
#include <foreach>
At the top of your gamemode.
Reply
#10

Madd92: lemme pm u the full code
Rittik: lol i have already did
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)