06.10.2009, 16:15
Top of script
New Shamal exit code
OnPlayerSpawn
Thats about it I think and yes I know spec sucks :\
With love,
The Reymon.
pawn Код:
new Shamaloff[MAX_PLAYERS];
New Shamal exit code
pawn Код:
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
new InShamal[MAX_PLAYERS];
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new Float:X, Float:Y, Float:Z;
if (PRESSED(KEY_SPRINT))
{
if(InShamal[playerid] == 0)
{
GetVehiclePos(Shamal, X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, 7.0, X, Y, Z))
{
InShamal[playerid] = 1;
TogglePlayerSpectating(playerid, 1);
PlayerSpectateVehicle(playerid, Shamal, 1);
}
}
else if(InShamal[playerid] == 1)
{
Shamaloff[playerid] = 1;
TogglePlayerSpectating(playerid, 0);
InShamal[playerid] = 0;
}
}
return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
if(Shamaloff[playerid]==1)
{
Shamaloff[playerid] = 0;
GetVehiclePos(Shamal, X, Y, Z);
SetPlayerPos(playerid, X, Y+3, Z);
return 1;
//Big problem you need to give them their skin and weapons back thats up to you...
}
With love,
The Reymon.