People In Mode count fails....
#1

So heres my code:

pawn Code:
new PPLinTDM;
new PPLinFFA;
new IsInTDM[MAX_PLAYERS];
new IsInFFA[MAX_PLAYERS];
Players choose TDM or FFA when they connect with a dialog which sets
pawn Code:
IsInTDM[playerid] = 1;
or
pawn Code:
IsInFFA[playerid] = 1;
When they spawn:
pawn Code:
public OnPlayerSpawn(playerid)
{
if(IsInTDM[playerid] == 1)
{
PPLinTDM ++;
}
if(IsInFFA[playerid] == 1)
{
PPLinFFA ++;
}
return 1;
}
When they die:
pawn Code:
public OnPlayerDeath(killerid,playerid,reason)
{
if(IsInTDM[playerid] == 1)
{
PPLinTDM --;
}
if(IsInFFA[playerid] == 1)
{
PPLinFFA --;
}
return 1;
}
And now to the problem:
With this command people are meant to change from TDM to FFA or reverse(that works), and it also is meant to show the number of people playing in the modes...
pawn Code:
if (strcmp("/changemode", cmdtext, true, 10) == 0)
    {
    new string[256];
    ForceClassSelection(playerid);
    format(string,sizeof(string),"Team Deathmatch (Players: %d)\nFree For All(Players: %d)",PPLInTDM,PPLInFFA);
        ShowPlayerDialog(playerid,ModeSelect,DIALOG_STYLE_LIST,"Choose Mode",string,"Continue","Cancel");
        //When the player chooses the mode in the dialog it kills him and forces class selection...
    return 1;
    }
Ill explain with an example:
When i enter the game and choose tdm its fine, i use /changemode and it shows 1 person is in TDM which is me... so i change to FFA.... use command again and it now shows there is 1 person in TDM and 1 person in FFA...(there are no other players except me on the server) And if i change back to TDM and then use command agait it shows 2 people in TDM and 1 person in FFA...
WTF is wrong with my code or is OnPlayerDeath not called
Reply


Messages In This Thread
People In Mode count fails.... - by [MNC]Azz - 24.08.2011, 13:11
Re: People In Mode count fails.... - by WoodPecker - 24.08.2011, 13:13
Re: People In Mode count fails.... - by [MNC]Azz - 24.08.2011, 13:16
Re: People In Mode count fails.... - by iMonk3y - 24.08.2011, 13:22
Re: People In Mode count fails.... - by [MNC]Azz - 24.08.2011, 13:25
Re: People In Mode count fails.... - by iMonk3y - 24.08.2011, 13:30
Re: People In Mode count fails.... - by [MNC]Azz - 24.08.2011, 13:35
Re: People In Mode count fails.... - by iMonk3y - 24.08.2011, 13:43
Re: People In Mode count fails.... - by [MNC]Azz - 24.08.2011, 13:48
Re: People In Mode count fails.... - by iMonk3y - 24.08.2011, 13:50
Re: People In Mode count fails.... - by [MNC]Azz - 24.08.2011, 13:53
Re: People In Mode count fails.... - by iMonk3y - 24.08.2011, 14:00
Re: People In Mode count fails.... - by [MNC]Azz - 24.08.2011, 14:08

Forum Jump:


Users browsing this thread: 3 Guest(s)