Unknown Command ??!
#6

Quote:
Originally Posted by nezo2001
Посмотреть сообщение
But here i want to create a new file not read or write only.
I am sorry if i didn't understand you !
look, all you need to do is change "File" to something else.
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 called it "fh" which is a synonym for "file handler"
i myself usually just call them "h" but that doesn't matter.
Reply


Messages In This Thread
Unknown Command ??! - by nezo2001 - 09.01.2015, 16:07
Re: Unknown Command ??! - by CutX - 09.01.2015, 16:14
Re: Unknown Command ??! - by nezo2001 - 09.01.2015, 16:19
Re: Unknown Command ??! - by CutX - 09.01.2015, 16:21
Re: Unknown Command ??! - by nezo2001 - 09.01.2015, 16:31
Re: Unknown Command ??! - by CutX - 09.01.2015, 16:38
Re: Unknown Command ??! - by nezo2001 - 09.01.2015, 16:39
Re: Unknown Command ??! - by CutX - 09.01.2015, 16:54
Re: Unknown Command ??! - by nezo2001 - 09.01.2015, 16:54
Re: Unknown Command ??! - by CutX - 09.01.2015, 16:57

Forum Jump:


Users browsing this thread: 3 Guest(s)