SA-MP Forums Archive
[HELP] SAGC /alistfaction 1-10 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] SAGC /alistfaction 1-10 (/showthread.php?tid=139144)



[HELP] SAGC /alistfaction 1-10 - NiiRV4N4 - 04.04.2010

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...


Re: [HELP] SAGC /alistfaction 1-10 - Lajko1 - 04.04.2010

mybe you forgot return 1; somewhere


Re: [HELP] SAGC /alistfaction 1-10 - NiiRV4N4 - 04.04.2010

Код:
	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.


Re: [HELP] SAGC /alistfaction 1-10 - RSX - 04.04.2010

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]!


Re: [HELP] SAGC /alistfaction 1-10 - NiiRV4N4 - 04.04.2010

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.


Re: [HELP] SAGC /alistfaction 1-10 - RSX - 04.04.2010

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..)


Re: [HELP] SAGC /alistfaction 1-10 - NiiRV4N4 - 04.04.2010

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.


Re: [HELP] SAGC /alistfaction 1-10 - NiiRV4N4 - 05.04.2010

bump


Re: [HELP] SAGC /alistfaction 1-10 - NiiRV4N4 - 06.04.2010

BUMP


Re: [HELP] SAGC /alistfaction 1-10 - NiiRV4N4 - 06.04.2010

bump