• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] Morph Limit

Status
Not open for further replies.

Intouch

Respected Member
Hello!

I made command for morph and it work now I want to limit morphs and set only few morph ids which will bee possible to use not all.
How can I do that ?

Also I want command which wont be possible to use on other players lile GM .morph command (only usable on yourself).
This one work like that (only on yourself) but like i said after editing and setting limits maybe it will lost.

So all what I want is: to make morph command with few morph ids inside command and when player type example .vip morph
It should to send him like. ( .vip morph .... morphid1 , morphid2 , morphid3)

Here is code what I use right now:

Code:
static bool HandleMorphCommand(ChatHandler* handler, const char* args)
    {
        handler->GetSession()->GetPlayer()->SetDisplayId((uint32)atol((char*)args));
		return true;
    }
 

Intouch

Respected Member
Yes something like that, but idk how to do that.

I gave u my code:

static bool HandleMorphCommand(ChatHandler* handler, const char* args)
{
handler->GetSession()->GetPlayer()->SetDisplayId((uint32)atol((char*)args));
return true;
}

So How can I make something like that..
 

Tommy

Founder
Yes something like that, but idk how to do that.

I gave u my code:

static bool HandleMorphCommand(ChatHandler* handler, const char* args)
{
handler->GetSession()->GetPlayer()->SetDisplayId((uint32)atol((char*)args));
return true;
}

How do you not know how to do it? Very Simple..

Code:
static bool HandleMorphCommand(ChatHandler* handler, const char* args)
{
    uint32 displayId = 0;
    switch (urand(0, 3)) // Change 3 to a higher number if you want, but cases are recommended to match
    {
        case 0:
            displayId = 3000; // Change to an appropriate displayId
            break;
        case 1:
            displayId = 3000; // Change to an appropriate displayId
            break;
        case 2:
             displayId = 3000; // Change to an appropriate displayId
             break;
        case 3:
             displayId = 3000; // Change to an appropriate displayId
             break;
    }

    handler->GetSession()->GetPlayer()->SetDisplayId(displayId); // And then set the displayId
    return true;
}
 
Status
Not open for further replies.
Top