Jump to content

Recommended Posts

Char pPlayer;

u32 playerIndex = ConvertIntToPlayerIndex(GetPlayerId());

GetPlayerChar(playerIndex, &pPlayer);

 

 

if (IsCharInAreaOnFoot2D(pPlayer, 1348.91f, -831.521f, 1340.00f, -831.521f, true)) {

PrintStringWithLiteralStringNow("string", "KILL ALL BEASTERD!", 10000, 1);

}

 

 

when I come to destination nothing happens, Why??

What wrong with: "if (IsCharInAreaOnFoot2D(pPlayer, 1348.91f, -831.521f, 1340.00f, -831.521f, true)) "

Link to comment
https://gtaforums.com/topic/390582-c-script-hook/page/50/#findComment-1059999994
Share on other sites

sjaak327 :

 

I have a problem ...

 

 

Char pPlayer;

u32 playerIndex = ConvertIntToPlayerIndex(GetPlayerId());

GetPlayerChar(playerIndex, &pPlayer);

 

 

if (IsCharInAreaOnFoot2D(pPlayer, 1348.91f, -831.521f, 1348.91f,-831.521f, true)) {

PrintStringWithLiteralStringNow("string", "ou jea!", 10000, 1);

 

}

 

when I enter into the game and come to these coordinates, nothing happens ... why?

 

Link to comment
https://gtaforums.com/topic/390582-c-script-hook/page/50/#findComment-1060001558
Share on other sites

 

sjaak327 :

 

I have a problem ...

 

 

Char pPlayer;

u32 playerIndex = ConvertIntToPlayerIndex(GetPlayerId());

GetPlayerChar(playerIndex, &pPlayer);

 

 

if (IsCharInAreaOnFoot2D(pPlayer, 1348.91f, -831.521f, 1348.91f,-831.521f, true)) {

PrintStringWithLiteralStringNow("string", "ou jea!", 10000, 1);

 

}

 

when I enter into the game and come to these coordinates, nothing happens ... why?

If you want to do something whenever the Char is in the area, you need to check for it in tick.

 

ie. you need to check for this each tick, in the customthread you do this in the runtick() fucntion.

 

Edit: I see you are using the exact same coordinates !, you would use this in a " range" kind of way, something like:

 

 

if (IsCharInAreaOnFoot2d(pPlayer,1348.91f,-831.521f,1340.0f,-825.0f)

 

 

Link to comment
https://gtaforums.com/topic/390582-c-script-hook/page/50/#findComment-1060001653
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.