13.03.2013, 18:57
consegui faze um poco
alguem pff
pawn Код:
CMD:criarcasa(playerid, params[])
{
new interior,preco;
if(sscanf(params,"dd", interior, preco)) return SendClientMessage(playerid,-1,"Use: /criarcasa [Int] [Preco]");
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0],Pos[1], Pos[2]);
new file[56],IDCasa;
if(!DOF2_FileExists("IDCasas.ini"))
{
if(DOF2_CreateFile("IDCasas.ini"))
{
INI_WriteInt("ID",nCasas);
DOF2_SaveFile();
}
}
if(DOF2_CreateFile("IDCasas.ini"))
{
IDCasa = INI_ReadInt("ID");
format(file,sizeof(file),"Casas/%d.ini", IDCasa);
INI_Close();
}
if(DOF2_CreateFile(file))
{
DOF2_GetInt("Int", interior);
DOF2_GetInt("Preco", preco);
DOF2_GetFloat("PosX", Pos[0]);
DOF2_GetFloat("PosY", Pos[1]);
DOF2_GetFloat("PosZ", Pos[2]);
pickupcasa[IDCasa] = CreatePickup(1273, 1, Pos[0],Pos[1],Pos[2], 0);
format(Text3D[IDCasa], 60,"Casa a venda\nPreзo: %d", preco);
Create3DTextLabel(Text3D[IDCasa],-1,Pos[0],Pos[1],Pos[2], 6,0,0);
DOF2_SaveFile();
INI_Close();
nCasas ++;
if(DOF2_CreateFile("IDCasas.ini"))
{
INI_WriteInt("ID", nCasas);
DOF2_SaveFile();
}
}
return 1;
}