Bonjour,
J'ai un léger problème sur mon script :
if(strcmp(cmd, "/tracter", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 525)
{
new Float:pX,Float:pY,Float:pZ;
GetPlayerPos(playerid,pX,pY,pZ);
new Float:vX,Float:vY,Float:vZ;
new Found=0;
new Founda=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)))
{
if(Founda==0)
{
AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
Founda=1;
}
else if(Founda==1)
{
DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
Founda=0;
}
}
}
if (!Found)
{
}
}
}
}
Si je fais /tracter, le véhicule est bien accrocher mais je ne peux pas le détacher si je refais la commande, et si le véhicule tombe, je ne peux pas le reprendre.
Pouvez-vous m'aider ?
Merci de vos réponses.