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

Help For Fixe Script

Status
Not open for further replies.

Come2WoW

Respected Member
Code:
Hi All,

I wrote the script for : cuando player deaded in (gurbashi (( area = 2177)) and icc ((area = 210)))

teleport to a map but dosnt work. tanks for fixe this :

PHP:
    #include "ScriptPCH.h"
     
    class Test : public PlayerScript
    {
    public:
            Test() : PlayerScript("Test") { }
     
    void OnPvPKill(Player *pKiller, Player *pVictim)
	{
		switch (pVictim ->GetAreaId())
		{
		case 2177: //pvp ring area 
		pVictim->TeleportTo(1, 4926.140137,  -2844.216064, 1441.364624, 1.332412);
	    break;
        }
	    switch (pVictim ->GetAreaId())
		{
		case 210: //icc area
		pVictim->TeleportTo(1, 4926.140137,  -2844.216064, 1441.364624, 1.332412);
	    break;
        }
    }
};
void AddSC_Test ()
{
new Test ();
}
 

Tommy

Founder
Code:
#include "ScriptPCH.h"
     
class Test : public PlayerScript
{
public:
    Test() : PlayerScript("Test") { }
     
    void OnPVPKill(Player *pKiller, Player *pVictim)
    {
        switch (pVictim ->GetAreaId())
        {
            case 2177: //pvp ring area 
                pVictim->TeleportTo(1, 4926.140137f,  -2844.216064f, 1441.364624f, 1.332412f);
                break;
            case 210: //icc area
                pVictim->TeleportTo(1, 4926.140137f,  -2844.216064f, 1441.364624f, 1.332412f);
                break;
       }
    }
};
void AddSC_Test ()
{
    new Test ();
}

The "v" in OnPVPKill needs to be capitalized, which yours wasn't and you don't need to call two switches for multiple cases, you only need one per method.. Fixed.
 
Last edited:

Hamar

BETA Tester
Code:
Hi All,

I wrote the script for : cuando player deaded in (gurbashi (( area = 2177)) and icc ((area = 210)))

teleport to a map but dosnt work. tanks for fixe this :

PHP:
    #include "ScriptPCH.h"
     
    class Test : public PlayerScript
    {
    public:
            Test() : PlayerScript("Test") { }
     
    void OnPvPKill(Player *pKiller, Player *pVictim)
	{
		switch (pVictim ->GetAreaId())
		{
		case 2177: //pvp ring area 
		pVictim->TeleportTo(1, 4926.140137,  -2844.216064, 1441.364624, 1.332412);
	    break;
        }
	    switch (pVictim ->GetAreaId())
		{
		case 210: //icc area
		pVictim->TeleportTo(1, 4926.140137,  -2844.216064, 1441.364624, 1.332412);
	    break;
        }
    }
};
void AddSC_Test ()
{
new Test ();
}

You should ress the player first before teleporting.
 

Tommy

Founder
It was just an example, Because The Area are considered to have a Map id

- - - Updated - - -


Yes, it is

That is a bad example. If you want an example, ask one of us to do it for you, I don't want people learning the wrong way. [MENTION=6]Rochet2[/MENTION]: I didn't catch the floats, edited.
 
Status
Not open for further replies.
Top