01.02.2012, 12:07
Is there any shorter form of this code?
Thanks 4 helpers
pawn Код:
if(iRace_Pos == 1)
{
GivePlayerMoney(playerid,100000);
format(PosString, sizeof(PosString),"{ffaa00}%s {ffffff}has finished the race {ffaa00}1st!",Max_Reward/iRace_Pos, GetName(playerid));
SendClientMessageToAll(0xff0000, PosString);
}
else if(iRace_Pos == 2)
{
GivePlayerMoney(playerid,85000);
format(PosString, sizeof(PosString),"{ffaa00}%s {ffffff}has finished the race {ffaa00}2nd!",Max_Reward/iRace_Pos, GetName(playerid));
SendClientMessageToAll(0xff0000, PosString);
}
else if(iRace_Pos == 3)
{
GivePlayerMoney(playerid,75000);
format(PosString, sizeof(PosString),"{ffaa00}%s {ffffff}has finished the race {ffaa00}3rd!",Max_Reward/iRace_Pos, GetName(playerid));
SendClientMessageToAll(0xff0000, PosString);
}
else if(iRace_Pos > 3 || iRace_Pos < 21)
{
GivePlayerMoney(playerid,(200000/iRace_Pos));
format(PosString, sizeof(PosString),"{ffaa00}%s {ffffff}has finished the race {ffaa00}%sth!",Max_Reward/iRace_Pos, GetName(playerid));
SendClientMessageToAll(0xff0000, PosString);
}
if(iRace_Pos == 21)
{
format(PosString, sizeof(PosString),"{ffaa00}%s {ffffff}has finished the race {ffaa00}21st!",Max_Reward/iRace_Pos, GetName(playerid));
SendClientMessageToAll(0xff0000, PosString);
}
else if(iRace_Pos == 22)
{
format(PosString, sizeof(PosString),"{ffaa00}%s {ffffff}has finished the race {ffaa00}22nd!",Max_Reward/iRace_Pos, GetName(playerid));
SendClientMessageToAll(0xff0000, PosString);
}
else if(iRace_Pos == 23)
{
format(PosString, sizeof(PosString),"{ffaa00}%s {ffffff}has finished the race {ffaa00}23rd!",Max_Reward/iRace_Pos, GetName(playerid));
SendClientMessageToAll(0xff0000, PosString);
}
else if(iRace_Pos > 23 || iRace_Pos < 31 || iRace_Pos == 34)
{
format(PosString, sizeof(PosString),"{ffaa00}%s {ffffff}has finished the race {ffaa00}%sth!",Max_Reward/iRace_Pos, GetName(playerid));
SendClientMessageToAll(0xff0000, PosString);
}
if(iRace_Pos == 31)
{
format(PosString, sizeof(PosString),"{ffaa00}%s {ffffff}has finished the race {ffaa00}31st!",Max_Reward/iRace_Pos, GetName(playerid));
SendClientMessageToAll(0xff0000, PosString);
}
else if(iRace_Pos == 32)
{
format(PosString, sizeof(PosString),"{ffaa00}%s {ffffff}has finished the race {ffaa00}32nd!",Max_Reward/iRace_Pos, GetName(playerid));
SendClientMessageToAll(0xff0000, PosString);
}
else if(iRace_Pos == 33)
{
format(PosString, sizeof(PosString),"{ffaa00}%s {ffffff}has finished the race {ffaa00}33rd!",Max_Reward/iRace_Pos, GetName(playerid));
SendClientMessageToAll(0xff0000, PosString);
}