Loops ? im i doing it wrong - 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)
+--- Thread: Loops ? im i doing it wrong (
/showthread.php?tid=648975)
Loops ? im i doing it wrong -
LazzyBoy - 31.01.2018
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;
}
Re: Loops ? im i doing it wrong -
Mugala - 31.01.2018
can u show us AllianceLoop <-- func?
Re: Loops ? im i doing it wrong -
LazzyBoy - 31.01.2018
Код:
#define AllianceLoop(%1) for(new %1 = 0; %1 < MAX_FACTIONS; %1++)
here you go
Re: Loops ? im i doing it wrong -
Mugala - 31.01.2018
and where does
AllianceInfo[i][ID] takes infos?