Ich hab versucht ein Pay Script zu machen klappt aber nicht ganz...
Es kommen auch keine Fehler...
Hier der Code:
Lua
function pay_script(player,player2,cmd,money)
if playername and money then
local player2 = getPlayerFromName(playername)
local x1, y1, z1 = getElementPosition ( playername )
local x2, y2, z2 = getElementPosition ( player )
if player2 then
if tonumber(money) and tonumber(money) >= 1 then
if getDistanceBetweenPoints3D ( x1, y1, z1, x2, y2, z2 ) <= 10 then
givePlayerMoney(player2,tonumber(money))
takePlayerMoney(player,tonumber(money))
outputChatBox("Du hast von "..getPlayerName(player).." "..tonumber(money).." $ Bekommen!", player2)
outputChatBox("Du hast "..getPlayerName(player2).." "..tonumber(money).." $ gegeben!", player)
end
end
end
else
outputChatBox("Benutzung: /pay [NAME] [Geld]",player)
end
end
addCommandHandler("pay",pay_script)
Alles anzeigen