byalfonsoo
New member
First of all, hello everyone, I have been dealing with something with scriptcommand in mod_sa for a few days, but I still haven't figured out how to do it. If there is anyone knowledgeable about this subject, can you please help me?
Now, in such a situation, my game crashes. If I write 1 instead of info after walkto in scriptcommand, only the GTA screen freezes and I appear as afk in other players.
Now, in such a situation, my game crashes. If I write 1 instead of info after walkto in scriptcommand, only the GTA screen freezes and I appear as afk in other players.
void cmd_walkto(char* params)
{
const SCRIPT_COMMAND actor_walk_to = { 0x07CD, "ifffff" };
struct actor_info* info;
info = (struct actor_info*)(UINT_PTR) * (uint32_t*)ACTOR_POINTER_SELF;
if (isBadPtr_GTA_pPed(info))
return;
float pos[3], pos2[3];
if (sscanf(params, "fff", pos[0], pos[1], pos[2])) return addMessageToChatWindow("[!] {c9c9c9}USAGE: /.walkpos [X] [Y] [Z]");
vect3_copy(&info->base.matrix[4 * 3], pos2);
float fDistanceFromEnemy = (pos[1] + pos[2] + pos[3]) - (pos2[1] + pos2[2] + pos2[3]);
addMessageToChatWindow("%f", fDistanceFromEnemy);
while (fDistanceFromEnemy > 1.0f)
{
ScriptCommand(&actor_walk_to, info, pos[0], pos[1], pos[2], 270.0, 4.0);
Sleep(500);
}
}