07.03.2011, 19:42
Hi. I don't understand where is the problem:
I get this warning:
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;
}
Код:
[22:37:40] sscanf warning: String buffer overflow.