Try this.
CMD:createclan(playerid, params[])
{
new cname[64], tag[24], tagtype;
if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You are not logged in.");
if(PlayerInfo[playerid][pCoins] < 1000) return SendClientMessage(playerid, COLOR_ERROR, "You don't have enough Gold. To create a clan you need to have 1000 gold.");
if(PlayerInfo[playerid][pCMember] + PlayerInfo[playerid][pCLeader] != 0) return SendClientMessage(playerid, COLOR_ERROR, "You already are in a clan. You can't create one.");
if(sscanf(params,"s[24]iis[64]",tag,tagtype,cname)) return SendClientMessage(playerid, COLOR_SYN, "Synthax:{FFFFFF} /createclan <tag> <tagtype (0 before / 1 after)> <name> | (!)Cost: 1000 gold");
{
if(ExistClan(tag)) return SendClientMessage(playerid, COLOR_ERROR, "Clan already exist.");
if(strlen(tag) > 10) return SendClientMessage(playerid, COLOR_ERROR, "Clan tag is to long.");
if(strlen(cname) > 32) return SendClientMessage(playerid, COLOR_ERROR, "Clan name is to long.");
TotalClans ++;
strmid(ClanInfo[TotalClans][cName], cname, 0, 32, 32);
strmid(ClanInfo[TotalClans][cTag], tag, 0, 10, 10);
ClanInfo[TotalClans][cTagType] = tagtype;
ClanInfo[TotalClans][cSlots] = 10;
gQuery[0] = (EOS);
mysql_format(handle, gQuery, sizeof(gQuery) ,"INSERT INTO `clans` (`Name`,`Tag`,`TagType`,`Slots`) VALUES ('%e','%e',%d,%d)",
ClanInfo[TotalClans][cName],
ClanInfo[TotalClans][cTag],
ClanInfo[TotalClans][cTagType],
ClanInfo[TotalClans][cSlots]);
mysql_query(handle ,gQuery);
new i = cache_insert_id();
format(gString,sizeof(gString),"Clan - %s - (ID:%d) with tag: %s and %d slots was created. Type [/shop] to buy more slots.", ClanInfo[TotalClans][cName], TotalClans, ClanInfo[TotalClans][cTag], ClanInfo[TotalClans][cSlots]);
SendClientMessage(playerid, COLOR_SYN2,gString);
format(gString, sizeof(gString), "%s created a clan: %s - (ID:%d) with tag: %s and %d slots.",GetName(playerid),ClanInfo[TotalClans][cName], TotalClans, ClanInfo[TotalClans][cTag], ClanInfo[TotalClans][cSlots]);
CMDRaport(gString, 5, 0);
PlayerInfo[playerid][pCoins] -= 1000;
PlayerInfo[playerid][pCLeader] = i;
Update(playerid, pCoinsx);
}
return 1;
}