24.08.2011, 13:11
So heres my code:
Players choose TDM or FFA when they connect with a dialog which sets
or
When they spawn:
When they die:
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...
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
pawn Code:
new PPLinTDM;
new PPLinFFA;
new IsInTDM[MAX_PLAYERS];
new IsInFFA[MAX_PLAYERS];
pawn Code:
IsInTDM[playerid] = 1;
pawn Code:
IsInFFA[playerid] = 1;
pawn Code:
public OnPlayerSpawn(playerid)
{
if(IsInTDM[playerid] == 1)
{
PPLinTDM ++;
}
if(IsInFFA[playerid] == 1)
{
PPLinFFA ++;
}
return 1;
}
pawn Code:
public OnPlayerDeath(killerid,playerid,reason)
{
if(IsInTDM[playerid] == 1)
{
PPLinTDM --;
}
if(IsInFFA[playerid] == 1)
{
PPLinFFA --;
}
return 1;
}
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;
}
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

