17.04.2013, 16:24
pawn Код:
if(strcmp(cmd, "/liberarcasa", true) == 0)
{
new preco;
new tmp[256];
new location[MAX_ZONE_NAME];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, Vermelho, "/liberarcasa [casaID]");
return 1;
}
preco = strval(tmp);
format(string, sizeof(string), "/Casas/casa%d.ini", preco);
if(dini_Exists(string))
{
if(pAdmin[playerid] >= 5)
{
format(file, sizeof(file), PASTA_CONTAS, dini_Get(string, "Dono"));
dini_FloatSet(file,"CasaX",Float:1410.5046);
dini_FloatSet(file,"CasaY",Float:-1789.7197);
dini_FloatSet(file,"CasaZ",Float:13.8285);
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
dini_IntSet(string, "TDono", 0);
dini_Set(string, "Dono", "Nenhum");
new pickupid;
DestroyPickup(dini_Int(string, "Id"));
GetPlayer2DZonea(playerid, location, MAX_ZONE_NAME);
pickupid = CreatePickup(1273, 1, dini_Float(string, "PosX"), dini_Float(string, "PosY"), dini_Float(string, "PosZ"), -1);
dini_IntSet(string, "Id", pickupid);
format(string, sizeof(string), "(INFO) O administrador %s liberou a casa %d, Localizaзгo: %s", pname,preco, location);
SendClientMessageToAll(tcadm, string);
return 1;
}
else
{
SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo tem permissгo.");
}
}
return 1;
}