Object for each player separately
#1

Im making elevator in my server, but it will be using very often. So i wonder how to do it for each player separately if it's possible. Something like this:
Код:
new elevator[MAX_PLAYERS];
And somewhere, when player connects maybe:
Код:
elevator[playerid] = CreateObject(971, 1432.4000244141, 1383.5, 11.10000038147, 90, 0, 0);
But im not tested it yet. If it works, so do i see all that elevators of all players, or only mine?
Reply
#2

use Incognito streamer and still I wouldnt suggest to use perplayer objs for elevator, wont look cool as they can desync very bad and for each player lift will be in own floor at the end.
Reply
#3

Yea, that idea is not so good for elevator. But my server will be deathmatch, so you die fast and you want to move up with elevator, so what u must do if other player already moving up?

And also, i tested it and it works as i needed.
Reply
#4

You could simply make the object move faster and make a boolean to check if the elevator is moving when a player wants to get the elevator to him.

pawn Код:
new bool:iselevatormoving;

if(iselevatormoving==true) // The elevator is moving
{
}

if(iselevatormoving==false) // The elevator is not moving.
{
}

Then you would not need to use per player objects.
Reply
#5

I need to make that it moves slow, so players must wait until other player finish moving, so it makes players nervous while waiting...
But anyway, i made that what i needed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)