State changes when entering and exiting a vehicle
#1

Another post from me guys - this is separate to what I wrote about the objects disappearing when I exit a vehicle.
I decided to log what states the player goes into when entering and exiting a vehicle

When entering the vehicle it showed:
[17:43:06] Marcus_Williams changed state to 2 from 1
[17:43:09] Marcus_Williams changed state to 8 from 1

When exiting the vehicle it showed:
[17:43:09] Marcus_Williams changed state to 1 from 2
[17:43:10] Marcus_Williams changed state to 1 from 8

I need a second opinion on this because I find it really strange that the breakdown is like this
ONFOOT > DRIVER
ONFOOT > SPAWNED

DRIVER > ONFOOT
SPAWNED > ONFOOT

Is this normal? I thought I was already spawned when these logs showed up
[17:40:55] [join] Marcus_Williams has joined the server
[17:41:00] Marcus_Williams changed state to 9 from 0
[17:41:03] Marcus_Williams changed state to 8 from 9
[17:41:03] Marcus_Williams changed state to 1 from 8
Reply
#2

Is there any?

pawn Код:
SetPlayerVirtualWorld(playerid,worldid);
Reply
#3

Quote:
Originally Posted by gurmani11
Посмотреть сообщение
Is there any?

pawn Код:
SetPlayerVirtualWorld(playerid,worldid);
Where should I look for this?
There is some scattered around the script but not in the OnPlayerStateChange
Reply
#4

where ever have you added this

printf function

there it must be
Reply
#5

Quote:
Originally Posted by gurmani11
Посмотреть сообщение
where ever have you added this

printf function

there it must be
Are you sure this has something to do with virtual worlds?
From what I've read around SA-MP, PLAYER_STATE_SPAWNED is called when you initially spawn and shouldn't be called again.
I'm not sure it has anything to do with virtual worlds and from what I've seen, when I changed virtual worlds - my state doesn't change
Reply
#6

indeed because worlds are changing
at least show some code ....
Reply
#7

Quote:
Originally Posted by gurmani11
Посмотреть сообщение
indeed because worlds are changing
at least show some code ....
That doesn't have anything to do with spawning, I've tested changing virtual worlds and it doesn't trigger OnPlayerStateChange
Reply
#8

I've tested some conditions before and after the entering and exiting the vehicle

I used IsPlayerAttachedObjectSlotUsed(playerid, slot) before and during being inside the vehicle.
The slot was used and the clothing object was still attached.

Only when I exited the vehicle and the object was removed did IsPlayerAttachedObjectSlotUsed empty itself, so in the process somewhere - the script thinks the player has spawned?
I don't know how this is possible because I never actually respawned or noticed any difference and OnPlayerSpawn was not called.
Reply
#9

The issue turns out to be with Slice's weapon-config include.
Not sure what causes it but when I took this out of my script, everything went back to as expected.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)