INTEGER PRIMARY KEY AUTOINCREMENT , Some help...
#6

No, i need to modify command /lclan( leave clan ), to existent clans move on -1 keys everyone

PS. Here is the /lclan command:
Code:
CMD:lclan(playerid,params[])
{
    register(playerid);
    db:Query(xFM("UPDATE `gangs` SET `members` = `members`-1 WHERE `id`='%d'",gang[playerid][ID]));
	db:Query(xFM("UPDATE `players` SET `gang`='NULL' WHERE `name`='%s'",name));
	new DBResult:R;
	R = db:Query(xFM("SELECT * FROM `gangs` WHERE `id`='%d'",gang[playerid][ID]));
	db_get_field_assoc(R,"members",str,sizeof(str));
	db_free_result®;
	if(strval(str)==0)
	{
	    db:Query(xFM("DELETE FROM `gangs` WHERE `id`='%d'",gang[playerid][ID]));
	}
	format(str, sizeof(str), "CLAN: {F6358A}Jucatorul {FF0000}%s{F6358A} a parasit gasca sau a fost scos de catre leader!", name);
	for(new i;i<MAX_PLAYERS;i++)
	{
	    if(IsPlayerConnected(i)&& gang[i][ID]==gang[playerid][ID])
	    {
	        SendClientMessage( i, ~0, str );
	    }
	}
	ResetPlayerWeapons(playerid);
	gang[playerid][ID]=0;
	gang[playerid][rank]=0;
	gang[playerid][skin]=0;
	gang[playerid][spawnX]=0.0;
	gang[playerid][spawnY]=0.0;
	gang[playerid][spawnZ]=0.0;
	gang[playerid][spawnA]=0.0;
	gang[playerid][Weap1]=0;
	gang[playerid][Weap2]=0;
	gang[playerid][Weap3]=0;
	gang[playerid][Weap4]=0;
	gang[playerid][Weap5]=0;
	gang[playerid][Weap6]=0;
	gang[playerid][Kills]=0;
	gang[playerid][Deaths]=0;
	SetPlayerHealth( playerid, 0.0 );
	SetPlayerSkin( playerid, 217 );
	SetPlayerColor( playerid, RandomColors[ random( 400 ) ] );
	SendClientMessage( playerid, 0x00FF00FF, "You have left your clan, or you have been kicked by a leader!" );
	return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)