CMD:findhouse(playerid,params[]) { New id; If(scanf....); CreateCP(houseinfo[id][x], ...[y], ...[z]); Return 1; }
Код:
CMD:findhouse(playerid,params[]) { New id; If(scanf....); CreateCP(houseinfo[id][x], ...[y], ...[z]); Return 1; } |
Just Get the Coordinates of the house Exterior using the House ID and simply just create a checkpoint at the position.
|
forward OnAdminCreateHouse(playerid, houseid, type, Float, Float:y, Float:z, Float:angle); public OnAdminCreateHouse(playerid, houseid, type, Float, Float:y, Float:z, Float:angle) { strcpy(HouseInfo[houseid][hOwner], "Nobody", MAX_PLAYER_NAME); HouseInfo[houseid][hExists] = 1; HouseInfo[houseid][hID] = cache_insert_id(connectionID); HouseInfo[houseid][hOwnerID] = 0; HouseInfo[houseid][hType] = type; HouseInfo[houseid][hPrice] = houseInteriors[type][intPrice]; HouseInfo[houseid][hRentPrice] = 0; HouseInfo[houseid][hLevel] = 1; HouseInfo[houseid][hLocked] = 0; HouseInfo[houseid][hPosX] = x; HouseInfo[houseid][hPosY] = y; HouseInfo[houseid][hPosZ] = z; HouseInfo[houseid][hPosA] = angle; HouseInfo[houseid][hIntX] = houseInteriors[type][intX]; HouseInfo[houseid][hIntY] = houseInteriors[type][intY]; HouseInfo[houseid][hIntZ] = houseInteriors[type][intZ]; HouseInfo[houseid][hIntA] = houseInteriors[type][intA]; HouseInfo[houseid][hInterior] = houseInteriors[type][intID]; HouseInfo[houseid][hWorld] = HouseInfo[houseid][hID] + 1000000; HouseInfo[houseid][hOutsideInt] = GetPlayerInterior(playerid); HouseInfo[houseid][hOutsideVW] = GetPlayerVirtualWorld(playerid); HouseInfo[houseid][hCash] = 0; HouseInfo[houseid][hMaterials] = 0; HouseInfo[houseid][hWeed] = 0; HouseInfo[houseid][hCocaine] = 0; HouseInfo[houseid][hMeth] = 0; HouseInfo[houseid][hPainkillers] = 0; HouseInfo[houseid][hHPAmmo] = 0; HouseInfo[houseid][hPoisonAmmo] = 0; HouseInfo[houseid][hFMJAmmo] = 0; HouseInfo[houseid][hLabels] = 0; HouseInfo[houseid][hText] = Text3D:INVALID_3DTEXT_ID; HouseInfo[houseid][hPickup] = -1; |
CMD:findhouse(playerid, params[])
{
new houseid;
if(sscanf(params,"i",houseid)) return SendClientMessage(playerid, -1, "Use: /findhouse [id]");
SetPlayerCheckpoint(playerid, HouseInfo[houseid][hPosX], HouseInfo[houseid][hPosY], HouseInfo[houseid][hPosZ] , 5.0)
return 1;
}
COMMAND:findhouse(playerid, params[])
{
new fhouse;
if( sscanf ( params, "d", fhouse)) return SCP(playerid, "[house ID]");
SetPlayerCheckpoint(playerid, HouseInfo[fhouse][hPosX], HouseInfo[fhouse][hPosY], HouseInfo[fhouse][hPosZ], 2);
SendClientMSG(playerid, COLOR_YELLOW, "Marker has been set to house with the number %d.", fhouse);
return 1;
}
return SendClientMessage(playerid, -1, "[house ID]");
stock SCP(_id, _param[], _command[] = "")
{
format(iStr, sizeof(iStr), "[Command]: /%s {9c9a9c}%s", _command, _param);
return SendPlayerMessage(_id, 0x6A696AFF, iStr, "[Command]: / {9c9a9c}", 128);
}