SA-MP Forums Archive
Vehicle Streaming [Q] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Vehicle Streaming [Q] (/showthread.php?tid=200735)



Vehicle Streaming [Q] - scottyishere - 19.12.2010

Is there any callback like:

pawn Код:
IsVehicleStreamedForPlayer(playerid,vehicleid)
It should work with:

pawn Код:
OnVehicleStreamIn(vehicleid,forplayerid)
OnVehicleStreamOut(vehicleid,forplayerid)
Hmm?


Re: Vehicle Streaming [Q] - Mean - 19.12.2010

Can't find it on wiki, so, I don't think that this exsists.


Re: Vehicle Streaming [Q] - Ash. - 19.12.2010

Surely you could use IsPlayerInRangeOfPoint?

For example:

pawn Код:
stock IsVehicleStreamedInForPlayer(playerid, vehicleid)
{
     new Float:x, Float:y, Float:z;
     GetVehiclePos(vehicleid, x, y, z);
     if(IsPlayerInRangeOfPoint(playerid, 15.0, x, y, z) return 1;
     return 0;
}
returns 1 if they are near enough the vehicle, 0 otherwise.


Re: Vehicle Streaming [Q] - scottyishere - 19.12.2010

Quote:
Originally Posted by funky1234
Посмотреть сообщение
Surely you could use IsPlayerInRangeOfPoint?

For example:

pawn Код:
stock IsVehicleStreamedInForPlayer(playerid, vehicleid)
{
     new Float:x, Float:y, Float:z;
     GetVehiclePos(vehicleid, x, y, z);
     if(IsPlayerInRangeOfPoint(playerid, 15.0, x, y, z) return 1;
     return 0;
}
returns 1 if they are near enough the vehicle, 0 otherwise.
What's the distance when the cars get streamed?


Re: Vehicle Streaming [Q] - wups - 19.12.2010

You can't even make a code like this?
pawn Код:
new bool:Streamed[MAX_VEHICLES][MAX_PLAYERS];

public OnPlayerConnect(playerid) for(new i;i<MAX_VEHICLES;i++) Streamed[i][playerid]=false;

stock IsVehicleStreamedInForPlayer(playerid,vehicleid) return Streamed[vehicleid][playerid];
public OnVehicleStreamIn(vehicleid,forplayerid)
{
    Streamed[vehicleid][playerid]=true;
}
public OnVehicleStreamOut(vehicleid,forplayerid)
{
   Streamed[vehicleid][playerid]=false;
}



Re: Vehicle Streaming [Q] - scottyishere - 19.12.2010

Quote:
Originally Posted by wups
Посмотреть сообщение
You can't even make a code like this?
pawn Код:
new bool:Streamed[MAX_VEHICLES][MAX_PLAYERS];

public OnPlayerConnect(playerid) for(new i;i<MAX_VEHICLES;i++) Streamed[i][playerid]=false;

stock IsVehicleStreamedInForPlayer(playerid,vehicleid) return Streamed[vehicleid][playerid];
public OnVehicleStreamIn(vehicleid,forplayerid)
{
    Streamed[vehicleid][playerid]=true;
}
public OnVehicleStreamOut(vehicleid,forplayerid)
{
   Streamed[vehicleid][playerid]=false;
}
Great!

Didn't think about that.