07.05.2013, 16:15
Hello,
I have a problem with my creategroup command.
When i use the command it says unknown command and i get this error:
My Code:
How can i fix this and how can i add if the groupname already exists?
Thanks Admigo
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
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;
}
Thanks Admigo