SA-MP Forums Archive
OnPlayerEditAttachedObject. Limitar escala. - 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: OnPlayerEditAttachedObject. Limitar escala. (/showthread.php?tid=615412)



OnPlayerEditAttachedObject. Limitar escala. - Duk - 22.08.2016

Pessoal alguйm sabe de tem como retirar ou limitar a es escala do OnPlayerEditAttachedObject.? Uso em meu servidor mas os players aumenta o tamanho do objeto e fica muito grande, queria retirar ou limitar o tamanho.


Re: OnPlayerEditAttachedObject. Limitar escala. - RogerCosta - 22.08.2016

Amigo, use o OnPlayerEditAttachedObject, que й chamado quando o jogador termina a ediзгo do EditAttachedObject. Dai vocк verifica se os parвmetros fScaleX, fScaleY e fScaleZ forem maior do que o limite que vocк definiu, vocк ajusta automaticamente o tamanho.


Respuesta: OnPlayerEditAttachedObject. Limitar escala. - Duk - 22.08.2016

Tem uma base? Eu nгo sei poxa me ajuda pf


Re: OnPlayerEditAttachedObject. Limitar escala. - willttoonn - 22.08.2016

Tente ai:
pawn Код:
//Coloque isso no topo do cуdigo dentro da funзгo de ediзгo do item no player:
if(fScaleX > 10.0)
    SendClientMessage(playerid, -1, "O tamanho do objeto no eixo X estб maior do que o permitido.");
else if(fScaleY > 10.0)
    SendClientMessage(playerid, -1, "O tamanho do objeto no eixo Y estб maior do que o permitido.");
else if(fScaleZ > 10.0)
    SendClientMessage(playerid, -1, "O tamanho do objeto no eixo Z estб maior do que o permitido.");

//Coloque isso na funзгo que й chamada quando salva o item:
if(fScaleX > 10.0)
    fScaleX = 10.0;

if(fScaleY > 10.0)
    fScaleY = 10.0;

if(fScaleZ > 10.0)
    fScaleZ = 10.0;



Re: OnPlayerEditAttachedObject. Limitar escala. - Andinho - 22.08.2016

Quote:
Originally Posted by willttoonn
Посмотреть сообщение
Tente ai:
pawn Код:
//Coloque isso no topo do cуdigo dentro da funзгo de ediзгo do item no player:
if(fScaleX > 10.0)
    SendClientMessage(playerid, -1, "O tamanho do objeto no eixo X estб maior do que o permitido.");
else if(fScaleY > 10.0)
    SendClientMessage(playerid, -1, "O tamanho do objeto no eixo Y estб maior do que o permitido.");
else if(fScaleZ > 10.0)
    SendClientMessage(playerid, -1, "O tamanho do objeto no eixo Z estб maior do que o permitido.");

//Coloque isso na funзгo que й chamada quando salva o item:
if(fScaleX > 10.0)
    fScaleX = 10.0;

if(fScaleY > 10.0)
    fScaleY = 10.0;

if(fScaleZ > 10.0)
    fScaleZ = 10.0;
Exatamente isso

Ele pode ate retornar a ediзгo do objeto novamente, e mandar a menssagem de erro
tipo:


Quote:

Ficaria assim:
pawn Код:
public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
{
    if(response)
    {
     if(fScaleX > 10.0) return  SendClientMessage(playerid, -1, "O tamanho do objeto no eixo X estб maior do que o permitido, edite o Objeto novamente!"),EditAttachedObject(playerid, index);
   

    if(fScaleY > 10.0) return SendClientMessage(playerid, -1, "O tamanho do objeto no eixo Y estб maior do que o permitido, edite o Objeto novamente!"),EditAttachedObject(playerid, index);
   

    if(fScaleZ > 10.0) return SendClientMessage(playerid, -1, "O tamanho do objeto no eixo Z estб maior do que o permitido, edite o Objeto novamente!"),EditAttachedObject(playerid, index);
   
    // aki as coisas caso esteja tudo OK .

    return 1:
}