warning 203: symbol is never used: "ginklas"
#8

Read the code before posting random things. ginklas is used as the name of the command which means zcmd is not included:
pawn Код:
#include <a_samp>
#include <zcmd>
There's nothing to remove..

There're also few more things:
- string should be an array/string, not an integer.
- sscanf has 1 specifier "i" but 2 arguments (gunid, kulkos).
- you forgot ");" at the end of a client message, you try to display an integer to a text using %s placeholder which is for strings so you'll need to get the weapon's name.

pawn Код:
CMD:ginklas(playerid, params[])
{
    new gunid, kulkos;
    if (sscanf(params, "ii", gunid, kulkos)) return SendClientMessage(playerid, COLOR_ORANGE, "Teisingas Naudojimas: /ginklas <id> <ammo>");
    if(gunid < 1 || gunid > 46) return SendClientMessage(playerid, COLOR_ORANGE, "Tokio Ginklo Nera!");
    if(kulkos < 1 || kulkos > 500) return SendClientMessage(playerid, COLOR_ORANGE, "Limit: 0-500");
    GivePlayerWeapon(playerid, gunid, kulkos);
    new string[128];
    GetWeaponName(gunid, string, 32);
    format(string,sizeof(string),"Pasiemiai Pasirinkto Ginklo %s Kulku!",string);
    SendClientMessage(playerid, COLOR_ORANGE, string);
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)