Need help to my first plugin ^^
#2
Hello, welcome to the forum.

You have the callback function signatures wrong. The first parameter is the split (array-table of strings that represent the command broken on individual spaces), the player is in the second parameter. This should work:

...
function GetPos(Split, Player)
    PlayerPos = Vector3d(Player:GetPosX(), Player:GetPosY(), Player:GetPosZ())
    Player:SendMessage("Position Register")
end

function GetTp(Split, Player)
...

Also, your plugin will store the position for all players in a single variable, so the players will overwrite each other's last saved position. Is that intentional?

One last thing, the next time you post lua code, please wrap it in [ shcode=lua ] tag instead of [ php ] tag. I have edited your post to fix that. The code is then properly syntax-highlighted and doesn't scroll.
Reply
Thanks given by:


Messages In This Thread
RE: Need help to my first plugin ^^ - by xoft - 02-16-2015, 04:29 AM
RE: Need help to my first plugin ^^ - by NiLSPACE - 02-16-2015, 05:06 AM
RE: Need help to my first plugin ^^ - by xoft - 02-16-2015, 05:14 AM



Users browsing this thread: 1 Guest(s)