Haven't been here in awhile
Thnx for your answers, I figured it out and took Flashing Blade's advice and turned all meh variables into globals
Here is the working code:
FUNCTION SlidingCollision()
W=OBJECT COLLISION(PLR,0)
IF W>0
IF ABS(PLRX#-OBJECT POSITION X(W))<OBJECT SIZE X(W)/2
IF PLRZ#<OBJECT POSITION Z(W) THEN DEC PLRZ#,0.201
IF PLRZ#>OBJECT POSITION Z(W) THEN INC PLRZ#,0.201
ENDIF
IF ABS(PLRZ#-OBJECT POSITION Z(W))<OBJECT SIZE Z(W)/2
IF PLRX#<OBJECT POSITION X(W) THEN DEC PLRX#,0.201
IF PLRX#>OBJECT POSITION X(W) THEN INC PLRX#,0.201
ENDIF
ENDIF
ENDFUNCTION
Just add SlidingCollision() to your main loop and change PLR, PLRX# and PLRZ# into the variables representing your player's ObjectNumber, ObjectPositionX and ObjectPositionZ respectively.
/me tests with a cylinder...
It crashed