Function DebugGotoXY
- Line
- 314
- Location
- cheats.j
- Constant?
- no
- Type
- function
- Arguments
- nothing
- Returns
- nothing
| 314 | function DebugGotoXY takes nothing returns nothing |
| 315 | local string chatString = GetEventPlayerChatString() |
| 316 | local integer index |
| 317 | local boolean inParam1 |
| 318 | |
| 319 | if (bj_DEBUG_CHAT_GOTOXY + " " == SubString(chatString, 0, 7)) then |
| 320 | set inParam1 = false |
| 321 | set index = 7 |
| 322 | loop
|
| 323 | if (SubString(chatString, index, index + 1) != " ") then |
| 324 | set inParam1 = true |
| 325 | endif
|
| 326 | |
| 327 | exitwhen (inParam1 and SubString(chatString, index, index + 1) == " ") |
| 328 | exitwhen index > 50 |
| 329 | set index = index + 1 |
| 330 | endloop
|
| 331 | |
| 332 | if (index > 50) then |
| 333 | call DisplayTextToPlayer(GetTriggerPlayer(), 0, 0, "Usage: GotoXY x y") |
| 334 | else
|
| 335 | if (GetLocalPlayer() == GetTriggerPlayer()) then |
| 336 | call SetCameraPositionForPlayer(GetTriggerPlayer(), S2R(SubString(chatString, 7, index)), S2R(SubString(chatString, index, 50))) |
| 337 | endif
|
| 338 | endif
|
| 339 | endif
|
| 340 | endfunction
|