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

okay here are the lines:
CMD:ginklas(playerid, params[])
{
new string;
new gunid;
new kulkos;
if(sscanf(params, "i", gunid, kulkos)) SendClientMessage(playerid, COLOR_ORANGE, "Teisingas Naudojimas: /ginklas id");
else if(gunid < 1 || gunid > 46) SendClientMessage(playerid, COLOR_ORANGE, "Tokio Ginklo Nera!"
else if(kulkos < 1) SendClientMessage(playerid, COLOR_ORANGE, "0 Kulku Negali Paimti");
else if(kulkos > 500) SendClientMessage(playerid, COLOR_ORANGE, "Kulku Pasiemino Limitas: 500");
else
{
GivePlayerWeapon(playerid, gunid, kulkos);
format(string,sizeof(string),"Pasiemiai Pasirinkto Ginklo %s Kulku!",kulkos);
SendClientMessage(playerid, COLOR_ORANGE, string);
return 1;
}

}
the error is in the line :new string;
how can i fix that ?
Reply
#2

The symbol ginklas is defined but not used thats all
Reply
#3

but how can i fix it ?
Reply
#4

remove the symbol
Reply
#5

Remove the symbol of ginklas and it's good.
Reply
#6

Quote:
Originally Posted by SpartaDM
Посмотреть сообщение
Remove the symbol of ginklas and it's good.
It's just what I said, I don't know why you replyed to say the same thing
Reply
#7

do i have to delete the command?
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)