SA-MP Forums Archive
Commands don't work ! - 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: Commands don't work ! (/showthread.php?tid=633151)



Commands don't work ! - Lester23 - 26.04.2017

Hi I have a command problem whenever I type it nothing happens, I checked it so many times

Код:
CMD:clan(playerid, params[])
{
	if(PlayerInfo[playerid][pClan] >= 1)
	{
		ShowPlayerDialog(playerid, DIALOG_CLAN, DIALOG_STYLE_LIST, "Clan", "Clan Help\nClan Members\nClan Settings\nClan Tag", "Select", "Close");
	}
	return 1;
}
here's the dialog_clan is made (I guess is not necessary posting it here since it's big and hard to read)

any ideas what's wrong ?


Re: Commands don't work ! - Lbaker - 26.04.2017

Did u checked , If PlayerInfo[playerid][pClan] Is >= 1 ?


Re: Commands don't work ! - Lester23 - 26.04.2017

actually

you need to buy the clan from /shop with premium points, I did, but when typing /clan nothing shows up... sorry for being dumb but I am still looking to fix this


Re: Commands don't work ! - XBrianX - 26.04.2017

Did you make sure that the dialog id that you're using is not taken?


Re: Commands don't work ! - Lbaker - 26.04.2017

PHP код:
CMD:clan(playeridparams[])
{
    if(
PlayerInfo[playerid][pClan] >= 1)
    {
        
ShowPlayerDialog(playeridDIALOG_CLANDIALOG_STYLE_LIST"Clan""Clan Help\nClan Members\nClan Settings\nClan Tag""Select""Close");
                print(
"CLAN INSIDE DIALOG");
    }
        print(
"CLAN OUTSIDE DIALOG");
    return 
1;

Try this and put logs then.


Re: Commands don't work ! - Lester23 - 26.04.2017

Quote:
Originally Posted by Lbaker
Посмотреть сообщение
PHP код:
CMD:clan(playeridparams[])
{
    if(
PlayerInfo[playerid][pClan] >= 1)
    {
        
ShowPlayerDialog(playeridDIALOG_CLANDIALOG_STYLE_LIST"Clan""Clan Help\nClan Members\nClan Settings\nClan Tag""Select""Close");
                print(
"CLAN INSIDE DIALOG");
    }
        print(
"CLAN OUTSIDE DIALOG");
    return 
1;

Try this and put logs then.
Doesn't work at all... strange thing is when I do /cinvite someone, it says I touched maximum members, what?

Код:
CMD:cinvite(playerid, params[])
{
    if(PlayerInfo[playerid][pCRank] < 6) return SendClientMessage(playerid, COLOR_WHITE, "Doar playerii cu rank 6 si 7 pot invita membri in clan.");
    new userID,giveplayer[25],sendername[25],szMessage[119];
    if(sscanf(params, "u", userID)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /cinvite [id]");
	{
        if(GetClanMembers(PlayerInfo[playerid][pClan]) >= ClanInfo[PlayerInfo[playerid][pClan]][cClanSlots]) return SendClientMessage(playerid, COLOR_WHITE, "You have reached maximum members.");
		if(userID == playerid) return SendClientMessage(playerid, COLOR_WHITE, "Nu poti sa te inviti singur in clan.");
		if(ClanInfo[PlayerInfo[playerid][pClan]][cClanActive] < 1) return SendClientMessage(playerid, COLOR_WHITE, "Nu poti invita membri deoarece clanul a expirat (pentru prelungire intra pe panel).");
		if(IsPlayerConnected(userID))
		{
			if(PlayerInfo[userID][pClan] == 0)
			{
				GetPlayerName(userID,giveplayer,sizeof(giveplayer));
				format(szMessage, sizeof(szMessage), "You have invited %s to join your clan.", giveplayer);
				SendClientMessage(playerid, COLOR_LIGHTBLUE, szMessage);

				GetPlayerName(playerid,sendername,sizeof(sendername));
				format(szMessage, sizeof(szMessage), "%s te-a invitat in clanul %s. Foloseste /accept cinvite %d pentru a accepta.", sendername, ClanInfo[PlayerInfo[playerid][pClan]][cClanName], playerid);
				SendClientMessage(userID, COLOR_BLUE, "Invitatie noua in clan:");
				SendClientMessage(userID, COLOR_BLUE, szMessage);

				SetPVarInt(userID, "cinvID", PlayerInfo[playerid][pClan]);
				SetPVarInt(userID, "cinvIDD", playerid);
			}
		}
	}
    return 1;
}



Re: Commands don't work ! - Sc0pion - 27.04.2017

Quote:
Originally Posted by Lester23
Посмотреть сообщение
Doesn't work at all... strange thing is when I do /cinvite someone, it says I touched maximum members, what?

Код:
CMD:cinvite(playerid, params[])
{
    if(PlayerInfo[playerid][pCRank] < 6) return SendClientMessage(playerid, COLOR_WHITE, "Doar playerii cu rank 6 si 7 pot invita membri in clan.");
    new userID,giveplayer[25],sendername[25],szMessage[119];
    if(sscanf(params, "u", userID)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /cinvite [id]");
	{
        if(GetClanMembers(PlayerInfo[playerid][pClan]) >= ClanInfo[PlayerInfo[playerid][pClan]][cClanSlots]) return SendClientMessage(playerid, COLOR_WHITE, "You have reached maximum members.");
		if(userID == playerid) return SendClientMessage(playerid, COLOR_WHITE, "Nu poti sa te inviti singur in clan.");
		if(ClanInfo[PlayerInfo[playerid][pClan]][cClanActive] < 1) return SendClientMessage(playerid, COLOR_WHITE, "Nu poti invita membri deoarece clanul a expirat (pentru prelungire intra pe panel).");
		if(IsPlayerConnected(userID))
		{
			if(PlayerInfo[userID][pClan] == 0)
			{
				GetPlayerName(userID,giveplayer,sizeof(giveplayer));
				format(szMessage, sizeof(szMessage), "You have invited %s to join your clan.", giveplayer);
				SendClientMessage(playerid, COLOR_LIGHTBLUE, szMessage);

				GetPlayerName(playerid,sendername,sizeof(sendername));
				format(szMessage, sizeof(szMessage), "%s te-a invitat in clanul %s. Foloseste /accept cinvite %d pentru a accepta.", sendername, ClanInfo[PlayerInfo[playerid][pClan]][cClanName], playerid);
				SendClientMessage(userID, COLOR_BLUE, "Invitatie noua in clan:");
				SendClientMessage(userID, COLOR_BLUE, szMessage);

				SetPVarInt(userID, "cinvID", PlayerInfo[playerid][pClan]);
				SetPVarInt(userID, "cinvIDD", playerid);
			}
		}
	}
    return 1;
}
If you do not want that message, comment that line.
PHP код:
CMD:cinvite(playeridparams[])
{
    if(
PlayerInfo[playerid][pCRank] < 6) return SendClientMessage(playeridCOLOR_WHITE"Doar playerii cu rank 6 si 7 pot invita membri in clan.");
    new 
userID,giveplayer[25],sendername[25],szMessage[119];
    if(
sscanf(params"u"userID)) return SendClientMessage(playeridCOLOR_WHITE"Usage: /cinvite [id]");
    {
        
//if(GetClanMembers(PlayerInfo[playerid][pClan]) >= ClanInfo[PlayerInfo[playerid][pClan]][cClanSlots]) return SendClientMessage(playerid, COLOR_WHITE, "You have reached maximum members.");
        
if(userID == playerid) return SendClientMessage(playeridCOLOR_WHITE"Nu poti sa te inviti singur in clan.");
        if(
ClanInfo[PlayerInfo[playerid][pClan]][cClanActive] < 1) return SendClientMessage(playeridCOLOR_WHITE"Nu poti invita membri deoarece clanul a expirat (pentru prelungire intra pe panel).");
        if(
IsPlayerConnected(userID))
        {
            if(
PlayerInfo[userID][pClan] == 0)
            {
                
GetPlayerName(userID,giveplayer,sizeof(giveplayer));
                
format(szMessagesizeof(szMessage), "You have invited %s to join your clan."giveplayer);
                
SendClientMessage(playeridCOLOR_LIGHTBLUEszMessage);
                
GetPlayerName(playerid,sendername,sizeof(sendername));
                
format(szMessagesizeof(szMessage), "%s te-a invitat in clanul %s. Foloseste /accept cinvite %d pentru a accepta."sendernameClanInfo[PlayerInfo[playerid][pClan]][cClanName], playerid);
                
SendClientMessage(userIDCOLOR_BLUE"Invitatie noua in clan:");
                
SendClientMessage(userIDCOLOR_BLUEszMessage);
                
SetPVarInt(userID"cinvID"PlayerInfo[playerid][pClan]);
                
SetPVarInt(userID"cinvIDD"playerid);
            }
        }
    }
    return 
1;