shape1
shape2
shape3
shape4
shape7
shape8

Вид от первого лица


Статус
Закрыто для дальнейших ответов.

LIrik

Новичок
Пользователь
17.12.2014
4
0
0
Как сделать вид от первого лица?

 

Kostyaev

Магистр
Пользователь
19.07.2014
1 123
274
0
23
Вроде как командой:

Код:
if(strcmp(cmd, "/vid", true) == 0)
	{
		if (vidos[playerid] == 0)
		{
			OnPlayerCommandText(playerid,"/on");
		}
		else if (vidos[playerid] == 1)
		{
			OnPlayerCommandText(playerid,"/off");
		}
		return 1;
	}
	if(strcmp(cmdtext,"/on",true)==0)
	{
		vidos[playerid] = 1;
		SendClientMessage(playerid, COLOR_GREEN, "Вы включили вид от 1 лица");
		new Float:x, Float:y, Float:z, vehicleid = GetPlayerVehicleID(playerid), vehmodel = GetVehicleModel(vehicleid), bool:found;
		for( new i;i<sizeof(DashBoards);i++ )
		{
			if( vehmodel == DashBoards[i][pmodelider] )
			{
				x = DashBoards[i][cam_x];
				y = DashBoards[i][cam_y];
				z = DashBoards[i][cam_z];
				found = true;
				break;
			}
		}

		if( found )
		{
			Player[playerid][camobj] = CreateObject(19254,x,y,z,0.0,0.0,0.0,200.0);
			AttachObjectToVehicle( Player[playerid][camobj], vehicleid, x,y,z, 0, 0, 0);
			AttachCameraToObject(playerid, Player[playerid][camobj]);
		}
		return 1;
	}

	if(strcmp(cmdtext,"/off",true)==0)
	{
		vidos[playerid] = 0;
		SendClientMessage(playerid, COLOR_GREEN, "Вы выключили вид от 1 лица");
		SetCameraBehindPlayer( playerid );
		DestroyObject( Player[playerid][camobj] );
		return 1;
	}
 

Russia829

Новичок
Пользователь
05.09.2014
20
2
0
Вроде как командой:

if(strcmp(cmd, "/vid", true) == 0)
{
if (vidos[playerid] == 0)
{
OnPlayerCommandText(playerid,"/on");
}
else if (vidos[playerid] == 1)
{
OnPlayerCommandText(playerid,"/off");
}
return 1;
}
if(strcmp(cmdtext,"/on",true)==0)
{
vidos[playerid] = 1;
SendClientMessage(playerid, COLOR_GREEN, "Вы включили вид от 1 лица");
new Float:x, Float:y, Float:z, vehicleid = GetPlayerVehicleID(playerid), vehmodel = GetVehicleModel(vehicleid), bool:found;
for( new i;i<sizeof(DashBoards);i++ )
{
if( vehmodel == DashBoards[pmodelider] )
{
x = DashBoards[cam_x];
y = DashBoards[cam_y];
z = DashBoards[cam_z];
found = true;
break;
}
}

if( found )
{
Player[playerid][camobj] = CreateObject(19254,x,y,z,0.0,0.0,0.0,200.0);
AttachObjectToVehicle( Player[playerid][camobj], vehicleid, x,y,z, 0, 0, 0);
AttachCameraToObject(playerid, Player[playerid][camobj]);
}
return 1;
}

if(strcmp(cmdtext,"/off",true)==0)
{
vidos[playerid] = 0;
SendClientMessage(playerid, COLOR_GREEN, "Вы выключили вид от 1 лица");
SetCameraBehindPlayer( playerid );
DestroyObject( Player[playerid][camobj] );
return 1;
}

Не все вырезал, вырезай до конца, Enum еще не хватает.

 
Статус
Закрыто для дальнейших ответов.