Nem vagyok túl jó scripter ezért a segitségeteket kérném. Van egy kocsi(Ambulance) és ahhoz kéne egy parancs, hogy /berak és van a kocsihoz egy Filterscript aminek a neve: AmubInterior és abban egy animáció. Nekem az kéne, hogy ha mellé állok kocsival a sérültnek és beirom /berak akkor berakja õt ebbe az interiorba és ebbe az animációba.
Ha kell odaadom az AmbuInt filterscriptet és a /berak-ot külön.
Ezt tudtam kihozni én, de tuti h nem jó:S
#include <a_samp>
#define FILTERSCRIPT
new InAmbu[MAX_PLAYERS];
new Float:Pos[MAX_PLAYERS][3];
new Float:Angle[MAX_PLAYERS];
new Interior[MAX_PLAYERS];
public OnFilterScriptInit()
{
print(\" Ambulance Interior by Cybertron Loaded!\");
CreateObject(1698, 2002.0, 2285.0, 1010.0, 0.0, 0.0, 0.0);
CreateObject(1698, 2003.36, 2285.0, 1010.0, 0.0, 0.0, 0.0);
CreateObject(1698, 2004.72, 2285.0, 1010.0, 0.0, 0.0, 0.0);
CreateObject(1698, 2002.0, 2288.3, 1010.0, 0.0, 0.0, 0.0);
CreateObject(1698, 2003.36, 2288.3, 1010.0, 0.0, 0.0, 0.0);
CreateObject(1698, 2004.72, 2288.3, 1010.0, 0.0, 0.0, 0.0);
CreateObject(3386, 2001.58, 2285.75, 1010.1, 0.0, 0.0, 180.0);
CreateObject(3388, 2001.58, 2284.8, 1010.1, 0.0, 0.0, 180.0);
CreateObject(2146, 2003.3, 2286.4, 1010.6, 0.0, 0.0, 0.0);
CreateObject(16000, 2001.3, 2281.0, 1007.5, 0.0, 0.0, 270.0);
CreateObject(16000, 2005.4, 2281.0, 1007.5, 0.0, 0.0, 90.0);
CreateObject(18049, 2006.0, 2279.5, 1013.05, 0.0, 0.0, 90.0);
CreateObject(2639, 2005.0, 2285.55, 1010.7, 0.0, 0.0, 90.0);
CreateObject(3791, 2005.3, 2288.25, 1012.4, 270.0, 0.0, 90.0);
CreateObject(2174, 2001.7, 2286.74, 1010.1, 0.0, 0.0, 90.0);
CreateObject(2690, 2001.41, 2287.0, 1011.25, 0.0, 0.0, 90.0);
CreateObject(2163, 2001.3, 2286.84, 1011.9, 0.0, 0.0, 90.0);
CreateObject(1789, 2005.1, 2284.1, 1010.7, 0.0, 0.0, 270.0);
CreateObject(1369, 2001.85, 2283.85, 1010.7, 0.0, 0.0, 90.0);
CreateObject(3384, 2001.9, 2288.85, 1011.1, 0.0, 0.0, 180.0);
CreateObject(3395, 2005.3, 2288.32, 1010.05, 0.0, 0.0, 0.0);
CreateObject(11469, 2008.6, 2294.5, 1010.1, 0.0, 0.0, 90.0);
CreateObject(2154, 2001.55, 2289.75, 1010.0, 0.0, 0.0, 90.0);
CreateObject(2741, 2001.4, 2289.65, 1012.0, 0.0, 0.0, 90.0);
CreateObject(2685, 2001.35, 2289.65, 1011.5, 0.0, 0.0, 90.0);
CreateObject(18056, 2005.4, 2290.4, 1011.9, 0.0, 0.0, 180.0);
CreateObject(2688, 2001.4, 2283.85, 1012.0, 0.0, 0.0, 90.0);
CreateObject(2687, 2005.35, 2286.0, 1012.0, 0.0, 0.0, 270.0);
CreateObject(16000, 2006.5, 2290.0, 1020.0, 0.0, 180.0, 180.0);
CreateObject(16000, 1991.0, 2283.4, 1016.0, 0.0, 90.0, 0.0);
CreateObject(16000, 2015.7, 2283.4, 1016.0, 0.0, 270.0, 0.0);
CreateObject(1719, 2005.0, 2284.1, 1010.6, 0.0, 0.0, 270.0);
CreateObject(1718, 2005.1, 2284.1, 1010.73, 0.0, 0.0, 270.0);
CreateObject(1785, 2005.1, 2284.1, 1010.95, 0.0, 0.0, 270.0);
CreateObject(1783, 2005.05, 2284.1, 1010.4, 0.0, 0.0, 270.0);
}
public OnFilterScriptExit()
{
print(\" Ambulance Interior Unloaded...\");
DestroyObject(1);
DestroyObject(2);
DestroyObject(3);
DestroyObject(4);
DestroyObject(5);
DestroyObject(6);
DestroyObject(7);
DestroyObject(;
DestroyObject(9);
DestroyObject(10);
DestroyObject(11);
DestroyObject(12);
DestroyObject(13);
DestroyObject(14);
DestroyObject(15);
DestroyObject(16);
DestroyObject(17);
DestroyObject(18);
DestroyObject(19);
DestroyObject(20);
DestroyObject(21);
DestroyObject(22);
DestroyObject(23);
DestroyObject(24);
DestroyObject(25);
DestroyObject(26);
DestroyObject(27);
DestroyObject(28);
DestroyObject(29);
DestroyObject(30);
DestroyObject(31);
DestroyObject(32);
DestroyObject(33);
DestroyObject(34);
DestroyObject(35);
}
public OnPlayerConnect(playerid)
{
InAmbu[playerid] = 0;
Watching[playerid] = 0;
Goto[playerid] = 0;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
InAmbu[playerid] = 0;
Watching[playerid] = 0;
Goto[playerid] = 0;
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
InAmbu[playerid] = 0;
Watching[playerid] = 0;
Goto[playerid] = 0;
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_PASSENGER && GetVehicleModel(GetPlayerVehicleID(playerid)) == 416)
{
SetPlayerPos(playerid, 2003.3, 2284.2, 1011.1);
SetPlayerFacingAngle(playerid, 0);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 1);
InAmbu[playerid] = GetPlayerVehicleID(playerid);
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == 16 && InAmbu[playerid] > 0)
{
new Float:X, Float:Y, Float:Z;
GetVehiclePos(InAmbu[playerid], X, Y, Z);
SetPlayerPos(playerid, X+4, Y, Z);
SetPlayerInterior(playerid, 0);
InAmbu[playerid] = 0;
}
return 1;
}
if(strcmp(cmd, \"/berak\", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, \"HASZNÁLAT: /berak [playerid/PartOfName]\");
return 1;
}
new newcar = GetPlayerVehicleID(playerid);
new playa;
playa = ReturnUser(tmp);
if(PlayerInfo[playerid][pLeader] != 4 || PlayerInfo[playerid][pMember] != 4)
{
SendClientMessage(playerid, COLOR_GREY, \" Nem vagy mentõs !\");
return 1;
}
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playa,x,y,z);
if(PlayerToPoint(5, playerid, x, y, z))
{
PutPlayerInVehicle(playa,newcar,1);
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), \"* Valakit beraktak egy mentõs kocsiba a.\");
ProxDetector(30.0, playerid, strinCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
PlayerCuffed[giveplayerid] = 0;
PlayerCuffedTime[giveplayerid] = 0;
SetPlayerPos(giveplayerid, 2003.2, 2286.5, 1011.9);
SetPlayerFacingAngle(giveplayerid, 163);
ClearAnimations(giveplayerid);
ApplyAnimation(giveplayerid, \"BEACH\", \"Lay_Bac_Loop\", 4.0, 1, 0, 0, 0, 0);
GetPlayerName(playerid, sendername, sizeof(sendername));
printf(\"%s hasznalta a /berak parancsot.\", sendername);
}
else
{
SendClientMessage(playerid, COLOR_GREY, \"A Játékos túl messze van!.\");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, \"Nem vagy mentõs!\");
}
}
return 1;
}