View Issue Details

IDProjectCategoryView StatusLast Update
0000464Client/GameGrand Theft Auto IVpublic2023-02-03 14:59
Reporterdwaoiawdouo8u Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Platformx64OSWindowsOS Version10
Product Version1.5.1 
Summary0000464: natives.getPlayerChar(id) only works on self.
Description

It'd be very useful if we were able to get the handle of another player in the same session. However, it only ever returns a handle if the id you supply the argument with is your own player ID. (natives.getPlayerId())

You cannot grab the handle of a networked player. This is an issue.

(Possibly related to my previous issues regarding player ID's allocating backwards.)

TagsNo tags attached.
Game

Activities

Vortrex

2023-02-03 14:55

administrator   ~0000344

Which native are you needing another player's handle for?

Vortrex

2023-02-03 14:59

administrator   ~0000345

I highly recommend using GTAC's scripting functions for elements. Natives are only meant to be a stop-gap for things we haven't added to the main scripting API.

getClients() returns an array of Client objects, each of which have a player property, which points to their ped. It's also usable in natives where a ped object is accepted as an argument.
Same with vehicles and such.

Issue History

Date Modified Username Field Change
2023-02-03 13:05 dwaoiawdouo8u New Issue
2023-02-03 14:55 Vortrex Note Added: 0000344
2023-02-03 14:59 Vortrex Note Added: 0000345