0 Members and 1 Guest are viewing this topic.
procedure ApplySprint(ID,duration,extraspeed: integer);var timer:integer; prevX,prevY,changeX,changeY: single;begin timer:=0; while timer < duration do begin GetPlayerXY(ID,prevX,prevY); timer := timer + 10; sleep(50); changeX := GetPlayerStat(ID,'X') - prevX; changeY := GetPlayerStat(ID,'Y') - prevY; MovePlayer(ID,GetPlayerStat(ID,'X') + (changeX * extraspeed / 1000), GetPlayerStat(ID,'Y') + (changeY * extraspeed / 1000)); end; DrawText(ID,'Sprint ended.',100,RGB(170,170,255),100/85,30,360); end;
MovePlayer is excluded in versions higher than 2.6.0