Sscanf plugin warning
#1

Hi. I don't understand where is the problem:

pawn Код:
dcmd_use(playerid, params[])
{
    new drugs[10];
    if(PlayerI[playerid][InEvent] == 1) return SendClientMessageLang(playerid,COLOR_WHITE,"{FF0000}*[INFO]: {668888}You are already taking part in somewhere, so firstly type /leave!","{FF0000}*[INFO]: {668888}Jūs jau kaћkur dalyvaujate, todėl pirma naudokite /leave!");
    if(PlayerI[playerid][Offered] > 0) return SendClientMessageLang(playerid,COLOR_WHITE,"{FF0000}*[INFO]: {668888}Firstly cancel offers with /cancel!","{FF0000}*[INFO]: {668888}Pirma atљaukite pasiūlymus su /cancel!");
    if(PlayerDrunkLevel[playerid] > 225) return SendClientMessageLang(playerid,COLOR_WHITE,"{FF0000}*[INFO]: {668888}You can't use drugs when you are drunk","{FF0000}*[INFO]: {668888}Negalite naudoti nartkotikų, kol esate girtas");
    if(sscanf(params, "s[10]",drugs))
    {
        SendClientMessageLang(playerid, COLOR_WHITE, "{FF0000}*[INFO]: {668888}Usage: {CCFF00}/use [drugs]","{FF0000}*[INFO]: {668888}Naudojimas: {CCFF00}/use [drugs]");
        SendClientMessageLang(playerid, COLOR_WHITE, "{FF0000}*[INFO]: {668888}Drugs: Extazy, Weed, Opium","{FF0000}*[INFO]: {668888}Narkotikai: Extazy, Weed, Opium");
        return 1;
    }
    if(strlen(drugs) > 10 || strlen(drugs) < 0)
    {
        SendClientMessageLang(playerid, COLOR_WHITE, "{FF0000}*[INFO]: {668888}Usage: {CCFF00}/use [drugs]","{FF0000}*[INFO]: {668888}Naudojimas: {CCFF00}/use [drugs]");
        SendClientMessageLang(playerid, COLOR_WHITE, "{FF0000}*[INFO]: {668888}Drugs: Extazy, Weed, Opium","{FF0000}*[INFO]: {668888}Narkotikai: Extazy, Weed, Opium");
        return 1;
    }
    if(strcmp(params,"weed",true) == 0)
    {
        //do
    }
    else if(strcmp(params,"extazy",true) == 0)
    {
        //do
    }
    else if(strcmp(params,"opium",true) == 0)
    {
        //do
    }
    return 1;
}
I get this warning:

Код:
[22:37:40] sscanf warning: String buffer overflow.
Reply


Messages In This Thread
Sscanf plugin warning - by BuLLeT[LTU] - 07.03.2011, 19:42
Re: Sscanf plugin warning - by Stigg - 07.03.2011, 19:44
Re: Sscanf plugin warning - by BuLLeT[LTU] - 07.03.2011, 19:53
Re: Sscanf plugin warning - by Stigg - 07.03.2011, 19:55
Re: Sscanf plugin warning - by BuLLeT[LTU] - 07.03.2011, 19:58
Re: Sscanf plugin warning - by Stigg - 07.03.2011, 19:58
Re: Sscanf plugin warning - by dice7 - 07.03.2011, 19:59
Re: Sscanf plugin warning - by BuLLeT[LTU] - 07.03.2011, 20:00

Forum Jump:


Users browsing this thread: 1 Guest(s)