SA-MP Forums Archive
[Help] Command - 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] Command (/showthread.php?tid=87437)



[Help] Command - borisblat - 20.07.2009

Код:
	if(strcmp(cmd, "/Clan",true)== 0)
	{
    tmp = strtok(cmdtext, idx);
    
    	if(strcmp(tmp, "Create", true) == 0)
  	{
      if(PlayerInfo[playerid][Admin] < 20) return DenyMessage(playerid, 20);
      tmp = strtok(cmdtext, idx);
			new name[MAX_PLAYER_NAME], opname[MAX_PLAYER_NAME];
			new string[256], file[256];
			new ClanName[60];
		  ClanName = strval(tmp);
			tmp3 = strtok(cmdtext, idx);
			new otherplayer = strval(tmp3);
			GetPlayerName(playerid, name, sizeof(name));
			GetPlayerName(otherplayer, opname, sizeof(opname));
			format(file, sizeof(file), "DAR/Clans/%s.txt", ClanName);
			if(dini_Exists(file)) return SCM(playerid, RED, ".дчмап бщн жд лбш чййн");
			for (new i = 0; i < MAX_PLAYERS; i++)
			{
				if(i != otherplayer)
				{
					format(string, sizeof(string), ".ммйгш дшащй %s едфк %s фъз аъ дчмап %s дагойп", opname, ClanName, name);
					SCM(i, ORANGE, string);
				}
			}
			format(string, sizeof(string),".едфк аеък ммйгш дшащй $s фъз аъ дчмап %s дагойп", ClanName, name);
			SCM(otherplayer, ORANGE, string);
			dini_Create(file);
			dini_Set(file, "Founder", opname);
			dini_FloatSet(file, "X", 0);
			dini_FloatSet(file, "Y", 0);
			dini_FloatSet(file, "Z", 0);
			dini_IntSet(file, "ClanBank", 0);
			SCM(otherplayer, ORANGE, "./ClanHelp - мтжшд дчмг/й");
			new file2[256];
			format(file2, sizeof(file2), "DAR/Users/%s.txt", opname);
			dini_Set(file2, "Clan", ClanName);
			dini_IntSet(file2, "LeaderLevel", 4);
			PlayerInfo[otherplayer][Leaderlvl] = 4;
    }
		return 1;
	}
the Error is:
error 033: array must be indexed (variable "ClanName")
on line ClanName = strval(tmp);

how can i fix this?


Re: [Help] Command - yezizhu - 20.07.2009

Edit it to
Код:
format(ClanName,60,tmp);



Re: [Help] Command - borisblat - 20.07.2009

thx, solved.


Re: [Help] Command - yezizhu - 20.07.2009

please edit "[Help]" to "[Solved]", thx^^