saddam, Драг гонка устроит?
[pwn]/* ooooooooo
888 88o oo oooooo ooooooo oooooooo8
888 888 888 888 ooooo888 888 88o
888 888 888 888 888 888oo888o
o888ooo88 o888o 88ooo88 8o 888 888
888ooo888
oooooooooo ooooooo oo
888 888 ooooooo ooooooo ooooooooo8 o888 o888o o888
888oooo88 ooooo888 888 888 888oooooo8 888 8 888 888
888 88o 888 888 888 888 888o8 o888 ooo 888
o888o 88o8 88ooo88 8o 88ooo888 88oooo888 88ooo88 888 o888o */
#include <a_samp>
main()
{
print("\n---------------------------------------------------------------------------------------------");
print(" Script Provided by www.samp-rus.com (ñêðèïò ïðåäîñòàâëåí ñàéòîì samp-rus.com)");
print("---------------------------------------------------------------------------------------------\n");
}
new cars[MAX_VEHICLES];
new Racing = 0;
new InRace[MAX_PLAYERS] = 0;
new Count = 9;
new Timer;
new Race = 0;
new CountText[9][5] ={
"~r~1",
"~r~2",
"~r~3",
"~b~4",
"~b~5",
"~P~6",
"~P~7",
"~P~8",
"~P~9"
};
new Float:Races[12][10] = {
{-2007.7424,1039.4270,55.4653,-2001.7515,1039.6848,55.4716,179.6279,-2006.0970,-288.6483,35.2159},
{2077.6108,1710.8317,10.3987,2077.613 8,1714.0615,10.4074,90.2204,1571.5835,1713.3442,10.6719},
{2529.9885,2051.6018,10.5149,2525.2722,2051.6577,10.5185,1.6527,2525.8257,2531.85 52,10.5474},
{-1900.0292,-213.7213,37.8068,-1895.1334,-213.6595,37.8152,181.5819,-1900.7362,-1341.0972,39.8433},
{-79.4607,2494.6091,16.05 58,-79.4496,2509.1399,16.0561,271.8271,385.4214,2501.8755,16.4844},
{-2169.7446,-156.1234,34.8990,-2164.7539,-155.8840,34.8990,358.8846,-21 42.5635,1182.1735,55.3052},
{-2367.9126,1180.4299,40.4233,-2367.6951,1173.6318,40.4423,271.0974,-1565.8992,1184.4673,6.9120},
{-2677.0017, 1340.3302,55.1568,-2671.2561,1340.6523,55.1568,0.4735,-2675.3992,2185.5337,55.1490},
{-879.4459,-1123.4261,98.6325,-883.6422,-1127.1022,98. 9768,46.3483,-1252.9570,-740.0648,63.9632},
{-1653.9194,404.6245,6.7583,-1649.4785,400.2170,6.7583,134.6043,-1566.4578,-1440.2993,40.5064},
{-2708.2002,-211.1537,3.9068,-2704.7681,-212.4019,3.9068,358.9154,-2706.3320,376.0978,4.6971},
{-1984.9625,-1184.0566,39.2115,-1991.0786, -1184.2036,39.2115,358.6819,-1984.7739,-519.3524,35.0630}
};
forward CountDown();
forward RaceEnd();
#define COLOR_SYSTEM 0xEFEFF7AA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_PURPLE 0x9900FFAA
#define COLOR_BROWN 0x993300AA
#define COLOR_ORANGE 0xFF9933AA
#define COLOR_CYAN 0x99FFFFAA
#define COLOR_TAN 0xFFFFCCAA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_KHAKI 0x999900AA
#define COLOR_LIME 0x99FF00AA
#define COLOR_BLACK 0x000000AA
#define FILTERSCRIPT
public OnFilterScriptInit()
{
cars[1] = CreateVehicle(494,-2007.7424,1039.4270,55.4653,179.6279,42,30,100); // SLUT
cars[2] = CreateVehicle(494,-2001.7515,1039.6848,55.4716,179.6579,42,33,100); // SLUT
for(new i=0;i<MAX_PLAYERS;i++)
{
SetVehicleParamsForPlayer(cars[1],i,0,1);
SetVehicleParamsForPlayer(cars[2],i,0,1);
}
return 1;
}
public OnFilterScriptExit()
{
DestroyVehicle(cars[1]);
DestroyVehicle(cars[2]);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/exitdrag",true)==0)
{
new pname[24];
new pwn[256];
GetPlayerName(playerid,pname,sizeof(pname));
format(pwn,sizeof(pwn)," %s âûøåë ñ ãîíêè",pname);
SendClientMessageToAll(COLOR_ORANGE,pwn);
SetVehiclePos(cars[1],-2007.7424,1039.4270,55.4653);
SetVehiclePos(cars[2],-2001.7515,1039.6848,55.4716);
Racing = 0;
KillTimer(Timer);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(InRace[i] == 1)
{
InRace[i] = 0;
SetPlayerPos(i,-1940.2690,295.2738,47.7031);
DisablePlayerCheckpoint(i);
TogglePlayerControllable(i,true);
}
}
return 1;
}
if(InRace[playerid] == 1) return SendClientMessage(playerid,COLOR_RED," Âñå ìåñòà â äðàã ãîíêå çàíÿòû");
if(strcmp(cmdtext,"/dragrace",true)==0)
{
if(Racing == 2) return SendClientMessage(playerid,COLOR_RED," Ãîíêà è òàê íå íà÷àëàñü");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED," Âûéäèòå èç ñâîåãî òðàíñïîðòà ñíà÷àëà");
if(Racing == 0)
{
SetPlayerInterior(playerid,0);
PutPlayerInVehicle(playerid,cars[1],0);
SetVehicleHealth(cars[1],1000);
InRace[playerid] = 1;
TogglePlayerControllable(playerid,false);
SendClientMessageToAll(COLOR_ORANGE," Êàêîé òî èãðîê çàøåë â äðàã ãîíêó êîìàíäîé /dragrace");
SendClientMessage(playerid,COLOR_RED," Æäèòå ïîêà êòî òî çàéäåò â ãîíêó èëè âûéäèòå ñ ãîíêè êîìàíäîé /exitdrag");
}
if(Racing == 1)
{
SetPlayerInterior(playerid,0);
PutPlayerInVehicle(playerid,cars[2],0);
SetVehicleHealth(cars[2],1000);
InRace[playerid] = 1;
TogglePlayerControllable(playerid,false);
SendClientMessageToAll(COLOR_ORANGE," Äðàã ãîíêà íà÷àëàñü");
CountDown();
}
Racing++;
return 1;
}
return 0;
}
public CountDown()
{
if (Count > 0)
{
new rand = Race;
SetVehiclePos(cars[1],Races[rand][0],Races[rand][1],Races[rand][2]);
SetVehiclePos(cars[2],Races[rand][3],Races[rand][4],Races[rand][5]);
SetVehicleZAngle(cars[1],Races[rand][6]);
SetVehicleZAngle(cars[2],Races[rand][6]);
Count--;
SetTimer("CountDown", 1000, 0);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(InRace[i])
{
GameTextForPlayer(i, CountText[Count-1], 2500, 3);
}
}
}
else
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(InRace[i])
{
new rand = Race;
SendClientMessage(i,COLOR_RED," Ó âàñ åñòü 1 ìèíóòà ÷òî áû çàêîí÷èòü ãîíêó èëè îíà àâòîìàòè÷åñêè çàêîí÷èòñÿ");
TogglePlayerControllable(i,true);
GameTextForPlayer(i,"~g~Go! Go! Go!", 2500, 3);
SetPlayerCheckpoint(i,Races[rand][7],Races[rand][8],Races[rand][9],6);
}
}
Timer = SetTimer("RaceEnd",60000,0);
Count = 5;
}
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
new pname[24];
new pwn[256];
if(InRace[playerid] == 1)
{
if(Race == 11)
{
Race = -1;
}
GetPlayerName(playerid,pname,sizeof(pname));
format(pwn,sizeof(pwn)," Âûèãðàë â äðàã ãîêå %s è ïîëó÷èë $5000",pname);
SendClientMessageToAll(COLOR_ORANGE,pwn);
GameTextForPlayer(playerid,"You ~G~Won",5000,6);
GivePlayerMoney(playerid,5000);
Racing = 0;
KillTimer(Timer);
Race++;
for(new i=0; i<MAX_PLAYERS; i++)
{
if(InRace[i] == 1)
{
InRace[i] = 0;
SetPlayerPos(i,-1940.2690,295.2738,47.7031);
DisablePlayerCheckpoint(i);
}
}
}
return 1;
}
public RaceEnd()
{
if(Race == 11)
{
Race = -1;
}
SendClientMessageToAll(COLOR_ORANGE," Äðàã ãîíêà çàêîí÷èëàñü");
Racing = 0;
Race++;
for(new i=0; i<MAX_PLAYERS; i++)
{
if(InRace[i] == 1)
{
InRace[i] = 0;
SetPlayerPos(i,-1940.2690,295.2738,47.7031);
DisablePlayerCheckpoint(i);
}
}
return 1;
}
/*main()
{
print("\n---------------------------------------------------------------------------------------------");
print(" Script Provided by www.samp-rus.com (ñêðèïò ïðåäîñòàâëåí ñàéòîì samp-rus.com)");
print("---------------------------------------------------------------------------------------------\n");
}*/
[/pwn]