de probleem is: ik kan wel voten (en hij count wel wat de meest votes heeft), maar als de vote klaar is dan ga ik niet naar de map :S
Hier is de Script:
// de map namen
new Map[][] =
{
"Los Santos",
"Las Venturas",
"San Fierro"
};
new CurrentMap = 0;
new Votes[50];
new CanVote[MAX_PLAYERS];
new bool:ActiveVote;
public OnPlayerConnect(playerid)
{
if (ActiveVote == true) CanVote[playerid] = 0;
}
forward BeginVote();
public BeginVote()
{
SendClientMessageToAll(red,"Voting Ends in 15 seconds. Cast your Votes");
SetTimer("endvote",15000,0);
ActiveVote = true;
new info[150];
for (new i = 0;i<sizeof(MapNames);i++)
{
if (i == 0) format(info,sizeof(info),"%s\n",Map[i]);
if (i == sizeof(MapNames)-1) format(info,sizeof(info),"%s%s",info,Map[i]);
if (i != sizeof(MapNames) && i != 0) format(info,sizeof(info),"%s\n",info,Map[i]);
}
for (new i = 0;i<MAX_PLAYERS; i++)
{
CanVote[i] = 1;
ShowPlayerDialog(i,500,DIALOG_STYLE_LIST,"Vote for Map",info,"Vote","Vote");
}
return 1;
}
stock GetHighestNumberEx(num[], size = sizeof(num))
{
new highesty = 0;
for (new i = 0; i < size; i++)
{
if (num[i] > highesty) highesty = num[i];
}
return highesty;
}
forward endvote();
public endvote()
{
ActiveVote = false;
new high = GetHighestNumberEx(Votes);
printf("%d %s",high,Map);
for (new i = 0; i<sizeof(Votes);i++)
{
if (Votes[i] == high)
{
CurrentMap = i;
new msg[228];
format(msg,sizeof(msg),"The Map %s Has been Nominated.",Map[i]);
SendClientMessageToAll(red,msg);
SetTimerEx("Spawn",1000,0,"%d",i);
}
}
return 1;
}
stock GetHighestNumber(...)
{
new args = numargs();
new highestyet = 0;
for (new i = 0; i<args; i++)
{
if (getarg(i,0) > highestyet) highestyet = getarg(i,0);
}
return highestyet;
}
//ik denk dat de probleem hier zit maar weet het niet zeker :S//
forward Spawn(playerid);
public Spawn(playerid)
{
if(Map[CurrentMap][1])
{
LS=1;
ForceClassSelection(playerid);
}
if (Map[CurrentMap][2])
{
LV=1;
ForceClassSelection(playerid);
}
if (Map[CurrentMap][3])
{
SF=1;
ForceClassSelection(playerid);
}
return 1;
}
////dit plaats je wanneer je de VoteMap wilt laten beginnen
CallRemoteFunction("BeginVote","");
hallo allemaal,
ik heb een probleempje met mijn Vote Map script
de probleem is: ik kan wel voten (en hij count wel wat de meest votes heeft), maar als de vote klaar is dan ga ik niet naar de map :S
Hier is de Script:
ik hoop dat iemand mij hier uit kan helpen
Alvast Bedankt,
Never
Bewerkt: door Never