02.08.2014, 10:08
'327' is a relatively small object, but by turning it invisible with SetObjectMaterialText, you'll be much better off. Here's a code I've just prepared for first-person mode.
Flaws:
- Player can look around 360 degrees, like most first person shooters but the player can still walk in any direction while doing so, making it somewhat unrealistic.
- The camera changes and you can see the player when you attempt to aim, climb or sprint. (Although the camera doesn't change when you sprint, you can still see the inside of your player model when you run or when you look straight down.)
pawn Код:
new HeadObject[MAX_PLAYERS]; //At the top of your script.
//Applying First-Person Mode:
new Float:x, Float:y, Float:z; //Not necessary to do this, but it gives you an idea.
GetPlayerPos(playerid, x, y, z);
AttachObjectToPlayer((HeadObject[playerid] = CreateObject(327, x, y, z, 0, 0, 0)), playerid, -0.07, 0.2, 0.6, 0.0, 0.0, 0.0);
AttachCameraToObject(playerid, HeadObject[playerid]);
SetObjectMaterialText(HeadObject[playerid], " ", 0, 140, "Arial", 64, 1, -32256, 0, 1);
- Player can look around 360 degrees, like most first person shooters but the player can still walk in any direction while doing so, making it somewhat unrealistic.
- The camera changes and you can see the player when you attempt to aim, climb or sprint. (Although the camera doesn't change when you sprint, you can still see the inside of your player model when you run or when you look straight down.)