GetPlayerPos on NPC returns 0.0, 0.0, 0.0
#7

Quote:
Originally Posted by zgintasz
Посмотреть сообщение
Damn, do you even know what "continue" do? Go read wiki...
pawn Код:
for( new i; i < 5; i++ )
{
    if( i == 3 ) continue;
    printf( "%d", i );
}
/*
result:
[14:38:50] 0
[14:38:50] 1
[14:38:50] 2
[14:38:50] 4
*/



Yes, it's in vehicle, but I tried!! It returns also 0.0, 0.0, 0.0
I will not go read wiki cause i know what continue do. It just skips a loop iteration.

So IsPlayerConnected checks if the player is connected, IsPlayerNPC checks if the player is a NPC, so !IsPlayerNPC checks if the player is NOT a NPC in your case you need to check if the player IS A NPC to get its position.

Edit:


Quote:
Originally Posted by YJIET
Посмотреть сообщение
If you're trying to get the position of an NPC that is in a vehicle, use GetVehiclePos instead.
GetVehiclePos gets the vehicle position not NPC position. Even the NPC is in the car GetPlayerPos should work.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)