Y_Ini Errors CMD
#1

CMD:
pawn Код:
CMD:createbiz(playerid, params[])
{
    new bizid, genre, name[64], price, Float:x, Float:y, Float:z, string[150];
    if(sscanf(params,"ddds[64]", bizid, genre, price, name, Float:x, Float:y, Float:z, string[150])) // Error 1
    {
        SCM(playerid, COLOR_FADE1, "USAGE:/createbiz (id) (genre) (price) (name)");
        SendClientMessage(playerid, COLOR_RED, "NOTE:to see the Genres use (/genres)");
        return 1;
    }
    new file[32];
    format(file, sizeof(file), BPATH, bizid);
    if(fexist(file)) return SendClientMessage(playerid, COLOR_GRAD2, "This Business ID is not available.");
    if(bizid >= MAX_BIZ) return SendClientMessage(playerid, COLOR_GRAD2, "MAX_BIZ is reached. Please increase MAX_BIZ.");
    if(genre < 1 || genre > 8) return SendClientMessage(playerid, COLOR_GRAD2, "Choose a genre between 1 and 8.");
    else
    {
        GetPlayerPos(playerid, x, y, z);
        INI_Open(file);
        INI_WriteString(file,"Name", name);//Error
        INI_WriteString(file, "None"); //Error
        INI_WriteInt(file, "Till", 0); // Error
        INI_WriteFloat(file, "XCoord", x);// Error
        INI_WriteFloat(file, "YCoord", y);// Error
        INI_WriteFloat(file, "ZCoord", z);// Error
        INI_WriteInt(file, "Genre", genre);//Error
        INI_WriteInt(file, "Price", price);// Error
        INI_WriteInt(file, "Owned", 0);// Error
        INI_WriteInt(file, "Locked", 0);//Error
        INI_WriteInt(file, "VW", bizid);// Error
        INI_WriteInt(file,"Entrance Fee", 0);// Error
        INI_WriteInt(file,"Products", 10);// Error
        INI_Close(file);// Error
    }
    return 1;
}
Errors:
Код:
C:\Documents and Settings\Adrian\My Documents\Samp Servers\World Wide Roleplay\gamemodes\WW-RP.pwn(1680) : error 032: array index out of bounds (variable "string")
C:\Documents and Settings\Adrian\My Documents\Samp Servers\World Wide Roleplay\gamemodes\WW-RP.pwn(1695) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Adrian\My Documents\Samp Servers\World Wide Roleplay\gamemodes\WW-RP.pwn(1696) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Adrian\My Documents\Samp Servers\World Wide Roleplay\gamemodes\WW-RP.pwn(1697) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Adrian\My Documents\Samp Servers\World Wide Roleplay\gamemodes\WW-RP.pwn(1698) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Adrian\My Documents\Samp Servers\World Wide Roleplay\gamemodes\WW-RP.pwn(1699) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Adrian\My Documents\Samp Servers\World Wide Roleplay\gamemodes\WW-RP.pwn(1700) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Adrian\My Documents\Samp Servers\World Wide Roleplay\gamemodes\WW-RP.pwn(1701) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Adrian\My Documents\Samp Servers\World Wide Roleplay\gamemodes\WW-RP.pwn(1702) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Adrian\My Documents\Samp Servers\World Wide Roleplay\gamemodes\WW-RP.pwn(1703) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Adrian\My Documents\Samp Servers\World Wide Roleplay\gamemodes\WW-RP.pwn(1704) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Adrian\My Documents\Samp Servers\World Wide Roleplay\gamemodes\WW-RP.pwn(1705) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Adrian\My Documents\Samp Servers\World Wide Roleplay\gamemodes\WW-RP.pwn(1706) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Adrian\My Documents\Samp Servers\World Wide Roleplay\gamemodes\WW-RP.pwn(1707) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Adrian\My Documents\Samp Servers\World Wide Roleplay\gamemodes\WW-RP.pwn(1708) : error 035: argument type mismatch (argument 1)
Reply
#2

Код:
new file[32];
Should be:

Код:
new INI:file;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)