CreateGroup run time error
#1

Hello,

I have a problem with my creategroup command.
When i use the command it says unknown command and i get this error:

Код:
[18:10:51] [debug] Run time error 6: "Invalid instruction"
[18:10:51] [debug]  Unknown opcode 0x110 at address 0x00000073
[18:10:51] [debug] AMX backtrace:
[18:10:51] [debug] #0 ???????? in public OnPlayerCommandText () from test.amx
My Code:
pawn Код:
dcmd_creategroup(playerid, params[])
{
    new groupname;
    //if(!IsPlayerAdmin(playerid)) return 0;
    if(sscanf(params,"s[25]",groupname)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /creategroup [Groupname]");
    new query1[300];
    Total_Groups_Created++;
    GroupInfo[Total_Groups_Created][gID] = Total_Groups_Created;
    format(GroupInfo[Total_Groups_Created][gName], 64, "%s", groupname);
    format(GroupInfo[Total_Groups_Created][gOwner], 64, "%s", GetPlayeridName(playerid));
    GroupInfo[Total_Groups_Created][gMoney]=0;
    GroupInfo[Total_Groups_Created][gScore]=0;
    GroupInfo[Total_Groups_Created][gKills]=0;
    GroupInfo[Total_Groups_Created][gDeaths]=0;
    format(query1, sizeof(query1), "INSERT INTO `"#MYSQL_GROUP_TABLE"` (`GroupID`,`GroupName`,`GroupOwner`) VALUES ('%d','%s','%s')",GroupInfo[Total_Groups_Created][gID] ,GroupInfo[Total_Groups_Created][gName],GetPlayeridName(GroupInfo[Total_Groups_Created][gOwner]));
   
    if(mysql_ping(gSQL))
    {
        mysql_query(query1, _THREAD_CREATE_GROUP, playerid, gSQL);
    }
    return 1;
}
How can i fix this and how can i add if the groupname already exists?

Thanks Admigo
Reply
#2

pawn Код:
new groupname[25];
Reply
#3

Quote:
Originally Posted by DiGiTaL_AnGeL
Посмотреть сообщение
pawn Код:
new groupname[25];
My bad, Thanks.
Now i have another problem i noticed.
When the group succesfull is created with " /creategroup test" i see in my mysql database:
GroupId 1(Thats good)
GroupName tA(Bad)
GroupOwner blank(nothing shows here)
How can i fix this?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)