Nem tesztelt fps parancs, elvileg működnie kellene.
#include <a_samp>
#include <zcmd>
#define FILTERSCRIPT
new fpsobjekt[MAX_PLAYERS];
new fpsbe[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
fpsbe[playerid]=0;
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if (fpsbe[playerid] == 1)
{
AttachCameraToObject(playerid, fpsobjekt[playerid]);//Hogy ne tapadjon a kocsihoz
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
DestroyObject(fpsobjekt[playerid]);
return 1;
}
CMD:fps(playerid, params[])
{
if (fpsbe[playerid] == 0)
{
fpsobjekt[playerid] = CreateObject(19300, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0); //Átlátszó objekt
AttachObjectToPlayer(fpsobjekt[playerid], playerid, 0.0, 0.3, 0.7, 0, 0, 0);
AttachCameraToObject(playerid, fpsobjekt[playerid]);
fpsbe[playerid]=1;
}
if (fpsbe[playerid] == 1)
{
SetCameraBehindPlayer(playerid);
fpsbe[playerid]=0;
}
return 1;
}