SA-MP Forums Archive
[Ajuda] Ajuda Stock - 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] Ajuda Stock (/showthread.php?tid=615685)



Ajuda Stock - JhowWatkins - 25.08.2016

Como posso executar a Stock em um comando COMANDO:
Quote:

CMD:colete3(playerid, params[]) {
SetPlayerKevlarHealth(strval(params), 300.0);
return 1;
}

STOCK:
PHP код:
stock SetPlayerKevlarHealth(playeridFloat:amount){
    new 
id CountAttachedObjects(playerid);
    
playerKevlarHealth[playerid] = amount;
     
haveKevlar[playerid] = true;
    
SetPlayerAttachedObject(playeridid1914210.10.050.0);
    
SetPlayerAttachedObjectEx(19142,Vaga_Colete,playerid,id);
    
SendClientMessage(playerid0xFFFFFFFF"[Informaзгo] Voce colocou seu Colete!");
    
ColocarColete[playerid] = 1;
    return 
1;




Re: Ajuda Stock - arakuta - 25.08.2016

A resposta jб estб no seu post.

PHP код:
stock Por10(param1)

    print(
"Multipliquei.");
    return 
param1 10;

PHP код:
CMD:5por10(playerid)
{
    
printf("5 vezes 10 й %d",Por10(5));
    return 
1;

PHP код:
stock MateTodos()
{
    new 
a;
    
    for(new 
iMAX_PLAYERS; ++i)
    {
        if(
IsPlayerConnected(i))
        {
            
SetPlayerHealth(i,0.0);
            
a++;
        }
    }
    return 
a;

PHP код:
CMD:morram(playerid)
{
    new 
players MateTodos();
    
printf("Matei %d players",players);
    return 
1;




Re: Ajuda Stock - JhowWatkins - 25.08.2016

Quote:
Originally Posted by arakuta
Посмотреть сообщение
A resposta jб estб no seu post.

PHP код:
stock Por10(param1)

    print(
"Multipliquei.");
    return 
param1 10;

PHP код:
CMD:5por10(playerid)
{
    
printf("5 vez 10 й %d",Por10(5));
    return 
1;

PHP код:
stock MateTodos()
{
    new 
a;
    for(new 
iMAX_PLAYERS; ++i)
    {
        if(
IsPlayerConnected(i))
        {
            
SetPlayerHealth(i,0.0);
            
a++;
        }
    }
    return 
a;

PHP код:
CMD:morram(playerid)
{
    new 
players MateTodos();
    
printf("Matei %d players",players);
    return 
1;

Qual parte?, mano й porque eu dou o comando e a Stock nгo funciona!


Re: Ajuda Stock - arakuta - 25.08.2016

Faзa um debug, se achas que ela nгo estб sendo chamada.


Respuesta: Ajuda Stock - SammyJ - 25.08.2016

PHP код:
CMD:colete3(playeridparams[]) {
    if(
isnull(params))
        return 
SendClientMessage(playerid, -1"Uso Correto: /colete3 [id]");
    
SetPlayerKevlarHealth(strval(params), 300.0);
    return 
1;

@edit
Se der algum erro referente ao isnull adicione este macro no topo em seu gm
pawn Код:
#if !defined isnull
    #define isnull(%1) \
        ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif



Re: Respuesta: Ajuda Stock - JhowWatkins - 25.08.2016

Quote:
Originally Posted by Glederson_dom
Посмотреть сообщение
PHP код:
CMD:colete3(playeridparams[]) {
    if(
isnull(params))
        return 
SendClientMessage(playerid, -1"Uso Correto: /colete3 [id]");
    
SetPlayerKevlarHealth(strval(params), 300.0);
    return 
1;

@edit
Se der algum erro referente ao isnull adicione este macro no topo em seu gm
pawn Код:
#if !defined isnull
    #define isnull(%1) \
        ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif
nгo dб erro, porem nгo funciona...


Respuesta: Re: Respuesta: Ajuda Stock - SammyJ - 25.08.2016

Quote:
Originally Posted by JhowWatkins
Посмотреть сообщение
nгo dб erro, porem nгo funciona...
Faзa como o amigo disse! Faзa um debug no stock com print.
Seria ideal vocк usar crashdetect!


Re: Ajuda Stock - JhowWatkins - 25.08.2016

Quote:
Originally Posted by arakuta
Посмотреть сообщение
Faзa um debug, se achas que ela nгo estб sendo chamada.
Nгo sei fazer Debug... se puder me dar uma base


Re: Ajuda Stock - arakuta - 25.08.2016

https://sampforum.blast.hk/showthread.php?tid=216163


Re: Ajuda Stock - JhowWatkins - 25.08.2016

Quote:
Originally Posted by arakuta
Посмотреть сообщение


Rapaz, nгo conseguir entender muito bem... nгo me expresso bem em leitura se tem algum jeito de falar comigo?, posso atй te pagar