28.12.2011, 14:41
Use these codes in OnPlayerKeyStateChange(playerid, newkeys, oldkeys) callback, see the example below:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if( newkeys == KEY_SECONDARY_ATTACK )
{
if( IsPlayerInRangeOfPoint( playerid, 3.0, 1555.4877,-1675.7708,16.1953 ) )
{
SetPlayerPos( playerid, 246.783996,63.900199,1003.640625 );
SetPlayerInterior( playerid, 6 );
SendClientMessage(playerid,WHITE,"* press ENTER to exit");
return 1; // Baigiame.
}
}
if( newkeys == KEY_SECONDARY_ATTACK )
{
if( IsPlayerInRangeOfPoint( playerid,3.0, 1555.4877,-1675.7708,16.1953 ) )
{
SetPlayerPos( playerid, 246.783996,63.900199,1003.640625 );
SetPlayerInterior( playerid, 0 );
return 1;
}
}
return 1;
}