12.05.2012, 13:00
The previous code was translated for better understanding, this is the code:
So this message:
And the others too (except the first one that's outside the loop) are sent twice when 2 players are in the flag game. When 4 players playing the game, the message is sent 4 times to every player.
pawn Код:
public LippLoppeb()
{
new string[256];
format(string, sizeof(string),"LIPUMДNG: Mдng on lхppenud! {FF0000}PUNANE:{FFFFFF} %d, {00FF1A}ROHELINE:{FFFFFF} %d,{FFFFFF} vхitja tiimi liikmed saavad auhinna!",LipuInfo[lPunaneskoor], LipuInfo[lRohelineskoor]);
SendClientMessageToAll(C_WHITE, string);
for(new i= 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(RohelineTiim[i] == true || PunaneTiim[i] == true)
{
SetPlayerInterior(i, 0);
SpawnPlayer(i);
}
{
if(LipuInfo[lPunaneskoor] > LipuInfo[lRohelineskoor])
{
if(PunaneTiim[i] == true)
{
GivePlayerMoney(i, 10000);
SendClientMessage(i, C_GREEN, "LIPUMДNG: {D7DE16}Jesss!{33AA33} Olid vхitja tiimis ning teenisid 10 000$!");
}
}
else if(LipuInfo[lPunaneskoor] < LipuInfo[lRohelineskoor])
{
if(RohelineTiim[i] == true)
{
GivePlayerMoney(i, 10000);
SendClientMessage(i, C_GREEN, "LIPUMДNG: {D7DE16}Jesss!{33AA33} Olid vхitja tiimis ning teenisid 10 000$!");
}
}
else if(LipuInfo[lPunaneskoor] == LipuInfo[lRohelineskoor])
{
if(RohelineTiim[i] == true || PunaneTiim[i] == true)
{
GivePlayerMoney(i, 5000);
SendClientMessage(i, C_GREEN, "LIPUMДNG: {D7DE16}Jesss!{33AA33} Oli viik ning teenisid 5 000$!");
}
}
}
}
}
return 1;
}
pawn Код:
SendClientMessage(i, C_GREEN, "LIPUMДNG: {D7DE16}Jesss!{33AA33} Oli viik ning teenisid 5 000$!");