[Ajuda] Getar muniзгo. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Getar muniзгo. (
/showthread.php?tid=492432)
Getar muniзгo. -
Duduloch - 03.02.2014
Gente, faz muito tempo que to tentando fazer esse sistema e nгo consigo, queria saber se alguйm conseguiria elaborб-lo para mim, creio que para alguйm que tenha mais conhecimento que eu nгo seja dificil, bom queria o seguinte, queria um sistema onde quando vocк digitasse /infoarma apareceria o seguinte: Arma: tal tal Muniзгo: quantidade de muniзгo. Porйm nгo consigo fazer isso pois nгo consigo getar ql arma eu tenho e nem a muniзгo... Estou aqui mas nгo й por falta de tentativa, estou aqui pois й a minha ultima esperanзa, se alguйm puder fazer esse code, eu agradeзo profundamente... Obrigado..
Re: Getar muniзгo. -
@Riichard - 03.02.2014
pawn Код:
CMD:infoarma(playerid)
{
new wean[50];
if(GetPlayerWeapon(playerid) == 0) wean = "Mгos livres";
else GetWeaponName(GetPlayerWeapon(playerid), wean, sizeof(wean));
new rString[100];
format(rString, sizeof(rString), "[INFO-ARMA] Arma: %s - Muniзгo: %d", wean, GetPlayerAmmo(playerid));
SendClientMessage(playerid, -1, rString);
return 1;
}
Re: Getar muniзгo. -
Duduloch - 03.02.2014
Ow, uso strcmp, usei assim:
pawn Код:
if(strcmp(cmd, "/armainfo", true) == 0)
{
new rString[100];
format(rString, sizeof(rString), "[INFO-ARMA] Arma id: %d - Muniзгo: %d", GetPlayerWeapon(playerid), GetPlayerAmmo(playerid));
SendClientMessage(playerid, -1, rString);
}
e returnou como se o comando nгo existisse?!
Re: Getar muniзгo. -
Duduloch - 03.02.2014
Cara funfou o cmd, po muuuito grato

obrigado msm!! Sei que nгo ajuda muito mais vou te dar um rep, grato mesmo!
Re: Getar muniзгo. -
@Riichard - 03.02.2014
Quote:
Originally Posted by Duduloch
Cara funfou o cmd, po muuuito grato  obrigado msm!! Sei que nгo ajuda muito mais vou te dar um rep, grato mesmo!
|
Eu dei uma editada pra aparecer o nome da arma

.
Se ele estiver sem nada nas mгos, irб aparecer: Mгos livres

.
Re: Getar muniзгo. -
Duduloch - 03.02.2014
Sim sim, consegui entender a lуgica, estou usando assim agora, porйm nгo em zcmd e sim e STRCMP

grato amigo!