24.12.2015, 09:43
(
Последний раз редактировалось SoFahim; 25.12.2015 в 11:39.
)
First of all, Let me tell what First Person View.
: First person view is one type of view which will show you that view from like real life you see. It will work also in vehicle too.
Screen Shot :
Okey, Let's make the script.
First of all,
You have to put some " new " variables.
After those variables put some stocks in that scirpt.
You can use farward and public functions but, I am using stock. Because i think stock is good for little scripting functions.
You can use Below script in public OnPlayerDeath(playerid, killerid, reason)
All things are now done.
All you need Commands now.
If you think CallLocalFunction have no use, you can delete that line, there no rule that you will use CallLocalFunction. It fully depend on you, There many pro scripter, hope they will understand my point of view. Thanks.
Found problem? reply or PM me .
: First person view is one type of view which will show you that view from like real life you see. It will work also in vehicle too.
Screen Shot :
Okey, Let's make the script.
First of all,
You have to put some " new " variables.
PHP код:
new FirstPerson[MAX_PLAYERS];
new FirstPersonObject[MAX_PLAYERS];
new bool:FPS[MAX_PLAYERS];
You can use farward and public functions but, I am using stock. Because i think stock is good for little scripting functions.
PHP код:
stock StartFPS(playerid) //To start the FPS mod.
{
FirstPersonObject[playerid] = CreateObject(19300, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);//You must need this, if you don't the camera will glitch.
AttachObjectToPlayer(FirstPersonObject[playerid],playerid, 0.0, 0.12, 0.7, 0.0, 0.0, 0.0);//Just Attached the object.
AttachCameraToObject(playerid, FirstPersonObject[playerid]);//Now, I have sttach my camera to that object that i have created.
FirstPerson[playerid] = 1;//New variable is now TRUE ( 1= True)
CallLocalFunction("OnPlayerHaveFirstPerson", "i", playerid);//I have called the Local Function of OnPlayerHaveFirstPerson .
return 1;
}
stock StopFPS(playerid) //As you have start the FPS, That must need deactive function too .
{
SetCameraBehindPlayer(playerid);// Just moved his camera behind the player.
DestroyObject(FirstPersonObject[playerid]);//Destroyed that Object that i have created on first.
FirstPerson[playerid] = 0;// 0= False .
CallLocalFunction("OnPlayerDoNotHaveFirstPerson", "i", playerid);//Same as before, I have just deactive that callback ( called OnPlayerDoNotHaveFirstPerson .
return 1;
}
stock Reset(playerid)
{
FirstPerson[playerid] = 0;//Just if you are bugged . Reset.
}
PHP код:
if(FirstPerson[playerid] == 1)
{
StopFPS[playerid];
}
All you need Commands now.
PHP код:
CMD:fps(playerid, params[])
{
//SendClientMessageEx(playerid, COLOR_LIME, "If you think you cannot use /fps , Please /resetfps to fix it up. Then use /fps again."); //Depend on you that you will use it or not.
if(FPS[playerid] == false) // You can use FPS[playerid] == 0) 0=False.
{
FPS[playerid] = true;//Same as before, You can use 1 tho.
StartFPS(playerid);//Called that StartFPS stock to use FPS.
}
else if(FPS[playerid] == true)// Same as before, you can use 1 here.
{
FPS[playerid] = false;// You can use 0 if you don't want to false.
StopFPS(playerid);//Called Stock StopFPS
}
return 1;
}
CMD:resetfps(playerid, params[])
{
Reset(playerid);
return 1;
}
Found problem? reply or PM me .