16.11.2011, 20:05
Well , I am working on a house System , And i was Making it IN my /enter CMD , Cause i already have one for other Interiors , so here is it :
But it Don't work when i do /enter , It don't give any Errors Btw , Can someone know what's Wrong ? Giving Rep.
pawn Код:
}
}
}
}
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 3, HouseInfo[i][hExteriorX], HouseInfo[i][hExteriorY], HouseInfo[i][hExteriorZ]))
{
if(GetPlayerVirtualWorld( playerid) == 0)
{
if(HouseInfo[i][hLocked] == 0 || PlayerInfo[playerid][pScrew] >= 1)
{
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);
PlayerInfo[playerid][InHouse] = i;
SetPlayerInterior( playerid, HouseInfo[i][hInteriorID]);
SetPlayerVirtualWorld( playerid, HouseInfo[i][hVirWorld]);
PlayerInfo[playerid][pVirtualWorld] = HouseInfo[i][hVirWorld];
SetPlayerPos( playerid, HouseInfo[i][hInteriorX], HouseInfo[i][hInteriorY], HouseInfo[i][hInteriorZ]);
for(new x = 0; x <MAX_PLAYERS; x++)
{
new id = PlayerInfo[x][pPhousekey];
if(HouseInfo[id][hAlarmSystem] == 1 && HouseInfo[id][hAlarmNumber] != 0 && AlarmOnline[id] == 0)
{
for(new a = 0; a <MAX_PLAYERS; a++)
{
if(IsPlayerConnected(a))
{
if(PlayerInfo[playerid][pScrew] >= 1 && HouseInfo[i][hLocked] == 1)
{
if(PlayerInfo[a][pPnumber] == HouseInfo[id][hAlarmNumber])
{
new success = random(4);
if(success == 1)
{
format(string, sizeof(string), "House Alarm: Someone has tryed to enter inside the house but failed!");
SendCopMessage(COLOR_DBLUE,string);
PlayerInfo[playerid][pScrew] -= 1;
SendClientMessage(playerid, COLOR_GREY, "You failed to enter inside the house, run!");
format(string, sizeof(string), "SMS: This is an automated message informing you that registrant %s's house alarm has been activated.",GetName(x));
SendClientMessage(a, COLOR_YELLOW, string);
if(IsACop(a))
{
SetPlayerCheckpoint(playerid, HouseInfo[i][hExteriorX], HouseInfo[i][hExteriorY], HouseInfo[i][hExteriorZ], 3.0);
CP[a] = 46488;
}
if(PlayerInfo[playerid][pWantedLevel] <= 6)
{
PlayerInfo[playerid][pWantedLevel] += 1;
SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWantedLevel]);
}
PlayerInfo[playerid][pVirtualWorld] = 0;
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, HouseInfo[i][hExteriorID]);
SetPlayerPos(playerid, HouseInfo[i][hExteriorX], HouseInfo[i][hExteriorY], HouseInfo[i][hExteriorZ]);
}
else
{
format(string, sizeof(string), "House Alarm: Someone has successfully entered inside the house!");
SendCopMessage(COLOR_DBLUE,string);
PlayerInfo[playerid][pScrew] -= 1;
if(IsACop(a))
{
SetPlayerCheckpoint(playerid, HouseInfo[i][hExteriorX], HouseInfo[i][hExteriorY], HouseInfo[i][hExteriorZ], 3.0);
CP[a] = 46488;
}
if(PlayerInfo[playerid][pWantedLevel] <= 6)
{
PlayerInfo[playerid][pWantedLevel] += 1;
SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWantedLevel]);
}
SendClientMessage(playerid, COLOR_GREY, "You successfully enter inside the house!");
format(string, sizeof(string), "SMS: This is an automated message informing you that registrant %s's house alarm has been activated.",GetName(x));
SendClientMessage(a, COLOR_YELLOW, string);
}
}
}
}
}
}
}
}
else
{
GameTextForPlayer(playerid, "~r~House is Locked!", 1000, 5);
}
}
}
}