21.10.2011, 13:09
Hello there everyonie i am trying to make onplayerstatchange i made one where i an press sprint so i can enter a building but now when i go in build i made a next code to make me exit the building but it wont work please help here the code
please help fix it
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if ((oldkeys & KEY_SPRINT) && !(newkeys & KEY_SPRINT))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1553.7203,-1675.6603,16.1953)) //replace with the position where to press the alt button
{
SetPlayerInterior(playerid, 10);
SetPlayerPos(playerid, 246.40,110.84,1003.22);
}
return 1;
}
if ((oldkeys & KEY_SPRINT) && !(newkeys & KEY_SPRINT))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 245.6786,107.3357,1003.2188)) //replace with the position where to press the alt button
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1553.7203,-1675.6603,16.1953);
}
return 1;
}
return 0;
}