09.11.2010, 12:40
pawn Код:
new append[MAX_PLAYERS][3];
GetPlayerName(playerid, pName2, sizeof(pName2));
format(rFile, sizeof(rFile), "/Race/%s.txt", RaceName);
//SetTimerEx("OnPlayerFinishCount",1000,0,"dd",playerid,Position);
Position++;
switch(Position)
{
case 1:
{
SendClientMessage(playerid,COLOR_ORANGE,"Case viens1");
Prize[playerid][0] = dini_Int(rFile,"rPrizeMoney")+(random(dini_Int(rFile,"rPrizeMoneyBonus")*10));
Prize[playerid][1] = dini_Int(rFile,"rPrizeExp")+(random(dini_Int(rFile,"rPrizeExpBonus")*10));
SendClientMessage(playerid,COLOR_ORANGE,"Case viens2");
EndRaceCount = 60;
EndRaceTimer = SetTimer("CountTillRaceEnd",999,1);
dUserSetINT(pName(playerid)).("RaceFirst",dUserINT(pName(playerid)).("RaceFirst")+1);
}
case 2:
{
SendClientMessage(playerid,COLOR_ORANGE,"Case du1");
Prize[playerid][0] = dini_Int(rFile,"rPrizeMoney")+(random(dini_Int(rFile,"rPrizeMoneyBonus")*9));
Prize[playerid][1] = dini_Int(rFile,"rPrizeExp")+(random(dini_Int(rFile,"rPrizeExpBonus")*9));
SendClientMessage(playerid,COLOR_ORANGE,"Case du2");
dUserSetINT(pName(playerid)).("RaceSecond",dUserINT(pName(playerid)).("RaceSecond")+1);
}
case 3:
{
Prize[playerid][0] = dini_Int(rFile,"rPrizeMoney")+(random(dini_Int(rFile,"rPrizeMoneyBonus")*8));
Prize[playerid][1] = dini_Int(rFile,"rPrizeExp")+(random(dini_Int(rFile,"rPrizeExpBonus")*8));
dUserSetINT(pName(playerid)).("RaceThird",dUserINT(pName(playerid)).("RaceThird")+1);
}
case 4:
{
Prize[playerid][0] = dini_Int(rFile,"rPrizeMoney")+(random(dini_Int(rFile,"rPrizeMoneyBonus")*7));
Prize[playerid][1] = dini_Int(rFile,"rPrizeExp")+(random(dini_Int(rFile,"rPrizeExpBonus")*7));
}
case 5:
{
Prize[playerid][0] = dini_Int(rFile,"rPrizeMoney")+(random(dini_Int(rFile,"rPrizeMoneyBonus")*6));
Prize[playerid][1] = dini_Int(rFile,"rPrizeExp")+(random(dini_Int(rFile,"rPrizeExpBonus")*6));
}
case 6:
{
Prize[playerid][0] = dini_Int(rFile,"rPrizeMoney")+(random(dini_Int(rFile,"rPrizeMoneyBonus")*5));
Prize[playerid][1] = dini_Int(rFile,"rPrizeExp")+(random(dini_Int(rFile,"rPrizeExpBonus")*5));
}
case 7:
{
Prize[playerid][0] = dini_Int(rFile,"rPrizeMoney")+(random(dini_Int(rFile,"rPrizeMoneyBonus")*4));
Prize[playerid][1] = dini_Int(rFile,"rPrizeExp")+(random(dini_Int(rFile,"rPrizeExpBonus")*4));
}
case 8:
{
Prize[playerid][0] = dini_Int(rFile,"rPrizeMoney")+(random(dini_Int(rFile,"rPrizeMoneyBonus")*3));
Prize[playerid][1] = dini_Int(rFile,"rPrizeExp")+(random(dini_Int(rFile,"rPrizeExpBonus")*3));
}
case 9:
{
Prize[playerid][0] = dini_Int(rFile,"rPrizeMoney")+(random(dini_Int(rFile,"rPrizeMoneyBonus")*2));
Prize[playerid][1] = dini_Int(rFile,"rPrizeExp")+(random(dini_Int(rFile,"rPrizeExpBonus")*2));
}
default:
{
Prize[playerid][0] = dini_Int(rFile,"rPrizeMoney")+(random(dini_Int(rFile,"rPrizeMoneyBonus")*1));
Prize[playerid][1] = dini_Int(rFile,"rPrizeExp")+(random(dini_Int(rFile,"rPrizeExpBonus")*1));
}
}
switch(Position)
{
case 1: format(append[playerid], 3, "st");
case 2: format(append[playerid], 3, "nd");
case 3: format(append[playerid], 3, "rd");
default: format(append[playerid], 3, "th");
}