Guten Tag ich möchte dne wohnwagen anhänger für mehrere cars machen aber es geht nicht habe es derzeit so
//living wage trailer system by by Fenestro
//Credits to zeruel_angel
#define FILTERSCRIPT
#include <a_samp>
#if defined FILTERSCRIPT
#endif
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/wohnwagen", cmdtext, true, 10) == 0)
{
if (GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 607)
{
new Wohnwagen;
Wohnwagen = CreateObject(3168,-0.08024827,-3.01626158,-0.98281312,0.00000000,0.00000000,179.50000000); //object(trailer2_01) (1)
AttachObjectToVehicle(Wohnwagen,(GetVehicleTrailer(GetPlayerVehicleID(playerid))),-0.05965903,-3.25522375,-0.98281312,0.00000000,0.00000000,179.49462891);
return 1;
}
}
if (strcmp("/abhängen", cmdtext, true, 10) == 0)
{
if (GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 607)
{
DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
return 1;
}
}
return 0;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if ((newkeys==KEY_ACTION)&&(IsPlayerInAnyVehicle(playerid))&&(GetPlayerState(playerid)==PLAYER_STATE_DRIVER))
{
if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 508) if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 542) if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 442) if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 402)if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 491) if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 542)
{
new Float:pX,Float:pY,Float:pZ;
GetPlayerPos(playerid,pX,pY,pZ);
new Float:vX,Float:vY,Float:vZ;
new Found=0;
new vid=0;
while((vid<MAX_VEHICLES)&&(!Found))
{
vid++;
GetVehiclePos(vid,vX,vY,vZ);
if ((floatabs(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
{
Found=1;
if (IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
}
AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
SendClientMessage(playerid,0xFFFF00AA,"Anhänger angekoppelt!");
}
}
if (!Found)
{
SendClientMessage(playerid,0xFFFF00AA,"Es ist kein Anhänger in deiner nähe.");
}
}
}
return 1;
}
aber da geht im moemnt kein car wie kann ich es machen das sie gehn
LG exodus