SA-MP Forums Archive
[Ajuda] Como colocar mais opзхes ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Como colocar mais opзхes ? (/showthread.php?tid=436801)



Como colocar mais opзхes ? - clerISoN - 12.05.2013

Код:
public showVote(playerid)
{
		TogglePlayerControllable(playerid,0);
		if (racecount+1 != RACES_TILL_MODECHANGE) ShowMenuForPlayer(voteMenu,playerid);
}
public countVotes()
{
	new votes, equalvotes[4],equal, index=-1, vmsg[156];
	for (new i=0;i<4;i++)
	{
		if(gVotes[i]>votes)
		{
			votes=gVotes[i];
			index=i;
			equal=0;
			equalvotes[equal]=i;
		} else if (gVotes[i]==votes && votes!=0)
		{
		    equal++;
		    equalvotes[equal]=i;

		}
		
	}

	if (votes>0)
	{
 		new rand = random(equal+1);
		gNextTrack = gVoteItems[equalvotes[rand]];
		gTrackTime=7;
		format(vmsg,156,"Votaзгo terminada! {1874CD}%s {00FF00}ganhou com {1874CD}%d {00FF00}votos",gVoteItems[equalvotes[rand]],gVotes[index]);
		SendClientMessageToAll(CorEntrando, vmsg);
	} else {
	    new rand;
	    rand=random(4);
	    gNextTrack = gVoteItems[rand];
		format(vmsg,156,"Votaзгo terminada! Sem voto, corrida escolhida aleatуriamente {1874CD}%s",gVoteItems[rand]);
		SendClientMessageToAll(COLOR_TEMP, vmsg);
	}

}
Queria saber como colocar mais opзхes de votos ? Sу amostra 4 opзхes.


Re: Como colocar mais opзхes ? - Schocc - 12.05.2013

Quote:

rand=random(VALOR);

e tbm nгo й sуmente ali que tera que alterar! tem mais coisas;

E vc tera que criar a outra nova corrida lуgico