Jump to content
  • 0

Problema Clan


S1meD.

Question

Salut, am și eu o problema cu sistem-ul de Clanuri am un GM Mysql. Problema e ca îți modifica numele cu tot cu Tag.

CMD:makeclan(playerid, params[])
{
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi  mai intai.");
	if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_DS, AdminOnly);
	new id,tag[25],name[25],name2[25],string[256];
	if(sscanf(params, "us[25]",id,tag)) return SCM(playerid,COLOR_DS,"{B8DBFF}Syntax: /makeclan <Leader Name/Playerid> <Clan Tag>");
	if(PlayerInfo[id][pClan] >= 1) return SCM(playerid,COLOR_DS,"{37B9C8}This player is in a clan.");
	if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_DS, "{FFFFCC}Error: Player not connected.");
	new clane = MySQLCheckClan(tag);
	if(clane != 0) return SCM(playerid,COLOR_DS,"{37B9C8}This clan exist, please chose another.");
	GetPlayerName(id,name2,sizeof(name2));
	GetPlayerName(id,name,sizeof(name));
	strins(name,tag, 0);
	new namet = strlen(name);
	if(namet > 24) return SCM(playerid,COLOR_DS,"{37B9C8}This name is large.");
	new newname = MySQLCheckAccount(name);
	if(newname != 0) return SCM(playerid,COLOR_DS,"{37B9C8}This name exist.");
	SetPlayerName(id,name);
	strmid(PlayerInfo[id][pClanTag], tag, 0, strlen(tag), 255);
	PlayerInfo[id][pClan] = 2;
	format(string,sizeof(string),"UPDATE users SET `ClanTag`='%s',`Clan`='2' WHERE `name`='%s'",tag,name2);
	mysql_query(SQL,string);
	format(string,sizeof(string),"UPDATE users SET `name`='%s' WHERE `name`='%s'",name,name2);
	mysql_query(SQL,string);
	if(PlayerInfo[id][pPhousekey] != 999 && strcmp(name2, HouseInfo[PlayerInfo[id][pPhousekey]][hOwner], true) == 0)
	{
		new houseid = PlayerInfo[id][pPhousekey];
		strmid(HouseInfo[houseid][hOwner], name, 0, strlen(name), 255);
		format(string,sizeof(string),"UPDATE `houses` SET `Owner`='%s' WHERE `ID`='%d'",name,houseid);
		mysql_query(SQL,string);
		OnPropTextdrawUpdate(1,PlayerInfo[id][pPhousekey]);
	}
	if(PlayerInfo[id][pPbiskey] != 255)
	{
		new bizid2 = PlayerInfo[id][pPbiskey];
		if(PlayerInfo[id][pPbiskey] > 100)
		{
			strmid(SBizzInfo[bizid2-100][sbOwner], name, 0, strlen(name), 255);
			format(string,sizeof(string),"UPDATE `sbizz` SET `Owner`='%s' WHERE `ID`='%d'",name,bizid2-100);
			mysql_query(SQL,string);
			OnPropTextdrawUpdate(3,bizid2-100);
		}
		else
		{
			strmid(BizzInfo[bizid2][bOwner], name, 0, strlen(name), 255);
			format(string,sizeof(string),"UPDATE `bizz` SET `Owner`='%s' WHERE `ID`='%d'",name,bizid2);
			mysql_query(SQL,string);
			OnPropTextdrawUpdate(2,PlayerInfo[id][pPbiskey]);
		}
	}
	if(PlayerInfo[id][pPcarkey] != 0)
	{
		new carid = PlayerInfo[id][pPcarkey];
		strmid(CarInfo[carid][cOwner], name, 0, strlen(name), 255);
		vUpdate(carid,cOwnerx);
	}
	if(PlayerInfo[id][pmotokey] != 0)
	{
		new carid = PlayerInfo[id][pmotokey];
		strmid(CarInfo[carid][cOwner], name, 0, strlen(name), 255);
		vUpdate(carid,cOwnerx);
	}
	if(PlayerInfo[id][phelikey] != 0)
	{
		new carid = PlayerInfo[id][phelikey];
		strmid(CarInfo[carid][cOwner], name, 0, strlen(name), 255);
		vUpdate(carid,cOwnerx);
	}
	if(PlayerInfo[id][pprcarkey] != 0)
	{
		new carid = PlayerInfo[id][pprcarkey];
		strmid(CarInfo[carid][cOwner], name, 0, strlen(name), 255);
		vUpdate(carid,cOwnerx);
	}
	new sendername[25];
	GetPlayerName(playerid,sendername,sizeof(sendername));
	format(string,sizeof(string),"Admin %s promoted you as leader of clan %s.",sendername,tag);
	SCM(id,COLOR_LIGHTBLUE,string);
	PlayerInfo[id][pCRank] = 3;
    format(string, sizeof(string), "UPDATE users SET `CRank`='3' WHERE `name`='%s'", name);
    mysql_query(SQL,string);
	return 1;
}
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
  • 0

Ai una bucata cod aici:

        format(string,sizeof(string),"UPDATE users SET `ClanTag`='%s',`Clan`='2' WHERE `name`='%s'",tag,name2);
	mysql_query(SQL,string);

asta iti face update la clanTag. Daca vrei sa scapi de ea sterge tot ce tine de ea.

Eu vreau ca cînd te conectezi pe sv sa-ți dea Tag automat. 

Link to comment
Share on other sites

  • 0
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.