Some error inside cycle.
#6

Enum fixed it.
But there is another problem. This is my command:

pawn Код:
dcmd_giveweapon(playerid,params[])
    {
        new
            ID,
            Weapon[50],
            Ammo,
            model=666
        ;
        sscanf(params,"us[50]I(100000)",ID,Weapon,Ammo)
        printf("ID: %d | Weapon: %s | Ammo: %d",ID,Weapon,Ammo);
        new i=0;
        while(i<=sizeof(gWeaponNames))
        {
            if(strcmp(Weapon,gWeaponNames[i][z_nazov],true)==0)
            {
                model=i;
                break;
            }else i++;
        }
        model=gWeaponNames[model][z_id];
        if(model==666)
        {
            new zbran=strval(Weapon);
            if((zbran>=0 && zbran <= 47) && (zbran!=19 && zbran!= 20 && zbran!= 21))
            {
                model=zbran;
            }
        }
        if(model==666) return SCM(playerid,red,"Bad gun ID or name!");
        printf("ID: %d | Model: %d | Ammo: %d",ID,model,Ammo);
        GivePlayerWeapon(ID,model,Ammo);
        return 1;
    }
i removed some returns like "Bad player ID", "No params" etc, i don't want to translate it now

So, this works perfectly. But, when i type eg. "deaglec" (some error in name), it doesnt return "Bad gun ID or name!", but "Server: Unknown command". Some ideas?
Reply


Messages In This Thread
Some error inside cycle. - by Mmartin - 03.04.2011, 08:31
Re: Some error inside cycle. - by AK47317 - 03.04.2011, 08:58
Re: Some error inside cycle. - by Mmartin - 03.04.2011, 09:07
Re: Some error inside cycle. - by Max_Coldheart - 03.04.2011, 09:50
Re: Some error inside cycle. - by Mmartin - 03.04.2011, 10:01
Re: Some error inside cycle. - by Mmartin - 03.04.2011, 11:52

Forum Jump:


Users browsing this thread: 2 Guest(s)