CreateGroup run time error - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: CreateGroup run time error (
/showthread.php?tid=435575)
CreateGroup run time error -
Admigo - 07.05.2013
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
Re: CreateGroup run time error -
DiGiTaL_AnGeL - 07.05.2013
Re: CreateGroup run time error -
Admigo - 07.05.2013
Quote:
Originally Posted by DiGiTaL_AnGeL
|
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?