pawn Код:
if(strcmp(cmd,"/guinchar",true)==0 || strcmp(cmd,"/rebocar",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(IsARebocadores(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 525)
{
if(GetPlayerState(playerid)==2)
{
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)))
{
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
}
else
{
AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
}
}
}
if(!Found)
{
SendClientMessage(playerid,COLOR_GREY,"Nгo tem nenhum carro perto.");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Vocк precisa estar dirigindo!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo tem um Guincho!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo estб em um guincho!");
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_GRAD2,"Vocк nгo й mecanico!");
return 1;
}
}
return 1;
}