Loops ? im i doing it wrong
#1

Okay so i tried to make something like alliances and stuff for groups , i made everything now theres a problem while trying to get the ID of alliance and the ID of players alliance , if they match it will show the frequences now i debugged it and the players alliance id shows the corrent but the alliance id shows 0.

Heres my code i think im doing it wrong

Код:
COMMAND:allyfreqs(playerid, params[])
{
	if(PlayerInfo[playerid][pAlliance] == -1) return SendClientError(playerid,"You are not in any alliance");
    AllianceLoop(i)
	{
         if(!IsPlayerConnected(i) || IsPlayerNPC(i)) continue;
         {
			printf("pAlliance - %d, alliance id %d",PlayerInfo[playerid][pAlliance],AllianceInfo[i][ID]);
 			if(PlayerInfo[playerid][pAlliance] == AllianceInfo[i][ID]) // PlayerInfo palliance it shows the right one and AllianceInfo ID shows always 0
             {
		  		new string[80];
		  		format(string,sizeof(string),"Freqs %d - pAlliance %d - Alliance id %d", AllianceInfo[i][aFreq],PlayerInfo[playerid][pAlliance],AllianceInfo[i][ID]);
				SendClientMessage(playerid,COLOR_WHITE,string);
             }
         }
	}
	return 1;
}
Reply
#2

can u show us AllianceLoop <-- func?
Reply
#3

Код:
#define AllianceLoop(%1) for(new %1 = 0; %1 < MAX_FACTIONS; %1++)
here you go
Reply
#4

and where does AllianceInfo[i][ID] takes infos?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)