SA-MP Forums Archive
Ban command problem - 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: Ban command problem (/showthread.php?tid=509151)



Ban command problem - UnlimitedFreeroam - 25.04.2014

Hello everyone,

Today I have written a ban command but it is giving me a strange error which I could not fix by myself, hopefully you could help me out:

Код:
YCMD:ban(playerid, params[], help)
{
        #pragma unused help
        if(P_Data[playerid][pAdmin] == 0) return SCM(playerid, COLOR_RED, "* You are not authorized to use this command!");
        new
			string[128],pplayerid, reason[48];
        if(sscanf(params, "us[48]", pplayerid, reason)) return SCM(playerid, COLOR_RED, "Usage: /ban [Player ID/Player Name] [Reason]");
        if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
		if(P_Data[pplayerid][pAdmin] == 5) return SCM(playerid, COLOR_RED, "You cannot ban an admin level 5");
		format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"is ban player "COL_WHITE"%s  "COL_RED"Reason: %s",GetName(playerid),GetName(pplayerid),reason);
        SCMToAll(-1,string);
		Bans(playerid,pplayerid,reason);
        Ban(pplayerid);
        return 1;
}
Errors:
Quote:

undefined symbol "@yC_ban"
undefined symbol "@yC_ban"
error 017: undefined symbol "@_yCban"
fatal error 107: too many error messages on one li

Exact line:
Код:
YCMD:ban(playerid, params[], help)



Re: Ban command problem - Galletziz - 25.04.2014

Have you include ycmd include ?


Re: Ban command problem - UnlimitedFreeroam - 25.04.2014

Quote:
Originally Posted by Galletziz
Посмотреть сообщение
Have you include ycmd include ?
Yes I do.


Re: Ban command problem - Galletziz - 25.04.2014

Have you another command above YCMD:ban?


Re: Ban command problem - UnlimitedFreeroam - 25.04.2014

Yes I do:

Код:
YCMD:ask(playerid, params[], help)
{
        #pragma unused help
        new
			string[128], text[48];
        if(sscanf(params, "s[48]", text)) return SCM(playerid, COLOR_RED, "Usage: /ask [text]");
        foreach(Player, i) {
        if(P_Data[i][pAdmin] > 0) {
        format(string,sizeof(string),""COL_RED"[Question] Player"COL_WHITE"%s |"COL_RED"Text: "COL_WHITE"%s ",GetName(playerid),text);
        SCM(i,-1,string);
        return 1;
}



Re: Ban command problem - Konstantinos - 25.04.2014

You didn't close 2 brackets in the above command.

You don't need sscanf for that, it can be:
pawn Код:
YCMD:ask(playerid, params[], help)
{
    #pragma unused help
    if (isnull(params)) return SCM(playerid, COLOR_RED, "Usage: /ask [text]");
    new string[144];
    format(string, sizeof (string), ""COL_RED"[Question] Player"COL_WHITE"%s |"COL_RED"Text: "COL_WHITE"%s ", GetName(playerid), params);
    foreach(Player, i) if (P_Data[i][pAdmin] > 0) SCM(i, -1, string);
    return 1;
}



Re: Ban command problem - PrinceKumar - 25.04.2014

Have u closed ur cmd using this bracket '}' after return 1:


Re: Ban command problem - CHAVES1 - 25.04.2014

hello, I'm player of the server (as you can see)
I would like to report what happened to me ...
I was playing normally ..
until when ..
the server was "out of control"
and players have lost the connection ..
I was relogging ..
and when relog, my account was banned (CHAVES1, RANK 27)
I tried to use other accounts ..
i could not get ..
I wonder what happened and if possible, please release my account ..
wish I could play again. Thank you.

CHAVES1.


Re: Ban command problem - PrinceKumar - 25.04.2014

U r posting at wrong place u need to inform them via pm otherwise u will be able to get infra.. Chaves1