error 028: invalid subscript (not an array or too many subscripts): "playerinfo"
#1

error 028: invalid subscript (not an array or too many subscripts): "playerinfo"

PHP код:
    if(GetPlayerSkin(playerid) != playerinfo[playerid][pSkin])
    {
        
SetPlayerSkin(playerid,playerinfo[playerid][pSkin]);
        
SCM(playerid,COLOR_RED,"Please you does not use skin hack");
    } 
Help me !
Reply
#2

Are you sure it's not "PlayerInfo"?
Reply
#3

Yes sure ,

PHP код:
enum playerinfo
{
    
Username[24],
    
Password[128],
    
aMoney,
    
pLevel,
    
pXP,
    
Headshots,
    
PlayersKilled,
    
ZombiesKilled,
    
pAdminLevel,
    
pPremium,
     
Float:pX,
    
Float:pY,
    
Float:pZ,
    
pWeap1,
    
pAmmo1,
    
pWeap2,
    
pAmmo2,
    
pWeap3,
    
pAmmo3,
    
pWeap4,
    
pAmmo4,
    
pWeap5,
    
pAmmo5,
    
pWeap6,
    
pAmmo6,
    
pWeap7,
    
pAmmo7,
    
pWeap8,
    
pAmmo8,
    
pWeap9,
    
pAmmo9,
    
pHour,
    
pMin,
    
pSec,
    
pHealth,
    
pFirstSpawn,
    
pAliveTime,
    
pSkin,
    
pIsInFaction,
    
pFactionID,
    
IfSeenIntro,
    
IsPlayerSpawned,
    
IsPlayerMuted,
    
pPM,
    
pWarnings,
    
pUserID,
    
pTemp,
    
pProne,
    
pSaveSpam,
    
IsBoxLine,
    
pLogged
}; 
Reply
#4

It not working like that. Show global variable what use that enum, example:
Код:
enum playerinfo
{
//variables
};
new pinfo[MAX_PLAYERS][playerinfo];
Reply
#5

An enum doesn't hold any data.
It's only there to define some kind of structure for your arrays, which you create right after defining the enum.

It works like a stamp.
On the stamp, you put letters which will make up the layout of your stamp when you put ink on it and slam in onto a piece of paper.

The stamp holds whatever fields you want to stamp on the paper (the definition of what info should be written down on the paper), but you still need some paper to write down values after the field-names, this would be the array that will hold the actual data.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)