[HELP] enum
#1

Hey there.
I am using Godfather and I think I have a problem with my enums.

pawn Код:
#define MAX_SPIKESTRIPS 50
pawn Код:
enum sInfo
{
  sCreated,
  Float:sX,
  Float:sY,
  Float:sZ,
  sObject,
};
new SpikeInfo[MAX_SPIKESTRIPS][sInfo];
Now when I try using this function:

pawn Код:
if (strcmp(cmd,"/createstrip",true) == 0)
    {
      new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateStrip(plocx,plocy,plocz,ploca);
    SendClientMessage(playerid, COLOR_WHITE, "You have created a spike!");
      return 1;
    }
pawn Код:
stock CreateStrip(Float:x,Float:y,Float:z,Float:Angle)
{
  for(new i = 0; i < sizeof(SpikeInfo); i++)
    {
      if(SpikeInfo[i][sCreated] == 0)
      {
      SpikeInfo[i][sCreated]=1;
      SpikeInfo[i][sX]=x;
      SpikeInfo[i][sY]=y;
      SpikeInfo[i][sZ]=z-0.7;
      SpikeInfo[i][sObject] = CreateObject(2899, x, y, z-0.9, 0, 0, Angle-90);
        return 1;
      }
    }
    return 0;
}
Nothing happens, I can see the message but it didn't really change the cordinations.
It happens only in this script and I don't know even why. I tried it on LVDM and it worked perfectly.
Is there something that might affect in the Godfather script?
Reply
#2

Check if there are any other enum's named sInfo, just to make sure something doesn't collide.
Reply
#3

Quote:
Originally Posted by ettans
Check if there are any other enum's named sInfo, just to make sure something doesn't collide.
Thanks for trying to help but it is not the problem, I checked and there is only one sInfo and SpikeInfo at the script. the MAX_PLAYERS enums work I think, I tried to do something with a bomb and it didn't work too.
I also tried to use it as an include and the same thing happend.
Reply
#4

BUMP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)