dialog help!
#1

OK i have a problam. When a person connects and chooses a dm the amount of players go by +1.. but when i disconnect it says 1 and when a select a dm it goes by 2.. just look through my code

Deathmatches dialog:

Код:
		new string[86];
		format(string,sizeof(string),"Circus Mania (People Currently on map: %i) \nRetard (People Currently on map: %i)",Circus,Retard);
		ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Deathmatches",string, "Select", "Cancel");
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 2) // Deathmatches
	{
		if(response)
		{
			if(listitem == 0)
			{
	  		new rand = random(sizeof(DeathMatchSpawn));
  			SetPlayerPos(playerid, DeathMatchSpawn[rand][0], DeathMatchSpawn[rand][1],DeathMatchSpawn[rand][2]);
				SetPlayerFacingAngle(playerid, DeathMatchSpawn[rand][3]);
		 		SendClientMessage(playerid, 0xFFFFFFFF, "You playing the map: Circus Mania, by Lorenc");
		 		Circus++;
 			}
			if(listitem == 1)
			{
        Retard++;
   		  SendClientMessage(playerid, 0xFFFFFFFF, "You playing the map: Retard, by Lorenc");
       	return 1;
  			}
	 	}
		else
		{
		  KickPlayer(playerid);
   		SendClientMessage(playerid, 0xFFFFFFFF, "You quit.");
		}
	}
	return 0;
}
Now i dont want it to say
Circus Mania (People Currently on map: 1) when i disconnect.
i want it to say
Circus Mania (People Currently on map: 0)

I tryed to put on player disconnect

Код:
	Circus--;
  Retard--;
but it just shows

Circus Mania (People Currently on map: -1) so i dont want it to deduct

sorry for my bad english just in a hurry for school!
Reply
#2

bumpy
Reply
#3

Rumpy
Reply
#4

U mite have to use an if statement.
like
if(Circus = >0)
{
Something to change it to 0 here
return 1;
}
Reply
#5

Quote:
Originally Posted by Teh_Dude
U mite have to use an if statement.
like
if(Circus = >0)
{
Something to change it to 0 here
return 1;
}
^^ gave me errors this one didnt:

Код:
public OnPlayerDisconnect(playerid, reason)
{
  if(Circus)
	{
   	Circus--;
  }
	return 1;
}
but anyway ill try it out.
Reply
#6

you should attach the DMs people are in through PVars, or in .ini files for more accurate-ness ... or you could make some debug messages and try and fix what you have, but the first one would be more accurate & less complicated i think :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)