dialog help! - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: dialog help! (
/showthread.php?tid=145966)
dialog help! -
Lorenc_ - 04.05.2010
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
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!
Re: dialog help! -
Lorenc_ - 05.05.2010
bumpy
Re: dialog help! -
Lorenc_ - 05.05.2010
Rumpy
Re: dialog help! -
IamNotKoolllll - 05.05.2010
U mite have to use an if statement.
like
if(Circus = >0)
{
Something to change it to 0 here
return 1;
}
Re: dialog help! -
Lorenc_ - 05.05.2010
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.
Re: dialog help! -
Whitetiger - 05.05.2010
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