[HELP] SAGC /alistfaction 1-10
#1

In SAGC, I'm trying to /alistfaction 11 and it says Server: Unknown Command. I added more blank factions in the configuration files. It never says, "Server: Unknown Command." Please make it so I can edit more than 9 factions...
Reply
#2

mybe you forgot return 1; somewhere
Reply
#3

Код:
	if(strcmp(cmd, "/alistfaction", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "[Usage:] /alistfaction [id]");
				return 1;
			}
			new text = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 10)
			{
			 	new wstring[128];
			  format(wstring, sizeof(wstring), "[ID:%d] Faction Name: %s - Materials: %d - Drugs: %d - Money: $%d - Join Rank: %d - Use Skins: %d - Type: %d",text, DynamicFactions[text][fName],DynamicFactions[text][fMaterials],DynamicFactions[text][fDrugs],DynamicFactions[text][fBank],DynamicFactions[text][fJoinRank],DynamicFactions[text][fUseSkins],DynamicFactions[text][fType]);
			  SendClientMessage(playerid,COLOR_ADMINCMD, wstring);
			  format(wstring, sizeof(wstring), "[ID:%d] Skins: %d|%d|%d|%d|%d|%d|%d|%d|%d|%d - Rank Amount: %d - Use Color: %d", text,DynamicFactions[text][fSkin1],DynamicFactions[text][fSkin2],DynamicFactions[text][fSkin3],DynamicFactions[text][fSkin4],DynamicFactions[text][fSkin5],DynamicFactions[text][fSkin6],DynamicFactions[text][fSkin7],DynamicFactions[text][fSkin8],DynamicFactions[text][fSkin9],DynamicFactions[text][fSkin10],DynamicFactions[text][fRankAmount],DynamicFactions[text][fUseColor]);
			  SendClientMessage(playerid,COLOR_ADMINCMD, wstring);
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not authorized to use that command");
			}
		}
		return 1;
	}
I also can't /agotofaction 11 or above, it says Server: Unknown Command.
Reply
#4

Array size is exceeded, by my opinion it's very nice, no giant crashes with memory, as you are trying to drive out of it (kind of accidental hacking that doesn't work anymore) and in addiction, array size now should be 11, if you can't go over 11 (cause id's start with 0) so that well skipping shit, you need a bigger array the one whitch is used with index [text]!
Reply
#5

That didn't make any sense but I get what you mean, I guess. Thanks

Wait, never mind, I have no clue what you mean.
Reply
#6

You have an array, and you are trying to use something that doesn't exist and is over limits, in addiction, i can say, that arrays don't make leaps for oversizes, they just don't work, and returns 0 in some wierd way >> "Server: Unknown command" comes here, you just need to enlarge that array, where you use 11th cell (If you didn't really got it, i can show you whitch it is..)
Reply
#7

Quote:
Originally Posted by RSX
You have an array, and you are trying to use something that doesn't exist and is over limits, in addiction, i can say, that arrays don't make leaps for oversizes, they just don't work, and returns 0 in some wierd way >> "Server: Unknown command" comes here, you just need to enlarge that array, where you use 11th cell (If you didn't really got it, i can show you whitch it is..)
show me please.. and do you know what addiction means? and the max amount of factions i can have is 9. i can't go over that.
Reply
#8

bump
Reply
#9

BUMP
Reply
#10

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)