14.03.2015, 17:17
(
Последний раз редактировалось Sc0pion; 14.03.2015 в 20:22.
)
Fixed!
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_SECONDARY_ATTACK) // Enter / F key
{
if( lastPickup[playerid] != -1 || properties[lastPickup[playerid]][eType] > 0 ){
new
id = propPickups[lastPickup[playerid]],
Float:x,
Float:y,
Float:z;
GetPropertyEntrance( id, x, y, z );
if( IsPlayerInRangeOfPoint( playerid, 3.0, x, y, z )){
PutPlayerInProperty( playerid, id );
SendClientMessage( playerid, 0x0BBF6AA, "[ PROPERTY: You have entered a property, type /exit to leave. ]");
return 1;
}
else if( currentInt[playerid] > -1 && GetPlayerInterior(playerid) == GetPropertyInteriorId( currentInt[playerid] )){
new id2 = currentInt[playerid];
new Float:x2;
new Float:y2;
new Float:z2;
new Float:a;
// make sure they're near the exit before allowing them to exit.
GetPropertyExit( id, x2, y2, z2 );
if(!IsPlayerInRangeOfPoint(playerid,4.5,x2,y2,z2)) {
SendClientMessage(playerid,0xFF0000AA, "[ ERROR: You must be near the property's entrance in order to use /exit ]");
return 1;
}
a = GetPropertyEntrance( id2, x2, y2, z2 );
SetPlayerPos( playerid, x2, y2, z2 );
SetPlayerFacingAngle( playerid, a );
SetPlayerInterior( playerid, 0 );
SetPlayerVirtualWorld( playerid, 0 );
}
currentInt[playerid] = -1;
return 1;
}
return 1;
}