01.03.2014, 16:40
Read the code before posting random things. ginklas is used as the name of the command which means zcmd is not included:
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 Код:
#include <a_samp>
#include <zcmd>
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;
}