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



Delet - Stroon - 26.04.2016




Re: Delet - Artista - 26.04.2016

A variбvel deve ser global, experimente criar essa array no topo do script. Sу toma cuidado pra nгo colocar um nome que jб exista, pois aн irб dar erro. =D


Re: Delet - LockedLucas - 26.04.2016

Cara, vocк ta criando a variбvel em um comando, e querendo usar a mesma em outro ? ai fica difнcil mesmo nй, no caso vocк teria que criar uma variбvel global para poder usar em qualquer lugar.


Re: Delet - Carlos001 - 26.04.2016

Nao testei Mais Tenta Ai:
Quote:

CMD:abripraga(playerid)
{
new Obj[2];// Mude o "2" De Acordo Com o Tanto De Objeto
Obj[0] = CreateDynamicObject(etc, etc, etc, etc);
Obj[1] = CreateDynamicObject(etc, etc, etc, etc);
return 1;
}


CMD:fecharpalco(playerid)
{
new Obj[2];// Mude o "2" De Acordo Com o Tanto De Objeto
for(new i; i < sizeof(Obj); i++)
{

DestroyDynamicObject(Obj[i]);
}
SendClientMessage(playerid, -1, "Deleta praga");
return 1;
}




Re: Delet - Stroon - 26.04.2016

@Carlos001 Estб criando, porйm nгo deleta, sу da a msg.


Re: Delet - Carlos001 - 26.04.2016

Quote:

CMD:fecharpalco(playerid)
{
new Obj[2];// Mude o "2" De Acordo Com o Tanto De Objeto
for(new i; i < sizeof(Obj); i++)
{

Obj[0] = DestroyDynamicObject(etc, etc, etc, etc);
Obj[1] = DestroyDynamicObject(etc, etc, etc, etc);
}
SendClientMessage(playerid, -1, "Deleta praga");
return 1;
}

Nгo Sei Se Vai Funcionar Assim Mais Tenta ai


Re: Delet - zPain - 26.04.2016

Quote:
Originally Posted by Stroon
Посмотреть сообщение
@Carlos001 Estб criando, porйm nгo deleta, sу da a msg.
De todas as sugestхes, vocк aceitou a ъnica incorreta. O vetor de objetos deve ser global.



PHP код:
new gObjects[6];
CMD:abripraga(playerid) {
    
gObjects[0] = CreateDynamicObject(...);
    
// ...
    
return 1;
}
CMD:fecharpalco(playerid) {
    for(new 
isizeof gObjects; ++i)
        
DestroyDynamicObject(gObjects[i]);
    
    return 
1;




Re: Delet - Stroon - 26.04.2016

Muito Obrigado, Carlos001, zPain. + rep para ambos.