View Issue Details

IDProjectCategoryView StatusLast Update
0000217ClientGrand Theft Auto: Vice Citypublic2020-10-24 23:56
Reporteryallinthehall Assigned To 
PriorityhighSeverityminorReproducibilityalways
Status closedResolutionno change required 
Platformx64OSWindowsOS Version10
Product Version1.1.52 
Summary0000217: Client side JS doesn't recognize "spawnPlayer"
DescriptionThe exact code I am using is:
addEventHandler("onPedWasted", (event,ped) => {
 if (ped.name == localClient.name){
    spawnPlayer([486.630, 491.788, 10.547], 6, 3);
 }
});

I have tested the spawn parameters on the server side and it works well. The event also isn't the issue. The error from the client side console is:

ReferenceError: spawnPlayer is not defined

... which I know to mean it can't access the function. I feel that I'm missing something really simple here. Is there another object that I need to call that function from? I already tried gta.spawnPlayer (the Wiki shows sone functions and objects needing a "gta." prefix and not others). Any help is appreciated!
Steps To ReproduceaddEventHandler("onPedWasted", (event,ped) => {
 if (ped.name == localClient.name){
    spawnPlayer([486.630, 491.788, 10.547], 6, 3);
 }
});

// Client side
// Event is not the issue
TagsScripting
Game Version

Activities

Lucy

2020-10-17 15:14

reporter   ~0000093

spawnPlayer in clientside exists only while you're disconnected

Vortrex

2020-10-24 23:56

administrator   ~0000098

As lucy explained, spawnPlayer in clientside exists only while you're disconnected.

It's not meant to be used in multiplayer since the server handles all player spawning, and the wiki will be updated to mention that.

Issue History

Date Modified Username Field Change
2020-10-17 06:57 yallinthehall New Issue
2020-10-17 06:57 yallinthehall Tag Attached: Scripting
2020-10-17 15:14 Lucy Note Added: 0000093
2020-10-24 23:56 Vortrex Status new => closed
2020-10-24 23:56 Vortrex Resolution open => no change required
2020-10-24 23:56 Vortrex Note Added: 0000098