17.08.2009, 07:04
pawn Код:
new Text:Textdraw1;
new cam[MAX_PLAYERS];
forward CamWithPlane(playerid, vehicleid);
public OnGameModeInit()
{
Textdraw1 = TextDrawCreate(292.000000,186.000000," I~n~- -~n~ I");
/* this look like:
I
- -
I
(target)
*/
//more of those codes....
return 1;
}
public OnGameModeExit()
{
TextDrawDestroy(Textdraw1);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
TextDrawHideForPlayer(playerid, Textdraw1);
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(vehicleid) == 476) //rustler
{
TextDrawShowForPlayer(playerid, Textdraw1);
cam[playerid] = SetTimerEx("CamWithPlane", 50, true, "ii", playerid, vehicleid);
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(GetVehicleModel(vehicleid) == 476) //rustler
{
TextDrawHideForPlayer(playerid, Textdraw1);
KillTimer(cam[playerid]);
}
return 1;
}
public CamWithPlane(playerid, vehicleid)
{
new Float:lol[3];
GetVehiclePos(vehicleid, lol[0], lol[1], lol[2]);
SetPlayerCameraPos(playerid, lol[0], lol[1], lol[2]);
//what now? (floats)
SetPlayerCameraLookAt(playerid, >>?<<);
}