22.09.2010, 04:13
Hi guys. Yesterday I got a simple teleport FS working via the Scoreboard, and here's the current code:
It works as I want it, so if you are driving it teleports you as well as your car and any passengers. But...
What I'd like to do is the following:
Any help would be greatly appreciated. Thanks in advance!
pawn Код:
#define FILTERSCRIPT
#include <a_samp>
public OnFilterScriptInit()
{
print("\n----------------------------------------------");
print(" Teleport-to-player via Scoreboard by WizardCM");
print("----------------------------------------------\n");
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(clickedplayerid, X, Y, Z);
if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid), X+5, Y+5, Z);
else SetPlayerPos(playerid, X+1, Y+1, Z);
return 1;
}
What I'd like to do is the following:
Quote:
When teleporting to someone, check if the other player is in a car. If they are, check if there are any passenger seats available. If there are, teleport to their car as a passenger. Otherwise just teleport normally. |