29.11.2014, 23:01
pawn Код:
CMD:addentradahouse(playerid, params[])
{
if(Player[playerid][pAdmin] < 7)
return SendClientMessage(playerid, COLOR_RED, "[ERRO] Vocк nгo tem permissгo para usar este comando!");
new h;
if(sscanf(params, "i", h))
return SendClientMessage(playerid, COLOR_GREY, "[USO] /addentradacasa [houseid] - Move a casa atй vocк.");
if(h > sizeof(HouseInfo) || h < 0)
return SendClientMessage(playerid,COLOR_RED, "[ERRO] O ID da casa deve ser de 0 а 64.");
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
format(thestring,sizeof(thestring)," %s mudou a entrada da casa %d para %f - %f - %f",Player[playerid][pName],h,X,Y,Z);
WriteLog("rpedits", thestring);
ABroadCast(COLOR_YELLOW,thestring,5);
HouseInfo[h][hEntrancex] = X;
HouseInfo[h][hEntrancey] = Y;
HouseInfo[h][hEntrancez] = Z;
DestroyDynamicPickup(HouseInfo[h][hIcon]);
Delete3DTextLabel(HouseInfo[h][HouseLabel]);
if(HouseInfo[h][hOwned] == 1)
{
HouseInfo[h][hIcon] = CreateDynamicPickup(1239, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
if(HouseInfo[h][hRentabil] == 0)
format(thestring, sizeof(thestring), "Proprietбrio da casa: %s \nLevel : %d",hOwner[h],HouseInfo[h][hLevel]);
else
format(thestring, sizeof(thestring), "Proprietбrio da casa: %s \nAluguel: R$ %d - Level : %d \nDigite /alugarcasa para alugar um quarto",hOwner[h],HouseInfo[h][hRent],HouseInfo[h][hLevel]);
HouseInfo[h][HouseLabel] = Create3DTextLabel(thestring ,COLOR_WHITE, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1.0,30.0,0);
}
if(HouseInfo[h][hOwned] == 0)
{
HouseInfo[h][hIcon] = CreateDynamicPickup(1273, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
format(thestring, sizeof(thestring), "A casa estб a venda \n Descricгo: %s \n Preco: R$ %d - Level : %d\n Para comprar digite /comprarcasa",hDiscription[h],HouseInfo[h][hValue],HouseInfo[h][hLevel]);
HouseInfo[h][HouseLabel] = Create3DTextLabel(thestring ,COLOR_WHITE, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1.0,30.0,0);
}
pickups++;
OnPropUpdate();
return 1;
}
CMD:addspawn(playerid, params[])
{
if(Player[playerid][pAdmin] < 7)
return SendClientMessage(playerid, COLOR_RED, "[ERRO] Vocк nгo tem permissгo para usar este comando!");
new proplev;
if(sscanf(params, "i", proplev))
return SendClientMessage(playerid, COLOR_GREY, "[USO] /addspawn [houseid]");
if(proplev > sizeof(HouseInfo) || proplev < 0)
return SendClientMessage(playerid,COLOR_RED, "[ERRO] O ID da casa deve ser de 0 а 91.");
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
format(thestring,sizeof(thestring),"Spawn da casa %d mudada %f - %f - %f",proplev,X,Y,Z);
ABroadCast(COLOR_YELLOW,thestring,5);
HouseInfo[proplev][hExitx] = X;
HouseInfo[proplev][hExity] = Y;
HouseInfo[proplev][hExitz] = Z;
OnPropUpdate();
return 1;
}