02.06.2013, 19:34
pawn Код:
CMD:course(playerid, params[])
{
new id, string[128], course, rand = random(1000);
if(sscanf(params, "ui", id, course))
{
SendClientMessage(playerid, White, "Use: /course [playerid] [course ID]");
SendClientMessage(playerid, White, "Courses: ID:1 - Stop course, ID:2 - Driving 1");
}
if(course > 2) SendClientMessage(playerid, White, "There are only 2 courses yet.");
if(id == INVALID_PLAYER_ID && course == 1 && course <= 2)
{
SetPlayerVirtualWorld(id, 0);
SendClientMessage(id, White, "Your virtual world was set to 0, and course stopped.");
}
if(id != INVALID_PLAYER_ID && course == 2 && course <= 2)
{
SetPlayerVirtualWorld(playerid, rand);
SetPlayerVirtualWorld(id, rand);
format(string, sizeof(string), "Your virtual world was set to %d, and 'Driving 1' course started.", rand);
SendClientMessage(playerid, White, string);
SendClientMessage(id, White, string);
SetVehicleVirtualWorld(AddStaticVehicle(566, 1777.1274, -1908.1166, 13.3872, 270, 0, 0), rand);
SetVehicleVirtualWorld(AddStaticVehicle(596, 1785.6792, -1908.1118, 13.1205, 270, 0, 0), rand);
}
return 1;
}