A legújabb alkotásom:
#define JARMUVEL 1
#define JARMUNELKUL 0
stock Teleport(playerid,Float:x,Float:y,Float:z,interior,vw,withveh)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new veh = GetPlayerVehicleID(playerid);
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i,veh) && i != playerid)
{
RemovePlayerFromVehicle(i);
}
}
if(withveh == 1)
{
new Float:a;
GetPlayerFacingAngle(playerid,a);
SetPlayerPos(playerid,x,y,z);
SetPlayerInterior(playerid,interior);
SetPlayerFacingAngle(playerid,a);
SetPlayerVirtualWorld(playerid,vw);
SetVehiclePos(veh,x,y,z);
LinkVehicleToInterior(veh,interior);
SetVehicleVirtualWorld(veh, vw);
SetVehicleZAngle(veh, a);
}
else
{
RemovePlayerFromVehicle(playerid);
new Float:a;
GetPlayerFacingAngle(playerid,a);
SetPlayerPos(playerid,x,y,z);
SetPlayerInterior(playerid,interior);
SetPlayerFacingAngle(playerid,a);
SetPlayerVirtualWorld(playerid,vw);
}
return 1;
}
new Float:a;
GetPlayerFacingAngle(playerid,a);
SetPlayerPos(playerid,x,y,z);
SetPlayerInterior(playerid,interior);
SetPlayerFacingAngle(playerid,a);
SetPlayerVirtualWorld(playerid,vw);
return 1;
}
Használat:
CMD:teleboltba(playerid,params[])
{
Teleport(playerid,x,y,z,interior,virtualworld,JARMUNELKUL); //Általában boltba nem kocsival megyünk
return 1;
}
CMD:telegarazsba(playerid,params[])
{
Teleport(playerid,x,y,z,interior,virtualworld,JARMUVEL);
return 1;
}
További ötleteket várok Függvénykönyvtár,Kód, vagy Filterscript készítéséhez.