Variable help in my command
#1

Hello,
I have some problems with var in my /reportbug and /bugs commands. Through command /reportbug players can report bugs on my server if they see them and through /bugs command admins can see bugs that they reported. /reportbug works fine but when i type /bugs I see just part of command. Here is script:
pawn Код:
new bugss[128];
forward Bugs_bugid(playerid,name[],value[]);
forward Bugs_bug(playerid,name[],value[]);
public Bugs_bugid(playerid,name[],value[])
{
    INI_Int("bugid", PlayerInfo[playerid][bugid]);
    return 1;
}
public Bugs_bug(playerid,name[],value[])
{
    for(new i = 0; i < PlayerInfo[playerid][bugid]-1; i++)
    {
        PlayerInfo[playerid][var]=i;
        INI_String(PlayerInfo[playerid][var], bugss, i);
    }
    return 1;
}
CMD:reportbug(playerid, params[])
{
    new string[128], str[128];
    format(string, sizeof(string), "%s: %s", GetName(playerid), params);
    format(str, sizeof(str), "%i", PlayerInfo[playerid][bugid]);
    new INI:bug = INI_Open("Bugs.ini");
    INI_SetTag(bug, "bugid");
    INI_WriteInt(bug, "bugid", PlayerInfo[playerid][bugid]+1);
    INI_SetTag(bug, "bug");
    INI_WriteString(bug, str, string);
    INI_Close(bug);
    PlayerInfo[playerid][bugid]+=1;
    SendClientMessage(playerid, COLOR_GREEN, "Thanks for reporting!");
    return 1;
}
CMD:bugs(playerid, params[])
{
    for(new w = 0; w < PlayerInfo[playerid][bugid]; w++)
    {
        new string[128];
        format(string, sizeof(string), "ID:%i(%s)", w, bugss[w]);
        SendClientMessage(playerid, BLAU, string);
    }
    return 1;
}
As you can see, if player types "Something" at /reportbug and I type /bugs I shoud see something like "ID:0(RockyGamer: Something)", but I see just "ID:0()"!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)