pawn Код:
CMD:criarcasa(playerid, params[])
{
if(IsPlayerAdmin(playerid)) {
new preco, int;
if(sscanf(params, "ii", preco, int)) return SendClientMessage(playerid, Vermelho, "/criarcasa [preзo] [interiorID]");
for(new c = 0; c < MAX_CASAS; c++) {
format(string, sizeof(string), "/Casas/casa%d.ini", proximacasa);
if(!DOF2_FileExists(string)) {
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
DOF2_CreateFile(string);
DOF2_SetFloat(string, "PosX", X);
DOF2_SetFloat(string, "PosY", Y);
DOF2_SetFloat(string, "PosZ", Z);
DOF2_SetInt(string, "Int", int);
DOF2_SetInt(string, "Mundo", proximacasa);
DOF2_SetInt(string, "TDono", 0);
DOF2_SetString(string, "Dono", "Ninguem");
DOF2_SetString(string,"Mensagemc","Nenhuma");
DOF2_SetInt(string, "Preco", preco);
DOF2_SetInt(string, "Trancada", 0);
new pickupid;
pickupid = CreatePickup(1273, 1, DOF2_GetFloat(string, "PosX"), DOF2_GetFloat(string, "PosY"), DOF2_GetFloat(string, "PosZ"), -1);
DOF2_SetInt(string, "Id", pickupid);
new Casa2[128];
format(Casa2, sizeof(Casa2),"Casa ID %d", proximacasa);
CasaTxT[c] = Create3DTextLabel(Casa2,-1,DOF2_GetFloat(string, "PosX"), DOF2_GetFloat(string, "PosY"), DOF2_GetFloat(string, "PosZ")+0.75,20.0,0,1);
new string2[256];
format(string2, sizeof(string2),"| INFO | Vocк criou uma casa! ID da casa: %d / Preзo: %d / Interior: %d.",proximacasa, preco, int);
SendClientMessage(playerid,0xFFFFFFAA,string2);
}
proximacasa++;
}
}
return 1;
}