Simply install to your project:
sampctl package install roesanne26/async-a-controller
Include in your code and begin using the library:
#include <async-a-controller>
https://github.com/IllidanS4/PawnPlus/
Function: Task:async_controller_show
#include <Async-A-Controller>
CMD:dancing(playerid) {
task_yield(1);
SetPlayerSpecialAction(playerid, 5);
new
result = task_await(async_controller_show(playerid));
if(result)
SendClientMessage(playerid, 0xFFFF00AA, "[DANCING]: Ban da hoan thanh thu thach");
else
SendClientMessage(playerid, 0xFF6347AA, "[DANCING]: Ban da that bai thu thach");
ClearAnimations(playerid);
SetPlayerSpecialAction(playerid, 0);
TogglePlayerControllable(playerid, true);
SetCameraBehindPlayer(playerid);
return 1;
}
To test, simply run the package:
sampctl package run
-
Ares: Original script (https://github.com/AresVN/a_controller)
-
Me: Make async version