Q:How to get a owned vehicle by a player stay when he is offline
#1

So i am making a roleplay script and i can't figure out how to make a vehicle stay in the same place when a player left the server any hints or tips?
Reply
#2

pawn Код:
enum vehicles{
    Float:vX,
    Float:vY,
    Float:vZ
}
new LastPos[MAX_VEHICLES][vehicles];

public OnPlayerDisconnect(playerid,reason)
{
    new vid = GetPlayerVehicleID(playerid),
    Float:x,
    Float:y,
    Float:z
    ;

    GetPlayerPos(playerid,x,y,z);

    if(vid != INVALID_VEHICLE_ID)
    {
        LastPos[vid][vX] = x;
        LastPos[vid][vY] = y;
        LastPos[vid][vZ] = z;
    }
    return 1;
}
Wrote this just now. Not sure how much use it'd be :P i guess it sorta gives the general idea of it. Then use a timer maybe? to check if its in its X Y Z pos and set it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)