Unknown Command ??!
#2

Quote:
Originally Posted by nezo2001
Посмотреть сообщение
I made this command but when i use it it give me unknown command
PHP код:
CMD:createobject(playeridparams[])
{
    new 
objectid;
    new 
Float:xFloat:yFloat: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(playeridxyz);
    
CreateObject(objectidx+2yz,  0.00.096.0);
    new 
Float:XFloat:YFloat:Z;
    
GetObjectPos(XYZ);
    new 
Float:bFloat:cFloat:d;
    
GetObjectRot(bcd);
    new 
INI:File INI_Open(UserPath(playerid));
    
INI_SetTag(File,"Object");
    
INI_WriteInt(File,"Object ID",objectid);
    
INI_WriteInt(File,"XPos",X);
    
INI_WriteInt(File,"YPos",Y);
    
INI_WriteInt(File,"ZPos",Z);
    
INI_WriteInt(File,"XRot",b);
    
INI_WriteInt(File,"YRot",c);
    
INI_WriteInt(File,"ZRot",d);
    
INI_Close(File);
    
SendClientMessage(playerid, -1"Object created");
    return 
1;

Please Help !!
the identifier you declared for the file handler to be stored in is a tag.
identifiers may not be the same as keywords/tags or start with numbers or operators
just change "File" to "h" or something else

example for basic file I/O in pawn
Quote:
Originally Posted by wikisamp
pawn Код:
// Open "file.txt" in "write only" mode
new File:handle = fopen("file.txt", io_write);
 
// Check, if file is open
if(handle)
{
    // Success
 
    // Write "I just wrote here!" into this file
    fwrite(handle, "I just wrote here!");
 
    // Close the file
    fclose(handle);
}
else
{
    // Error
    print("Failed to open file \"file.txt\".");
}
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)