OnPlayerEditAttachedObject. Limitar escala.
#5

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:
}
Reply


Messages In This Thread
OnPlayerEditAttachedObject. Limitar escala. - by Duk - 22.08.2016, 03:07
Re: OnPlayerEditAttachedObject. Limitar escala. - by RogerCosta - 22.08.2016, 03:58
Respuesta: OnPlayerEditAttachedObject. Limitar escala. - by Duk - 22.08.2016, 04:05
Re: OnPlayerEditAttachedObject. Limitar escala. - by willttoonn - 22.08.2016, 06:10
Re: OnPlayerEditAttachedObject. Limitar escala. - by Andinho - 22.08.2016, 06:42

Forum Jump:


Users browsing this thread: 1 Guest(s)