27.08.2010, 19:56
Okay, I want to enter Buildings with "KEY_ACTION" aka "enter/return" but it just does not work,
Please help me.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == (KEY_ACTION))
{
if (IsPlayerInRangeOfPoint(playerid, 5.0, 1172.6040,-1325.2792,15.4032))
{
SendClientMessage(playerid, COLOR_RED, "EMS is not avaliable at this time");
}
else if (IsPlayerInRangeOfPoint(playerid, 5.0, 1128.8011,-1271.1749,13.5469))
{
SendClientMessage(playerid, COLOR_WHITE, "Welcome to the 24/7");
SetPlayerPos(playerid, -25.884498,-185.868988,1003.546875);
SetPlayerInterior(playerid, 17);
}
else if (IsPlayerInRangeOfPoint(playerid, 5.0, 1836.2455, -1682.4979, 13.3560))
{
SendClientMessage(playerid, COLOR_WHITE, "Welcome to Alhambra, Dont get to drunk!");
SetPlayerPos(playerid, 493.390991,-22.722799,1000.679687);
SetPlayerInterior(playerid, 17);
}
else if (IsPlayerInRangeOfPoint(playerid, 5.0, 1642.2997, -2334.3645, 13.5469))
{
SetPlayerPos(playerid, -1825.6872558594, 81.687927246094, 1079.0961914063);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_WHITE, "Welcome too the Baggage Raclaim point, Dont leave you luggage!");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not near any enterable Buildings");
}
return 1;
}
else
{
if (IsPlayerInRangeOfPoint(playerid, 5.0, 1172.6040,-1325.2792,15.4032))
{
SendClientMessage(playerid, COLOR_RED, "EMS is not avaliable at this time");
SetPlayerInterior(playerid, 0);
}
else if (IsPlayerInRangeOfPoint(playerid, 5.0, -25.884498,-185.868988,1003.546875))
{
SetPlayerPos(playerid, 1128.8011,-1271.1749,13.5469);
SetPlayerInterior(playerid, 0);
}
else if (IsPlayerInRangeOfPoint(playerid, 5.0, 493.390991,-22.722799,1000.679687))
{
SetPlayerPos(playerid, 1836.2455, -1682.4979, 13.3560);
SetPlayerInterior(playerid, 0);
}
else if (IsPlayerInRangeOfPoint(playerid, 5.0, -1825.6872558594, 81.687927246094, 1079.0961914063))
{
SetPlayerPos(playerid, 1642.2997, -2334.3645, 13.5469);
SetPlayerInterior(playerid, 0);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You have not entered any Buildings that require you to Exit");
}
return 1;
}
return 1;
}