Jump to content
  • 0

Kick silent


LeetRomania

Question

Salutare. As dori sa fac comanda /kick doar ca daca pun la reason | silent sa se primeasca kick cu silent.

Eu am facut asa dar nu merge. Cand dau kick se pune reason | silent cand ar trebui sa nu se puna nimic. 

Asta am facut:

CMD:kick(playerid, params[])
{
    if(playerVariables[playerid][pAdminLevel] >= 1 || playerVariables[playerid][pHelperLevel] >= 2)
	{
	    new id, reason[60], string[126];

    	if(sscanf(params, "us[60]", id, reason))
		return S(playerid, COLOR_GREY,"Syntax: {FFFFFF}/kick [playerid] [reason]");

		if(id == INVALID_PLAYER_ID)
		return S(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");

		if(playerVariables[playerid][pAdminLevel] < playerVariables[id][pAdminLevel])
		return S(playerid, COLOR_GREY, "You can't kick an administrator witch have an admin level higher than you.");
		
		if(strcmp(reason, "| silent", true) == 0)
		{
		    return 1;
		}
    }
    return 1;
} 

 

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0
4 minutes ago, LeetRomania said:

Poate nu ai inteles. Deci, doresc sa fie asa:

Daca scrie /kick 0 Salut -> Playerul cu ID 0 sa primeasca kick si sa apara pe tot chatul ca a primit kick + reason: Salut. Stiu sa fac asta.

Eu nu stiu cum as putea face ca daca scrie /kick 0 Salut | silent sa primeasca kick cu silent si sa apara doar la admini ca a primit kick.

Foloseste strfind sa vezi daca contine textul | silent.

  • Upvote 1
Link to comment
Share on other sites

  • 0

Salut!

Poftim aici:

CMD:kick(playerid, params[])
{
    if(playerVariables[playerid][pAdminLevel] >= 1 || playerVariables[playerid][pHelperLevel] >= 2)
	{
	    new rParam[10], id, reason[60], string[126];
		//----------------------------------------------------------------------
    	if(sscanf(params, "s[10]us[60]", rParam, id, reason)) return S(playerid, COLOR_GREY,"Syntax: {FFFFFF}/kick [Option: Silent/NoSilent] [ID/Name] [reason]");
		//----------------------------------------------------------------------
		else if(id == INVALID_PLAYER_ID) return S(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
		//----------------------------------------------------------------------
		else if(playerVariables[playerid][pAdminLevel] < playerVariables[id][pAdminLevel]) return S(playerid, COLOR_GREY, "You can't kick an administrator witch have an admin level higher than you.");
		//----------------------------------------------------------------------
		if(strcmp(rParam, "silent", true) == 0)
		{
		    // silent kick
		    return 1;
		}
        else if(strcmp(rParam, "nosilent", true) == 0)
		{
		    // no silent kick
		    return 1;
		}
    }
    else return S(playerid, RED, "ERROR: You are not a high enough Admin Level to use this command!");
}

N-am testat, nu promit ca merge, dar sigur merge! =))

Edited by Voller.
......

350x20_FFFFFF_FFFFFF_000000_000000.png

Link to comment
Share on other sites

  • 0
23 minutes ago, WopsS said:

Ca sa ii dai kick fara sa apara pe chat, acolo unde ai facut acel strcmp pui direct functia Kick, daca nu pui mesajul si functia Kick (vezi ca mesajul nu o sa ajunga inainte de a scoate jucatorul de pe server).

Poate nu ai inteles. Deci, doresc sa fie asa:

Daca scrie /kick 0 Salut -> Playerul cu ID 0 sa primeasca kick si sa apara pe tot chatul ca a primit kick + reason: Salut. Stiu sa fac asta.

Eu nu stiu cum as putea face ca daca scrie /kick 0 Salut | silent sa primeasca kick cu silent si sa apara doar la admini ca a primit kick.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.