26.10.2015, 15:54
PHP код:
forward CreateCPHouses();
public CreateCPHouses()
{
for(new i = 0; i < MAX_HOUSES; i ++)
{
HouseInfo[i][hCheckPoint] = CreateDynamicCP(HouseInfo[i][hSpawnX], HouseInfo[i][hSpawnY], HouseInfo[i][hSpawnZ], 1.5, -1, -1, -1, 5.0);
}
print("#2 Houses Created.");
}
public OnGameModeInit()
{
CreateCPHouses();
return 1;
}
forward OnPlayerEnterDynamicCP(playerid, checkpointid);
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
printf("%d", checkpointid);
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
for(new i = 0; i < MAX_HOUSES; i ++)
{
new addr[256];
new msg[1024];
GetHouseAddress(i,addr);
if(HouseInfo[i][hPrice] != 0)
{
if(IsPlayerInRangeOfPoint(playerid,2,HouseInfo[i][hSpawnX], HouseInfo[i][hSpawnY], HouseInfo[i][hSpawnZ]))
{
if(checkpointid == HouseInfo[i][hCheckPoint])
{
if(HouseInfo[i][hOwner] == 1)
{
if(HouseInfo[i][hRentable] == 1)
{
format(msg, sizeof(msg), "[%s]",addr);
SendClientMessage(playerid, COLOR_GREEN, msg);
}
}
}
}
}
}
}
print("OnPlayerEnterDynamicCP");
return 1;
}
what is wrong ?