../gamemodes/core.pwn(15567) : error 028: invalid subscript (not an array or too many subscripts): "pStatus" ../gamemodes/core.pwn(15567) : error 029: invalid expression, assumed zero ../gamemodes/core.pwn(15567) : error 029: invalid expression, assumed zero ../gamemodes/core.pwn(15567) : fatal error 107: too many error messages on one line |
stock GetPlayerStatus(playerid) { new string[10]; THE LINE - > switch(pStatus[playerid]) { case 0: strcat(string, "{4BB74C}Administrating"); case 1: strcat(string, "{FF0000}Roleplaying"); case 2: strcat(string, "{FF6600}Away From Keyboard"); default: strcat(string, "Unknown"); } return string; } |
The error message clearly states that given variable is not an array, so make it one.
|
The error message clearly states that given variable is not an array, so make it one.
|
CMD:status(playerid, params[]) { if(isnull(params) || !IsNumeric(params)) return SendClientMessage(playerid, -1, "Usage: /status (1, 2, 3)."); if (GetPVarInt(playerid, "PlayerLogged") == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this."); new value = strval(params); if(value <= 0 || value >= 4) return SendClientMessage(playerid, -1, "SERVER: You have entered an invalid status value."); -- > THIS IS THE ERROR LINE pStatus[playerid] = value - 1; new string[144]; format(string, sizeof(string), "INFO: {FFFFFF}You have changed your status to %s.", GetPlayerStatus(playerid)); SendClientMessage(playerid, COLOR_GREEN, string); return 1; } |
enum pInfo { pID, pPass[128], pSec[256], pUsername[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME], pCellname[128], pBlockPM[MAX_PLAYERS], pDescribe[128], pDescribe2[128], pAdText[256], PlayerWeapon, PlayerAmmo, pAudioUrl[256], pLiveOffer[2], // 0: SAN Network, 1: RLS Float:pPos[3], pFurnID, Float:pFurn[4], Float:pFurnR[4], pPMMsg[128], pTagMsg[128], Float:pPosa[6], pInvItem[MAX_INV_SLOTS], pInvQ[MAX_INV_SLOTS], pInvEx[MAX_INV_SLOTS], pInvS[MAX_INV_SLOTS], pPlayerWeapon, pPlayerAmmo, pAmmoType, pPlayerSerial, pDelay[MAX_DELAY_SLOTS+1], pHacker, pAch[MAX_ACHIEVEMENTS], pFakeIP[16], pHost[128], pMarriedTo[MAX_PLAYER_NAME + 1], pAccent[64], pPaymentTD, pSpeedDelay, Float:pPosI[3], pIdleTime, pDivision[MAX_LSPD_DIVISIONS], pBeanbagged, pBeanbaggedTime, pArcade, pArcadeRaceCP, pArcadeRaceCount, pArcadeLaps, pScanner, pIP[16], pSelectedFurnitureID, pJailedUntil[64], pBasketballID, pHasBasketball, pBasketballDefending, Float:pgoto[3], pCmdSpam, pCmdTime, pMute, pRegisterSkin, pTrickOrTreat, pTrickOrTreatHouses[MAX_HOUSES], pPlantRadio, pPlantRadioID, pDarkScreen, pJobCP, pJobStatus, pJobVehicleID, pJobExtraVehicleID, pJobHouseID, pJobProgress, pAddressCP, pMapTag[16], pDialogOpen, pTogName, pTogAdminChat, pLocationsCP, pStopTalkingTimer, pMechCall, p*******StreamType, p*******StreamExtra, pFDSubRank[20], pInjuries[10], pStatus[MAX_PLAYERS], Text3D:pInjuriesText, }; new PlayerInfo[MAX_PLAYERS][pInfo]; |