Undefined symbol
#1

Код:
C:\Users\Bear\Documents\AutomaticSolution Software\gamemodes\gamemode.pwn(55232) : error 017: undefined symbol "DropInfo"
C:\Users\Bear\Documents\AutomaticSolution Software\gamemodes\gamemode(55232) : error 036: empty statement
C:\Users\Bear\Documents\AutomaticSolution Software\gamemodes\gamemode(55232) : error 017: undefined symbol "i"
C:\Users\Bear\Documents\AutomaticSolution Software\gamemodes\gamemode(55232) : fatal error 107: too many error messages on one line

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


4 Errors.
Код:
dcmd_pickup(playerid, params[])
{
    new string[128];
	for(new i = 0; i < sizeof(DropInfo); i++)
	{
		if (IsPlayerInRangeOfPoint(playerid, 2.0,DropInfo[i][DropGunPosX],DropInfo[i][DropGunPosY],DropInfo[i][DropGunPosZ]))
		{
			if(GetPlayerVirtualWorld(playerid) == DropInfo[i][DropGunVWorld] && GetPlayerInterior(playerid) == DropInfo[i][DropGunVWorld])
			{
				new sendername[MAX_PLAYER_NAME];
				GetPlayerRPName(playerid, sendername, sizeof(sendername));
				DestroyDynamicObject(DropObject[i]);
				GivePlayerWeaponEx(playerid,DropInfo[i][DropGunAmmount][0],DropInfo[i][DropGunAmmount][1]);
				DropInfo[i][DropGunPosX] = 0.0;
				DropInfo[i][DropGunPosY] = 0.0;
				DropInfo[i][DropGunPosZ] = 0.0;
				DropInfo[i][DropGunAmmount][0] = 0;
				DropInfo[i][DropGunAmmount][1] = 0;
				format(string, sizeof(string), "* %s picks up a weapon.", sendername);
				SendLocalMessage(playerid, string, 10.0, COLOR_ACTION, COLOR_ACTION);
				return 1;
			}
		}
	}
	return 1;
}
Reply
#2

You are using a forloop
PHP код:
dcmd_pickup(playeridparams[])
{
    new 
string[128];
    for(new 
0MAX_PLAYERSi++)
    {
        if (
IsPlayerInRangeOfPoint(i2.0,DropInfo[i][DropGunPosX],DropInfo[i][DropGunPosY],DropInfo[i][DropGunPosZ]))
        {
            if(
GetPlayerVirtualWorld(i) == DropInfo[i][DropGunVWorld] && GetPlayerInterior(i) == DropInfo[i][DropGunVWorld])
            {
                                 
                new 
sendername[MAX_PLAYER_NAME];
                
GetPlayerRPName(playeridsendernamesizeof(sendername));
                
DestroyDynamicObject(DropObject[i]);
                
GivePlayerWeaponEx(playerid,DropInfo[i][DropGunAmmount][0],DropInfo[i][DropGunAmmount][1]);
                
DropInfo[i][DropGunPosX] = 0.0;
                
DropInfo[i][DropGunPosY] = 0.0;
                
DropInfo[i][DropGunPosZ] = 0.0;
                
DropInfo[i][DropGunAmmount][0] = 0;
                
DropInfo[i][DropGunAmmount][1] = 0;
                
format(stringsizeof(string), "* %s picks up a weapon."sendername);
                
SendLocalMessage(playeridstring10.0COLOR_ACTIONCOLOR_ACTION);
                return 
1;
            }
        }
    }
    return 
1;

Reply
#3

Quote:
Originally Posted by WhiteGhost
Посмотреть сообщение
You are using a forloop
PHP код:
dcmd_pickup(playeridparams[])
{
    new 
string[128];
    for(new 
0MAX_PLAYERSi++)
    {
        if (
IsPlayerInRangeOfPoint(i2.0,DropInfo[i][DropGunPosX],DropInfo[i][DropGunPosY],DropInfo[i][DropGunPosZ]))
        {
            if(
GetPlayerVirtualWorld(i) == DropInfo[i][DropGunVWorld] && GetPlayerInterior(i) == DropInfo[i][DropGunVWorld])
            {
                                 
                new 
sendername[MAX_PLAYER_NAME];
                
GetPlayerRPName(playeridsendernamesizeof(sendername));
                
DestroyDynamicObject(DropObject[i]);
                
GivePlayerWeaponEx(playerid,DropInfo[i][DropGunAmmount][0],DropInfo[i][DropGunAmmount][1]);
                
DropInfo[i][DropGunPosX] = 0.0;
                
DropInfo[i][DropGunPosY] = 0.0;
                
DropInfo[i][DropGunPosZ] = 0.0;
                
DropInfo[i][DropGunAmmount][0] = 0;
                
DropInfo[i][DropGunAmmount][1] = 0;
                
format(stringsizeof(string), "* %s picks up a weapon."sendername);
                
SendLocalMessage(playeridstring10.0COLOR_ACTIONCOLOR_ACTION);
                return 
1;
            }
        }
    }
    return 
1;

So how can I fix this problem? I'm sorry but I suck at this. I still get the problem with the code you gave me. It keeps saying (55234) : error 017: undefined symbol "DropInfo"
Reply
#4

Well, just read the error carefully :
Quote:

error 017: undefined symbol "DropInfo"

Is DropInfo even declared in the script?
If yes then it must be declared globally, i.e., out of all stocks and public functions, probably somewhere in the top region of the script..
Reply
#5

Quote:
Originally Posted by [cS]Owain
Посмотреть сообщение
Well, just read the error carefully :

Is DropInfo even declared in the script?
If yes then it must be declared globally, i.e., out of all stocks and public functions, probably somewhere in the top region of the script..
Код:
enum dData
{
	DropGunAmmount[2],//ModelID & Bullets
	Float:DropGunPosX,
	Float:DropGunPosY,
	Float:DropGunPosZ,
	DropGunVWorld,
	DropGunInterior,
};
new DropInfo[MAX_DROP_ITEMS][dData];
Is this not correct? And yes it is on top of the script, pretty much
Reply
#6

Fixed it. Seemed that it was too far up, I'm a bit of an idiot. I have given you both reputation, thank you very much guys!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)