09.01.2015, 16:38
Quote:
But here i want to create a new file not read or write only.
I am sorry if i didn't understand you ! |
you can't use "File" as identifier as it's already a tag (side note, it's a strong tag cuz it's starting with a capital letter)
see, ill do it for you...
pawn Код:
CMD:createobject(playerid, params[])
{
new objectid;
new Float:x, Float:y, Float:z;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You have to be Rcon Admin");
if(sscanf(params, "u", objectid)) return SendClientMessage(playerid, -1, "Usage: /crateobject (Object ID)");
new pos = GetPlayerPos(playerid, x, y, z);
CreateObject(objectid, x+2, y, z, 0.0, 0.0, 96.0);
new Float:X, Float:Y, Float:Z;
GetObjectPos(X, Y, Z);
new Float:b, Float:c, Float:d;
GetObjectRot(b, c, d);
new INI:fh = INI_Open(UserPath(playerid));
INI_SetTag(fh,"Object");
INI_WriteInt(fh,"Object ID",objectid);
INI_WriteInt(fh,"XPos",X);
INI_WriteInt(fh,"YPos",Y);
INI_WriteInt(fh,"ZPos",Z);
INI_WriteInt(fh,"XRot",b);
INI_WriteInt(fh,"YRot",c);
INI_WriteInt(fh,"ZRot",d);
INI_Close(fh);
SendClientMessage(playerid, -1, "Object created");
return 1;
}
i myself usually just call them "h" but that doesn't matter.