I think this is the problem, I just want to change F / enter to command /enter and /exit instead of pressing F or Enter on the keyboard.
Код:
if(newkeys == 16)
{
new sendername[MAX_PLAYER_NAME], string[124],giveplayer[MAX_PLAYER_NAME];
if(IsPlayerConnected(playerid))
{
for(new i; i<MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pHouseAccepted] > 0)
{
if(IsPlayerInRangeOfPoint(playerid, 3, PlayerInfo[i][pHouseX], PlayerInfo[i][pHouseY], PlayerInfo[i][pHouseZ]))
{
if(PlayerInfo[i][pHouseLocked] == 0)
{
GetPlayerPos(playerid,PlayerInfo[playerid][pHouseExitX],PlayerInfo[playerid][pHouseExitY],PlayerInfo[playerid][pHouseExitZ]);
GetPlayerFacingAngle(playerid, PlayerInfo[playerid][pHouseExitR]);
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playerid][pMask] == 1)
{
format(string, sizeof(string), "* Stanger has entered the house.");
}
else
{
format(string, sizeof(string), "* %s has entered the house.", sendername);
}
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerVirtualWorld(playerid, i);
PutPlayerInHouse(playerid, PlayerInfo[i][pHouseLevel]);
PlayerInfo[playerid][pLocal] = i;
PlayerInfo[playerid][pVirtualWorld] = i;
//alarm
if(PlayerInfo[i][hAlarmSystem] == 1 && PlayerInfo[i][hAlarmNumber] != 0 && AlarmOnline[i] == 0)
{
//foreach(Player, a)
for(new a = a; a <MAX_PLAYERS; a++)
{
if(IsPlayerConnected(a))
{
if(PlayerInfo[a][pPnumber] == PlayerInfo[i][hAlarmNumber])
{
GetPlayerName(i, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "SMS: This is an automated message informing you that registrant %s's house alarm has been activated.",giveplayer);
SendClientMessage(a, COLOR_YELLOW, string);
}
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That house is currently locked !");
}
return 1;
}
}
}
}
}
if(newkeys == 16)
{
new sendername[MAX_PLAYER_NAME], string[124];
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pLocal] != 999) //in house
{
if(IsAtHouseExit(i))
{
if(PlayerInfo[i][pHouseLocked] == 0)
{
if(PlayerInfo[playerid][pMask] == 1) { sendername = "Stranger"; }
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s has left the house.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,PlayerInfo[playerid][pHouseExitX],PlayerInfo[playerid][pHouseExitY],PlayerInfo[playerid][pHouseExitZ]);
SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pHouseExitR]-180);
SetCameraBehindPlayer(playerid);
PlayerInfo[playerid][pInt] = 0;
PlayerInfo[playerid][pVirtualWorld] = 0;
PlayerInfo[playerid][pLocal] = 999;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "You can't get out when the house is locked!");
}
}
}
}
}
}