"Телепортация к контрольной точке. Помощь."

Runbu73

Участник
Автор темы
74
2
Вы можете предоставить мне функцию телепортации к контрольной точке или сказать, где она находится?
 

Vintik

Мечтатель
Проверенный
1,469
918
it's better to use english because translator sometimes make mistakes.
first of all, you should find position of checkpoint (are we talking about a checkpoint?)
on our wiki we have information about checkpoints (check it)
there are alot of types:
0 - Racing checkpoint with arrow pointer.
1 - Racing checkpoint with finishing flag.
2 - Empty racing checkpoint
3 - Checkpoint ring, becomes invisible when the player is inside it.
4 - Checkpoint ring, does not become invisible when the player is inside it.
5 - Exactly the same checkpoint as the previous one.
6 - Checkpoint ring with animation, disappears after the end of the animation.
7 - Bouncing checkpoint ring, stops bouncing when the player is inside it.
8 - Exactly the same checkpoint as the previous one.
how to find position? as i understand, you should use samp.lua module (download it). here's an example specifically for you:
Lua:
local ev = require 'samp.events'

-- callback which is triggered when checkpoint creates
function ev.onSetRaceCheckpoint(type, position, nextPosition, size)
    sampAddChatMessage('race checkpoint created') -- for example
    sampAddChatMessage('position: x = ' .. tostring(position.x) .. ', y = ' .. tostring(position.y) .. ', z = ' .. tostring(position.z))
    -- we can find position using: position.x, position.y, position.z
end

-- same, but checkpoint removes
function ev.onDisableRaceCheckpoint()
    sampAddChatMessage('race checkpoint removed') -- for example
end
* all callbacks and list of arguments you can find on github.
so you can save position when checkpoint creates to global variable and after that use it. for teleporting use this function.

feel free to ask more questions
 
  • Нравится
Реакции: VanoKLR