SA-MP Forums Archive
Need help with Ban Command - 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: Need help with Ban Command (/showthread.php?tid=306670)



Need help with Ban Command - BlackID - 27.12.2011

EDIT: Problem Solved, i just retyped the script and found the answer by my self :P

well, if anyone want to see my problem see below

Quote:
Originally Posted by problem
Hello All, this is my first post and also my first thread

this is my problem

im using this includes

pawn Код:
#include <sscanf2>
#include <foreach>
#include <YSI\y_commands>
#include <ysi/y_ini>
and i tried to make a ban command

pawn Код:
YCMD:ban(playerid, params[], help)
{
        #pragma unused help
        if(PlayerInfo[playerid][pLevel] < 4) return SCM(playerid, COLOR_YELLOW, "* Sorry, only Admins level 4+ can use Ban Command");
        new
            string[128],pplayerid, reason[48];
        if(sscanf(params, "us[48]", pplayerid, reason)) return SCM(playerid, COLOR_YELLOW, "* Usage: /ban <playerid> <reason>");
        if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Invalid Player id!");
        if(PlayerInfo[pplayerid][pLevel] > PlayerInfo[playerid][pLevel]) return SCM(playerid, COLOR_YELLOW, "* Sorry, but this Admin has a higher level than yours");
line 392 >      format(string,sizeof(string),""COLOR_RED"-Team SF [BAN]- %s has been banned by Admin %s for %s",GetName(pplayerid),GetName(playerid),reason);
        SCMTA(-1,string);
        Ban(pplayerid);
        return 1;
}
and a few defines

pawn Код:
#define IPI INVALID_PLAYER_ID
#define SCM SendClientMessage
#define SCMTA SendClientMessageToAll
and GetName stock

pawn Код:
stock GetName(playerid)
{
    new
        pName[MAX_PLAYER_NAME];

    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    return pName;
}
so when i tried to compile my script i got this errors

Код:
D:\SA-MP Server\gamemodes\Team SF.pwn(392) : error 001: expected token: "-string end-", but found "-identifier-"
D:\SA-MP Server\gamemodes\Team SF.pwn(392) : warning 215: expression has no effect
D:\SA-MP Server\gamemodes\Team SF.pwn(392) : error 001: expected token: ";", but found "-string-"
D:\SA-MP Server\gamemodes\Team SF.pwn(392) : warning 215: expression has no effect
D:\SA-MP Server\gamemodes\Team SF.pwn(392) : warning 215: expression has no effect
D:\SA-MP Server\gamemodes\Team SF.pwn(392) : error 001: expected token: ";", but found ")"
D:\SA-MP Server\gamemodes\Team SF.pwn(392) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
which me, myself couldn't fix it, so i came here to get the help,i tried many ways i've learned but still, i couldn't fix it :P

so please, help me , and afterall im new here



Re: Need help with Ban Command - BlackID - 28.12.2011

bump


Re: Need help with Ban Command - MP2 - 28.12.2011

Did you actually just bump after 2 minutes?


Re: Need help with Ban Command - BlackID - 28.12.2011

see the PM and AM


Re: Need help with Ban Command - BlackID - 28.12.2011

bump, again, why no one answer?


Re: Need help with Ban Command - Mike_Peterson - 28.12.2011

I thought somewhere on this forum said, only bump your topic, every 12 hours.
And, maybe a few people don't like the whole YCMD codes, Just sayin'.
edit: Yea.. like anyone does 48 hours :L 12 hours is enough to not get whiners about bump times..


Re: Need help with Ban Command - [MG]Dimi - 28.12.2011

Quote:
Originally Posted by Mike_Peterson
Посмотреть сообщение
I thought somewhere on this forum said, only bump your topic, every 12 hours.
And, maybe a few people don't like the whole YCMD codes, Just sayin'.
This is a bit off topic but just to correct Mike_Peterson. 48 hours xD


Re: Need help with Ban Command - Jack_Rocker - 28.12.2011

SEARCH!!!!!!!!

Please search before postin'!


Re: Need help with Ban Command - BlackID - 28.12.2011

OK, im sorry im new to here, so please understand, i won't bump before 48 hours, im just angry, with 100 views, no one helping

and for Jack, if you can find this problem on Search, i'll gave you a REP


Re: Need help with Ban Command - Mike_Peterson - 28.12.2011

pawn Код:
format(string,sizeof(string),"-Team SF [BAN]- %s has been banned by Admin %s for %s",GetName(pplayerid),GetName(playerid),reason);
SCM(playerid, COLOR_RED,string);
Replace line 392 and 393 with this. :facepalm: